FinanazAPI is built with TypeScript, Express, and Prisma, following Clean Architecture principles. It allows users to manage budgets and expenses efficiently.
TODO: Add build instructions to start the project, prerequisites, etc.
To run the application using Docker, use the following commands:
sudo docker-compose up --build
To access the running container, use:
docker exec -it finanzapp /bin/sh
After making changes to the database schema, don't forget to run:
npx prisma generate || npx prisma migrate dev
First you need to create an user, to do so you need to create at least one role at the Roles
table.
Then execute the next curl
curl -X 'POST' \
'http://localhost:3000/api/v1/users' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"username": "testUser",
"password": "securePassword.1$",
"email": "tes1t@test.com",
"roles": [
1
]
}'
The endpoint will return the user.id
that you will need to use in the following endpoints.
{
"status": "success",
"data": "2487b372-7c48-43f2-8ab7-bd0ae8ac79ae"
}
To start calculating the Monthly Budget and utilize your Monthly Wages, you must first create a Budget Configuration. This configuration will be assigned to the Monthly Wage and should have a name (e.g., "Basic") along with a user_id.
The Budget Configuration will have several associated Budgets. Each Budget must include a name and a percentage. The total sum of all Budgets' percentages must equal 100%.
curl -X 'POST' \
'http://localhost:3000/api/v1/budget-configurations' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"user_id": "c270dfc2-ac37-46b1-83ad-c3450d15425e",
"budget_configuration_name": "Test",
"budgets": [
{
"name": "Savings",
"percentage": 40
},
{
"name": "Food",
"percentage": 60
}
]
}'
The API is documented using Swagger. You can access it at http://localhost:3000/api-docs.
- Budgets and Budget Configurations.
- Monthly Wages and auto calculation of Budgets per month.
- Creation of Categories that will be used when adding expenses.
- Expenses, discounting allocation from budgets when adding new expenses.
- Transfer remaining allocation to another Budget to use in the incoming month if desired.
- Credit Cards and trailing installments per card.
- Pending debts and due dates to fullfill those debts.
- Investments with Sell/Buy price per date.
- Authentication and Authorization.
- Add groups to split/track expenses together with friend/partner/roomie
We welcome contributions to FinanazAPI! Your help is essential to improving the project and making it better for everyone.
- Fork the Repository: Click on the fork button at the top right of the repository page.
- Create a Branch: Use
git checkout -b feature/YourFeature
to create a new branch. - Make Changes: Make your changes in your branch.
- Write Tests: Ensure that you write tests for your new functionality.
- Commit Changes: Use clear and descriptive commit messages.
- Submit a Pull Request: Push your changes and submit a pull request to the main repository, detailing the changes you've made.
If you find a bug or have a feature request, please open an issue in the repository.
Feel free to submit suggestions for new features or improvements.