Welcome to the FinTrack API documentation. This guide provides detailed information on how to interact with the FinTrack API, which allows you to manage users, categories, transactions, budgets, and analytics.
To get started with FinTrack, follow these steps:
-
Clone the repository:
git clone https://github.com/ripionck/fin-track-api.git cd fin-track-api -
Install dependencies:
yarn install
-
Set up environment variables:
- Create a
.envfile in theserverdirectory and add the following variables:MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key PORT=5000
- Create a
Thank you for using FinTrack! We hope it helps you manage your finances more effectively.
Register a new user.
Endpoint: POST http://localhost:5000/api/users/register
Body:
{
"firstName": "Test",
"lastName": "User",
"email": "[email protected]",
"password": "password123"
}Login an existing user.
Endpoint: POST http://localhost:5000/api/users/login/
Body:
{
"email": "[email protected]",
"password": "Password123"
}Retrieve the profile of the logged-in user.
Endpoint: GET http://localhost:5000/api/users/me
Authorization: Bearer Token
Token: <token>
Create a new category.
Endpoint: POST http://localhost:5000/api/categories/
Authorization: Bearer Token
Token: <token>
Body:
{
"name": "Drink",
"icon": "๐ธ",
"color": "#00FF00"
}Retrieve all categories.
Endpoint: GET http://localhost:5000/api/categories/
Authorization: Bearer Token
Token: <token>
Update an existing category.
Endpoint: PUT http://localhost:5000/api/categories/67b1dc5450c9bf327c120d25
Authorization: Bearer Token
Token: <token>
Body:
{
"name": "Chinese Food",
"icon": "๐",
"color": "#00FF00"
}Delete a category.
Endpoint: DELETE http://localhost:5000/api/categories/67b1dc5450c9bf327c120d25
Authorization: Bearer Token
Token: <token>
Create a new transaction.
Endpoint: POST http://localhost:5000/api/transactions/
Authorization: Bearer Token
Token: <token>
Body:
{
"date": "2025-02-05",
"description": "Monthly Salary",
"category": "Income",
"type": "Income",
"amount": 12000
}Retrieve all transactions.
Endpoint: GET http://localhost:5000/api/transactions/
Authorization: Bearer Token
Token: <token>
Update an existing transaction.
Endpoint: PUT http://localhost:5000/api/transactions/67b1e06450c9bf327c120d3c
Authorization: Bearer Token
Token: <token>
Body:
{
"date": "2024-08-01",
"description": "Shipping",
"amount": 2000,
"categoryId": "67b1dfd150c9bf327c120d36",
"type": "expense"
}Delete a transaction.
Endpoint: DELETE http://localhost:5000/api/transactions/67b1e06450c9bf327c120d3c
Authorization: Bearer Token
Token: <token>
Create a new budget.
Endpoint: POST http://localhost:5000/api/budgets/
Authorization: Bearer Token
Token: <token>
Body:
{
"category": "Food",
"limit": 500
}Retrieve all budgets.
Endpoint: GET http://localhost:5000/api/budgets/
Authorization: Bearer Token
Token: <token>
Update an existing budget.
Endpoint: PUT http://localhost:5000/api/budgets/67b1e7f22d15c963d33f4f01
Authorization: Bearer Token
Token: <token>
Body:
{
"categoryId": "67b1dbb650c9bf327c120d21",
"limit": 5000,
"startDate": "2024-08-01",
"endDate": "2024-08-31"
}Retrieve analytics for the last 30 days.
Endpoint: GET http://localhost:5000/api/analytics/30days
Authorization: Bearer Token
Token: <token>
Retrieve analytics for the last 90 days.
Endpoint: GET http://localhost:5000/api/analytics/90days
Authorization: Bearer Token
Token: <token>
Retrieve analytics for the current year.
Endpoint: GET http://localhost:5000/api/analytics/current-year
Authorization: Bearer Token
Token: <token>
Test endpoint.
Endpoint: GET http://localhost:5000/api/test
For any issues or further assistance, please contact the support team.