- Security:
- User Authentication & Authorization (secure access control)
- User Management:
- Email Verification (confirm user accounts)
- Password Recovery (reset forgotten passwords)
- Cloud Integration & Storage:
- AWS S3 (file uploads and storage)
- Amazon RDS (scalable data storage)
- Payment Processing:
- Stripe (secure payment transactions)
- Notifications:
- Email Notifications (timely user communication)
- Continuous Integration/Continuous Deployment:
- AWS CodePipeline (automated deployment workflows)
- DockerHub
- User Experience:
- Fast Filtering (efficient search capabilities)
- Artificial Intelligence:
- ChatGPT Integration (AI-driven analytics and interactions)
- Core Programming Languages:
- TypeScript (primary)
- JavaScript (when necessary)
- Server Environment: Node.js
- Primary Frameworks: Express.js
- Database Intergration: TypeORM (for database management)
- Payment Processing: Stripe
- Storage Solutions: Amazon S3 (for static file hosting and management)
- Continuous Integration/Continous Deployment:
- AWS CLI
- DockerHub
Before proceeding, ensure that you have git
and Node.js
with npm
installed on your machine.
Clone the project repository to your local machine with the following command:
git clone [email protected]:V1rushB/ExpenElixir.git .
npm install
The default port for the project is 2077. To change that just set up the PORT
environment variable
when using docker ensure that you have mapped the ports correctly to avoid any run time issue.
To run the application you can use this command:
npm run dev
Remember to map the following:
Port 80
to the application's PORT
for HTTP
Port 443
to the application's PORT
for HTTPS
you'll also need to setup other environment variables in order for the application to run properly.
POST /user/register
Endpoint for user registration.
Field | Type | Description | Required |
---|---|---|---|
username |
String | Username of the new user. | Yes |
password |
String | Password for the new user. | Yes |
email |
String | Email address of the new user. | Yes |
firstName |
String | First name of the User | Yes |
lastName |
String | Last name of the User | Yes |
phoneNumber |
String | Phone number of the User | No |
Currency |
String | User's currency, default is USD | No |
201
: Created
User has successfully registered and must verify his email.
Example Value:
{
"username": "v1rushb",
"email": "[email protected]",
"password": "password",
"firstName": "Bashar",
"lastName": "Herbawi",
"phoneNumber": "0599999999"
}
-
423
: Locked User tried to access the service before verifying email -
409
: Conflict User tried to register using an existing email or username. -
400
: Bad Request User didn't provide the necessary fields to register. Example Value:
{
"password": "password",
"firstName": "Bashar",
"lastName": "Herbawi",
"phoneNumber": "0599999999"
}
email is Required.
username is Required.
500
: Internal Server Error
POST /user/login
Endpoint for user login.
Field | Type | Description | Required |
---|---|---|---|
username |
String | Username of the new user. | Yes |
password |
String | Password for the new user. | Yes |
Field | Type | Description | Required |
---|---|---|---|
username |
String | Username of the new user. | Yes |
password |
String | Password for the new user. | Yes |
IAMID |
String | ID of creaetd user under some user's business | Yes |
200
: OK
User has logged in.
Example Value:
{
"username": "v1rushb",
"password": "password",
}
{
"username": "v1rushb",
"password": "password",
"IAMID": "012345678901"
}
You have successfully logged in v1rushb!
-
423
: Locked User tried to access the service before verifying email -
409
: Conflict User tried login but already logged in. -
401
: Unauthorized IAM user of an expired Business user tries to login User tried to login with invalid username or password. -
400
: Bad Request User tried to log in when he is already logged in Example Value:
{
"username": "v1rushA",
"password": "password"
}
Invalid credentials
500
: Internal Server Error
POST /user/logout
Endpoint for user logout.
Empty Body
200
: OK User logged out successfully. Example Value:
{
}
You have been logged out. See you soon v1rushb!
You have successfully logged in v1rushb!
-
423
: Locked User tried to access the service before verifying email -
409
: Conflict User tried login but already logged in. -
401
: Unauthorized User tried to logout without being logged in. -
500
: Internal Server Error
GET /user/balance
Endpoint for getting user balance. this will send the user a number which represents current balance.
Empty body.
200
: OK User successfully recieved his balance. Example Value:
{
}
{
Your total income is: 400000 USD
}
-
401
: Unauthorized User is not logged in. -
500
: Internal Server Error
POST /user/upgrade-to-business
Endpoint for upgrading a normal user to a business user.
Field | Type | Description | Required |
---|---|---|---|
card |
number | number of the user's credit cards | Yes |
200
: OK Payment succeeded Example Value:
{
"card": "2"
}
Payment succeeded
-
400
: Bad request User tried to upgrade to business but already a business user. Card expired Insufficient funds Payment failed. -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to upgrade without being logged in. IAM user tried to upgrade. -
500
: Internal Server Error
DELETE /user/delete-account
Endpoint for a user to delete their account.
Empty body
200
: OK Account deletion succeeded Example Value:
{
}
Your account has been deleted successfully.
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in -
500
: Internal Server Error
POST /user/reset-password
Endpoint for a user to reset password.
Field | Type | Description | Required |
---|---|---|---|
email |
string | Forgotten password user's email | Yes |
newPassword |
string | New password | Yes |
200
: OK Email has been sent Example Value:
{
"email": "[email protected]"
"newPassword": "ASD@!#%%lg^SDZC&sd*FDdas^S"
}
Please check your mailbox for to continue in resetting your passwrd.
-
400
: Bad request Email not provided Password not provided Old password is the same as new password weak password. -
404
: Not found User not found -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
PUT /user
Endpoint for a user to update his information.
Field | Type | Description | Required |
---|---|---|---|
username |
String | Username of the new user. | Yes |
password |
String | Password for the new user. | Yes |
email |
String | Email address of the new user. | Yes |
firstName |
String | First name of the User | Yes |
lastName |
String | Last name of the User | Yes |
phoneNumber |
String | Phone number of the User | No |
phoneNumber |
String | User's currency, default is USD | No |
200
: OK Email has been sent Example Value:
{
"email": "[email protected]"
"newPassword": "ASD@!#%%lg^SDZC&sd*FDdas^S"
}
Please check your mailbox for to continue in resetting your passwrd.
-
400
: Bad request Invalid password -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in.
POST /income
Endpoint for a user to add a new income
Field | Type | Description | Required |
---|---|---|---|
title |
String | Income's title | Yes |
amount |
String | Income's amount | Yes |
incomeDate |
String | Income's date | Yes |
description |
String | Income's description | No |
200
: OK Income has been created Example Value:
{
"title": "Footfill",
"amount": "20000",
"incomeDate": "2023-10-10T15:11:54.000Z",
"description": "some income"
}
You have successfully added a new income!
-
400
: Bad request Empty body Any empty attribute -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in.
PUT /income/total
Endpoint for a user to get their total income.
Empty body
200
: OK Income has been created Example Value:
{
}
Total income: 40000
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in.
get /income/total
Endpoint for a user to get his incomes
Empty body
200
: OK will send total income Example Value:
{
}
Total income: 40000 USD
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in.
get /income
Endpoint for a user to get his incomes
Empty body
200
: OK will return user's incomes Example Value:
{
}
[
{
"id": "908fef0a-5a84-455e-8407-8d63d0ebd1e2",
"title": "Footfill",
"amount": 20000,
"incomeDate": "2023-10-10T15:11:54.000Z",
"description": "some income"
}
]
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in.
DELETE /income/all-incomes
Endpoint for a user to delete all their incomes
Empty body
200
: OK All incomes will be deleted. Example Value:
{
}
You have successfully deleted all incomes!
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in.
DELETE /income/:id
Endpoint for a user to delete all their incomes
id : string
200
: OK The income with specified ID will be deleted Example Value:
{
}
You have successfully deleted the income with id: c0bbbf41-18aa-48d8-b9b4-859e6cd056cf
-
400
: Bad request ID is required -
404
: Not found Income with specified ID wasn't found. -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in.
PUT /income
Endpoint for a user to add a new income
Field | Type | Description | Required |
---|---|---|---|
title |
String | Income's title | Yes |
amount |
String | Income's amount | Yes |
incomeDate |
String | Income's date | Yes |
description |
String | Income's description | No |
200
: OK Income has been modified Example Value:
{
"title": "Footfill",
"amount": "40000",
"incomeDate": "2023-10-10T15:11:54.000Z",
"description": "some income"
}
You have successfully modified your income.
-
400
: Bad request Empty body Any empty attribute -
404
: Not found Income with specified id wasn't found. -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
POST /expense
Endpoint for a user to add a new expense
Field | Type | Description | Required |
---|---|---|---|
title |
String | Expense's title | Yes |
amount |
String | Expense's amount | Yes |
expenseDate |
String | Expense's date | Yes |
description |
String | Expense's description | No |
category |
String | category id in which expense lies in | No |
picURL |
String | a picture attached to the Expense | No |
200
: OK Expense has been created Example Value:
{
"title": "very huge bill",
"amount": "1002336",
"expenseDate": "2023-10-10T15:11:54.000Z",
"description": "a bill that costed me a lot",
"category":"c2fb359b-3840-4c71-b2e6-aa41e77d5b9f"
}
You have successfully added a new Expense!
-
400
: Bad request Empty body Any empty attribute -
404
: Not found Category not found. -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /expense
Endpoint for a user to get their expenses
Empty body
200
: OK Expenses has been sent to the user Example Value:
{
}
[
{
"id": "31630012-77bf-4f52-9bbc-b2c0fe60de98",
"title": "very huge bill",
"amount": 1002336,
"expenseDate": "2023-10-10T15:11:54.000Z",
"description": "a bill that costed me a lot",
"picURL": "http://default",
"category": {
"id": "c2fb359b-3840-4c71-b2e6-aa41e77d5b9f",
"title": "USA",
"description": "my cat bro",
"budget": 100000,
"totalExpenses": 2004672
}
},
{
"id": "46ef299c-fc26-42af-8cc9-c5929ed1c21b",
"title": "very huge bill",
"amount": 1002336,
"expenseDate": "2023-10-10T15:11:54.000Z",
"description": "a bill that costed me a lot",
"picURL": "http://default",
"category": {
"id": "c2fb359b-3840-4c71-b2e6-aa41e77d5b9f",
"title": "USA",
"description": "my cat bro",
"budget": 100000,
"totalExpenses": 2004672
}
}
]
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /expense/total
Endpoint for a user to get the total of all expenses
Empty body
200
: OK successfully sent the user total expenses amount Example Value:
{
}
Total expenses: 2004672
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
DELETE /expense/all-expenses
Endpoint for a user to delete all expenses
Empty Body
200
: OK Deleted all user's expenses Example Value:
{
}
You have successfully deleted all expenses!
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
DELETE /expense/:id
Endpoint for a user to delete a specified expense
id : string
200
: OK Deleted the specified expense Example Value:
{
}
You have successfully deleted the expense with id: 0ba4ccff-035a-45de-bcb5-e842aee22139
-
400
: Bad request Required ID -
404
: Not found Expense with specified ID wasn't found -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
DELETE /expense/:id
Endpoint for a user to delete a specified expense
id : string
200
: OK Deleted the specified expense Example Value:
{
}
You have successfully deleted the expense with id: 0ba4ccff-035a-45de-bcb5-e842aee22139
-
400
: Bad request Required ID -
404
: Not found Expense with specified ID wasn't found -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
PUT /expense
Endpoint for a user to modify and existing expense.
Field | Type | Description | Required |
---|---|---|---|
title |
String | Expense's title | Yes |
amount |
String | Expense's amount | Yes |
expenseDate |
String | Expense's date | Yes |
description |
String | Expense's description | No |
category |
String | category id in which expense lies in | No |
picURL |
String | a picture attached to the Expense | No |
200
: OK Expense has been modified. Example Value:
{
"title": "very huge bill",
"amount": "1002336",
"expenseDate": "2023-10-10T15:11:54.000Z",
"description": "a bill that costed me a lot",
"category":"c2fb359b-3840-4c71-b2e6-aa41e77d5b9f"
}
You have successfully modified the expense!
-
400
: Bad request Empty body Any empty attribute -
404
: Not found Expense wasn't found. Category not found. -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
POST /category
Endpoint for a user to add a new category
Field | Type | Description | Required |
---|---|---|---|
title |
String | Category's title | Yes |
budget |
String | Category's lookup limit budget | Yes |
description |
String | Category's description | No |
200
: OK Category has been created Example Value:
{
"title" : "USA",
"description" : "my cat bro",
"budget": "100000"
}
You have successfully added a new category!
-
400
: Bad request Empty body Any empty attribute -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /category
Endpoint for a user to get all categories
Empty body
200
: OK Categories will be sent to the user Example Value:
{
}
[
{
"id": "aeddd75a-a399-46bb-b1d2-bb8ad43fce0b",
"title": "Palestine",
"description": "my cat bro",
"budget": 100000,
"totalExpenses": 0
},
{
"id": "c2fb359b-3840-4c71-b2e6-aa41e77d5b9f",
"title": "USA",
"description": "my cat bro",
"budget": 100000,
"totalExpenses": 3007008
}
]
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
DELETE /category/all-categories
Endpoint for a user to delete all categories
Empty body
200
: OK All categories will be deleted. Example Value:
{
}
You have successfully deleted all categories!
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
DELETE /category/:id
Endpoint for a user to delete a specific category
id : string
200
: OK The specified category will be deleted Example Value:
{
}
You have successfully deleted the category with id: d70a57f2-f6a0-4109-b6fd-4e4a6787d535!
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
PUT /category/:id
Endpoint for a user to modify a category
id : string
Field | Type | Description | Required |
---|---|---|---|
title |
String | Category's title | Yes |
budget |
String | Category's lookup limit budget | Yes |
description |
String | Category's description | No |
200
: OK Category has been modified Example Value:
{
"title" : "Palestine",
"description" : "love <3",
"budget": "100000"
}
You have successfully modified the category!
-
400
: Bad request Empty body Any empty attribute -
404
: Not found Category with specified ID wasn't found. -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
POST /user/business/add-user
Endpoint for a business user to add a user under their business
Field | Type | Description | Required |
---|---|---|---|
username |
String | Username of the new user. | Yes |
password |
String | Password for the new user. | Yes |
email |
String | Email address of the new user. | Yes |
firstName |
String | First name of the User | Yes |
lastName |
String | Last name of the User | Yes |
phoneNumber |
String | Phone number of the User | No |
Currency |
String | User's currency, default is USD | No |
201
: Created Descendant user has been created Example Value:
{
"firstName": "Zain",
"lastName": "Herbawi",
"email": "[email protected]",
"username": "z1rushb",
"password": "!@R4F324DSdFgh#@5%fg@j#FSDFasd2",
"phoneNumber": "05999999245"
}
z1rushb has been successfully added to your business. A verification email has been sent to [email protected]!
-
400
: Bad request Empty body Any empty attribute -
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. IAM or Normal users tried to access. -
500
: Internal Server Error
GET /user/business/
Endpoint for a business user to get all the users under their business.
Empty
200
: OK Sends the business user all the users in their business including themselves. Example Value:
{
}
{
[
{
"id": "5357e5e2-ce8b-470c-846d-d1848b83fa8c",
"username": "z1rushb",
"email": "[email protected]",
"password": "$2b$10$NCVYw3bkWTzq8wtGrl7GI.TSrQwZSraXLcbqpbYsrpXe/sCe/cAoS",
"iamId": "1698492870296",
"isVerified": true,
"verificationToken": " ",
"resetToken": null,
"resetTokenExpiration": null,
"newHashedPassword": null,
"createdAt": "2023-10-28T15:34:30.384Z",
"business": {
"id": "394dc8e3-9e32-4782-89ee-e86e2e50491e",
"businessName": "Basharr's Business",
"rootUserID": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
},
"expenses": [],
"categories": [],
"incomes": [],
"profile": {
"id": "9b9ec30a-8938-4fde-be26-570577e1847d",
"firstName": "Zain",
"lastName": "Herbawi",
"phoneNumber": "05999999245",
"Currency": "USD",
"role": "User",
"subscription_date": null,
"hasSentEmail": null
}
},
{
"id": "54a2d3d8-7e3f-4883-aa45-185ca059f905",
"username": "v1rushbb",
"email": "[email protected]",
"password": "$2b$10$SxQKhUzY3SnU8njAFudx3u1sLgumWGfMlU7.GvIS/uM.DUtU/K/JG",
"iamId": null,
"isVerified": true,
"verificationToken": " ",
"resetToken": null,
"resetTokenExpiration": null,
"newHashedPassword": null,
"createdAt": "2023-10-27T19:43:40.303Z",
"business": {
"id": "394dc8e3-9e32-4782-89ee-e86e2e50491e",
"businessName": "Basharr's Business",
"rootUserID": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
},
"expenses": [],
"categories": [
{
"id": "f6f91e39-0f95-45e6-9b45-a594baed7644",
"title": "Palestine",
"description": "love <3",
"budget": 100000,
"totalExpenses": 0
}
],
"incomes": [
{
"id": "c0bbbf41-18aa-48d8-b9b4-859e6cd056cf",
"title": "Footfill",
"amount": 40000,
"incomeDate": "2023-10-10T15:11:54.000Z",
"description": "some income"
}
],
"profile": {
"id": "6b39c160-feda-4c75-b519-2805fec9fbf0",
"firstName": "Basharr",
"lastName": "Herbawi",
"phoneNumber": "0599999999",
"Currency": "USD",
"role": "Root",
"subscription_date": "2023-10-28T11:34:26.000Z",
"hasSentEmail": false
}
}
]
}
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. IAM or Normal users tried to access. -
500
: Internal Server Error
GET /user/business/balance
Endpoint for a business user to get total balance under their business.
Empty
200
: OK Sends the business user all the users in their business including themselves. Example Value:
{
}
Your business balance is: 40000
-
423
: Locked User tried to access the service before verifying email -
401
: Unauthorized User tried to access without being logged in. IAM or Normal users tried to access. -
500
: Internal Server Error
POST /income/business/add-user-income
Endpoint for a business user to add an income to any user under their business
id: string
Field | Type | Description | Required |
---|---|---|---|
title |
String | Income's title | Yes |
amount |
String | Income's amount | Yes |
incomeDate |
String | Income's date | Yes |
description |
String | Income's description | No |
201
: Created An income has been created and assigned to that user. Example Value:
{
"title": "Footfill",
"amount": "40000",
"incomeDate": "2023-10-10T15:11:54.000Z",
"description": "some income"
}
You have successfully added a new income!
-
400
: Bad request Any empty attribute -
401
: Unauthorized User tried to access without being logged in. IAM or Normal users tried to access. -
500
: Internal Server Error
DELETE /income/business/add-user-income
Endpoint for a business user to delete an income of a user under their business.
id: string
Field | Type | Description | Required |
---|---|---|---|
userid |
String | target user's id | Yes |
201
: Created targets an exact income for a certain user and deletes it. Example Value:
{
"userid": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
}
You have successfully added a new income!
-
400
: Bad request Any missing attribute -
404
: Not found Income not found. -
401
: Unauthorized User tried to access without being logged in. IAM or Normal users tried to access. -
500
: Internal Server Error
GET /income/business
Endpoint for a business user to get all business's incomes.
Empty body.
200
: OK Sends the business user all business's incomes Example Value:
{
}
[
{
"id": "99ae0e91-c14b-4b4a-a6b0-75667ebaa464",
"title": "Footfill",
"amount": 40000,
"incomeDate": "2023-10-10T15:11:54.000Z",
"description": "some income",
"userId": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
}
]
-
401
: Unauthorized User tried to access without being logged in. IAM or Normal users tried to access. -
500
: Internal Server Error
PUT /income/business
id: string
Field | Type | Description | Required |
---|---|---|---|
title |
String | Income's title | Yes |
amount |
String | Income's amount | Yes |
incomeDate |
String | Income's date | Yes |
description |
String | Income's description | No |
200
: OK Sends the business user all business's incomes Example Value:
{
"title": "Footfill",
"amount": "80000",
"incomeDate": "2023-10-10T15:11:54.000Z",
"description": "some income"
}
You have successfully modified the income!
-
400
: Bad request Missing attributes -
401
: Unauthorized User tried to access without being logged in. IAM or Normal users tried to access. -
404
: Not found Specified user wasn't found. -
500
: Internal Server Error
POST /expense/business/add-user-expense
Endpoint for a user to add a new expense for a user.
id: string => user's id.
Field | Type | Description | Required |
---|---|---|---|
title |
String | Expense's title | Yes |
amount |
String | Expense's amount | Yes |
expenseDate |
String | Expense's date | Yes |
description |
String | Expense's description | No |
category |
String | category id in which expense lies in | No |
picURL |
String | a picture attached to the Expense | No |
200
: OK Expense has been created Example Value:
{
"title": "very huge bill",
"amount": "1002336",
"expenseDate": "2023-10-10T15:11:54.000Z",
"description": "a bill that costed me a lot",
"category":"c2fb359b-3840-4c71-b2e6-aa41e77d5b9f"
}
You have successfully added a new Expense!
-
400
: Bad request Empty body Any missing attribute -
404
: Not found Category not found. User not found. -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /expense/business/
Endpoint for a business user to get all expenses under their business.
Empty body.
200
: OK Expenses has been sent to the business user. Example Value:
{
}
[
{
"id": "de553647-b32e-4797-9c8d-98ab89fac878",
"title": "very huge bill",
"amount": 1002336,
"expenseDate": "2023-10-10T15:11:54.000Z",
"description": "a bill that represents everything I have bought in the USA part 2",
"picURL": "http://default",
"category": {
"id": "541ed414-f418-4a98-978b-4589e351d744",
"title": "huge",
"description": "huge",
"budget": 300,
"totalExpenses": 2004672
},
"userId": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
}
]
-
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
DELETE /expense/business/
Endpoint for a business user to delete a user's expense.
id: string => user's id.
id: string => expense ID
{ "userID": "54a2d3d8-7e3f-4883-aa45-185ca059f905" }
200
: OK You have successfully deleted the expense! Example Value:
{
"
}
You have successfully added a new Expense!
-
400
: Bad request Empty body Any missing attribute -
404
: Not found User not found. Expense not found -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /expense/business/search
Endpoint for a business user to delete a user's expense.
search minAmount maxAmount userID
200
: OK Sends filtered expenses accross all business. Example Value:
/expense/business/search?search=huge&userid=dd606543-9047-41cb-ab5b-a257069ce09c
[
{
"id": "dd606543-9047-41cb-ab5b-a257069ce09c",
"title": "very huge bill",
"amount": 1002336,
"expenseDate": "2023-10-10T15:11:54.000Z",
"description": "a bill that represents everything I have bought in the USA part 2",
"picURL": "http://default",
"category": {
"id": "541ed414-f418-4a98-978b-4589e351d744",
"title": "huge",
"description": "huge",
"budget": 300,
"totalExpenses": 2004672
},
"userId": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
}
]
-
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
POST /category/business
Endpoint for a business user to add a new category for a user in their business
useerID: string
Field | Type | Description | Required |
---|---|---|---|
title |
String | Category's title | Yes |
budget |
String | Category's lookup limit budget | Yes |
description |
String | Category's description | No |
200
: OK Category has been created and assigned to that user. Example Value:
{
"title" : "USA",
"description" : "my cat bro",
"budget": "100000"
}
You have successfully added a new category!
-
400
: Bad request Any empty attribute -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /category/business
Endpoint for a business user to get all categories in their business
Empty body.
200
: OK Sends business user all the categories. Example Value:
{
}
[
{
"id": "541ed414-f418-4a98-978b-4589e351d744",
"title": "huge",
"description": "huge",
"budget": 300,
"totalExpenses": 2004672,
"userId": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
},
{
"id": "6408f54b-144b-4f28-b4ec-314ea073e35c",
"title": "USA",
"description": "my cat bro",
"budget": 100000,
"totalExpenses": 0,
"userId": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
},
{
"id": "f6f91e39-0f95-45e6-9b45-a594baed7644",
"title": "Palestine",
"description": "love <3",
"budget": 100000,
"totalExpenses": 0,
"userId": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
}
]
-
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
DELETE /category/business/:id
Endpoint for a business user to delete a category for a user in their business.
id: string represents
category id (id): string
userID
200
: OK Category has been created and assigned to that user. Example Value:
{
"userid": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
}
You have successfully deleted the category with id: 6408f54b-144b-4f28-b4ec-314ea073e35c!
-
400
: Bad request Any missing attribute -
401
: Unauthorized User tried to access without being logged in. -
404
: Not found User not found Category not found -
500
: Internal Server Error
PUT /category/business
Endpoint for a business user to add a new category for a user in their business
category ID: string
Field | Type | Description | Required |
---|---|---|---|
title |
String | Category's title | Yes |
budget |
String | Category's lookup limit budget | Yes |
description |
String | Category's description | No |
userID |
String | Target User's id | Yes |
200
: OK Category has been modified. Example Value:
{
"title" : "Palestine",
"description" : "hi",
"budget": "10000220",
"userID": "54a2d3d8-7e3f-4883-aa45-185ca059f905"
}
You have successfully modified the category!
-
400
: Bad request Any empty attribute -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /expense/business/analytics/recommend-fire
Endpoint for a business user to get consultion of an AI model to fire somebody in the business, based on your business history.
Empty body.
200
: OK Response has been generated and sent to the user. Example Value:
{
}
Name of the User: z1ruisbhb
Reason for firing: The user "z1ruisbhb" should be fired because their income-expense difference is 0, indicating that
they are not generating any profit or contributing positively to the business. It is essential for the business to
maintain a positive income-expense difference to sustain and grow.
-
401
: Unauthorized User tried to access without being logged in. -
404
: Not found Business currently has 0 users (Business user excluded). -
500
: Internal Server Error
GET /expense/business/analytics/recommend-promote
Endpoint for a business user to get consultion of an AI model to promoite somebody in the business, based on their business history.
Empty body.
200
: OK Response has been generated and sent to the user. Example Value:
{
}
The user who should be given a promotion is v1rushb.
User v1rushb should be given a promotion because they have an income-expense difference of 15234. This indicates that they
have effectively managed their finances, ensuring that their income matches their expenses. Their ability to maintain a
balance between the money brought into the business and the money taken out demonstrates their proficiency in financial
management. Promoting them would not only recognize their skills but also motivate other employees to achieve similar
financial stability.
-
401
: Unauthorized User tried to access without being logged in. -
404
: Not found Business currently has 0 users (Business user excluded). -
500
: Internal Server Error
GET /expense/analytics/expenses-by-category
Endpoint for a user to get a graph that will contain all categories and for each category will be the amount for all expenses lies in that category and an AI consultion that will give some advices for the future.
Field | Type | Description | Required |
---|---|---|---|
startDate |
Date | beggining of time interval | Yes |
endDate |
Date | Ending of time interval | Yes |
200
: OK Response has been generated and sent to the user. Example Value:
{
}
Expense by Categroy:
huge | ================================================== 103500
Based on the given ASCII graph, it seems that the "huge" category has the highest expense with a value of 103,500. To
improve spending and increase profitability, it is essential to focus on this specific category. Analyzing the expenses
within the "huge" category and identifying areas where costs can be reduced or optimized would be a good starting point.
By carefully reviewing the expenditures associated with this category, you can identify potential cost-saving measures
and evaluate their impact on overall profitability. It may also be beneficial to explore opportunities for increasing
revenue or finding ways to generate additional income. Striving for efficiency in managing expenses while maximizing
revenue streams will help in achieving better financial results.
-
400
: Bad request Any missing attribute -
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
GET /expense/analytics/predict-me
Endpoint for a user to get a prediction from an AI model that analyze history and give a prediction for future spending.
Empty body.
200
: OK Response has been generated and sent to the user. Example Value:
{
}
Based on the provided data, it seems that you spent 34,500 units of currency on October 10, 2023, three times in a row.
If this is the complete dataset, there is not enough information to predict your future spending accurately or calculate
the spending velocity.
To make predictions and determine spending velocity, more historical data covering a range of dates and amounts would be
required. Additionally, factors such as income, expenses, and personal financial goals should be taken into account to
provide a comprehensive analysis of your spending behavior and evaluate whether it is considered good or not.
-
401
: Unauthorized User tried to access without being logged in. -
500
: Internal Server Error
We sincerely appreciate your interest and contributions to our project. If you encounter any issues or have suggestions for enhancements, we welcome you to open an issue or submit a pull request. We strive for collaborative improvement and value each contribution, big or small. Please ensure that any pull requests follow the project's guidelines, are well-documented, and pass all tests. Your efforts help us build something truly remarkable are really appreciated.