<<<<<<< HEAD
A full-stack personal finance management application for tracking expenses, managing budgets, setting savings goals, and monitoring SIP (Systematic Investment Plan) investments.
- User Authentication: Secure registration, login, and JWT-based session management.
- Expense Tracking: Add, edit, delete, and categorize expenses with advanced filtering and analytics.
- Budget Management: Set monthly and category-wise budgets, monitor spending, and receive alerts.
- SIP Management: Create, track, and analyze SIP investments with projections and reminders.
- Goal Setting: Define savings goals, estimate completion dates, and monitor progress.
- Analytics Dashboard: Visualize spending patterns, investment growth, and financial health with interactive charts.
- Automated Reminders: Email notifications for SIP payments, overdue actions, and monthly summaries.
- Responsive UI: Modern, mobile-friendly React frontend with custom theming and animations.
- Admin Dashboard: (Optional) Overview of users, investments, and payments for administrators.
- Frontend: React, Vite, Chart.js, Framer Motion, Styled Components, Tailwind CSS
- Backend: Node.js, Express.js, MongoDB (Mongoose), JWT, Nodemailer, node-cron
- APIs: RESTful endpoints for all resources (expenses, budgets, SIPs, goals, payments)
- Other: React Query, Axios, React Router, Hot Toast notifications
Expense tracker/
βββ Backend/ # Node.js/Express/MongoDB API
βββ Frontend/ # React/Vite/Tailwind UI
βββ README.md
- Clone the repository.
- Set up environment variables for both frontend and backend (see respective README files).
- Install dependencies and start both servers:
- Backend:
cd Backend && npm install && npm run dev - Frontend:
cd Frontend && npm install && npm run dev
- Backend:
- Access the app at http://localhost:5173.
- Add, edit, and analyze expenses.
- Set and monitor budgets and savings goals.
- Manage SIP investments with projections and reminders.
- Visualize your financial health with interactive dashboards.
Expense Tracker (Full-Stack Personal Finance Platform)
React, Node.js, Express, MongoDB, Chart.js, Tailwind CSS
- Designed and developed a comprehensive personal finance management system enabling users to track expenses, set budgets, manage SIP investments, and achieve savings goals.
- Implemented secure authentication, RESTful APIs, and automated email reminders for SIP payments and overdue actions.
- Built a modern, responsive dashboard with advanced analytics and interactive data visualizations using React, Chart.js, and Framer Motion.
- Integrated recurring expense automation, goal estimation, and real-time notifications to enhance user engagement and financial awareness.
- Ensured robust backend architecture with Node.js, Express, MongoDB, and JWT-based security.
=======
A comprehensive RESTful API backend for managing personal expenses, payments, SIPs, and budgets.
- Clone the repository
- Install dependencies:
cd Backend
npm install- Create a
.envfile with the following variables:
PORT=8000
MONGODB_URI=your_mongodb_connection_string
ACCESS_TOKEN_SECRET=your_access_token_secret
REFRESH_TOKEN_SECRET=your_refresh_token_secret
ACCESS_TOKEN_EXPIRY=1d
REFRESH_TOKEN_EXPIRY=10d- Start the server:
npm run devBackend/
βββ src/
β βββ controllers/
β β βββ users.controllers.js
β β βββ expense.controllers.js
β β βββ Payment.controller.js
β β βββ SIP.controller.js
β β βββ budget.controller.js
β β βββ adminController.js
β βββ models/
β β βββ Users.models.js
β β βββ Expense.models.js
β β βββ Payment.models.js
β β βββ SIP.models.js
β β βββ Budget.models.js
β βββ routes/
β β βββ user.routes.js
β β βββ expense.routes.js
β β βββ payment.routes.js
β β βββ sip.routes.js
β β βββ budget.routes.js
β β βββ admin.routes.js
β βββ middleware/
β β βββ auth.middleware.js
β βββ cronJobs/
β β βββ cronJobs.js
β βββ db/
β β βββ index.js
β βββ app.js
β βββ server.js
βββ package.json
βββ README.md
POST /api/users/register- Register new userPOST /api/users/login- Login userPOST /api/users/logout- Logout userPOST /api/users/refresh-token- Refresh access tokenPUT /api/users/profile- Update user profileDELETE /api/users/delete- Delete user accountPOST /api/users/change-password- Change passwordGET /api/users/get-currentUser- Get current user details
GET /api/expenses- Get all expensesPOST /api/expenses- Create new expenseGET /api/expenses/summary- Get expense summaryPUT /api/expenses/:id- Update expenseDELETE /api/expenses/:id- Delete expenseGET /api/expenses/chart/category-summary- Get category-wise summaryGET /api/expenses/chart/weekly-summary- Get last 7 days summaryGET /api/expenses/chart/monthly-summary- Get last 6 months summary
POST /api/payments- Create paymentGET /api/payments- Get all paymentsGET /api/payments/:id- Get payment by IDPUT /api/payments/:id- Update paymentDELETE /api/payments/:id- Delete payment
POST /api/sips- Create new SIPGET /api/sips- Get all SIPsGET /api/sips/active- Get active SIPsGET /api/sips/chart- Get SIP chart dataGET /api/sips/:id- Get SIP by IDPUT /api/sips/:id- Update SIPDELETE /api/sips/:id- Delete SIPGET /api/sips/:id/projection- Get SIP projection
POST /api/budgets- Set/update budgetGET /api/budgets- Get budgetGET /api/budgets/status- Get budget statusPOST /api/budgets/overall- Set/update overall budgetGET /api/budgets/overall- Get overall budget
GET /api/admin/dashboard- Get admin dashboard data
The API uses JWT (JSON Web Tokens) for authentication:
- Access Token: Short-lived token for API access
- Refresh Token: Long-lived token for generating new access tokens
Include the token in the Authorization header:
Authorization: Bearer <your_token>
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (jsonwebtoken)
- Password Hashing: bcrypt
- Environment Variables: dotenv
- Task Scheduling: node-cron
- User authentication with JWT
- Expense tracking with categories
- Payment management
- SIP investments tracking
- Budget management
- Admin dashboard
- Automated recurring expenses
- Data visualization endpoints
- Password hashing and security
- Input validation and sanitization
Success Response:
{
"success": true,
"data": {},
"message": "Operation successful"
}Error Response:
{
"success": false,
"error": "Error message"
}The API implements centralized error handling with appropriate HTTP status codes:
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 500: Internal Server Error
- Postman or Insomnia REST client
- Running backend server
- MongoDB connection
- Import the API collection from
tests/api-collection.json - Create an environment in your REST client with these variables:
baseUrl: http://localhost:8000accessToken: (will be set after login)sipId: (will be set after creating a SIP)
- Register a new user
- Login to get access token
- Set the access token in your environment
- Test other endpoints using the authenticated requests
- Authentication flow
- Expense CRUD operations
- SIP management
- Budget settings
- Payment processing
POST /api/auth/register
POST /api/auth/login
POST /api/auth/logout
POST /api/auth/refresh-tokenPOST /api/expenses
GET /api/expenses
GET /api/expenses/:id
PUT /api/expenses/:id
DELETE /api/expenses/:id
GET /api/expenses/summaryPOST /api/sips
GET /api/sips
GET /api/sips/:id
PUT /api/sips/:id
DELETE /api/sips/:idPOST /api/budgets
GET /api/budgets
POST /api/budgets/overall
GET /api/budgets/statusPOST /api/payments
GET /api/payments
GET /api/payments/:id
PUT /api/payments/:id
DELETE /api/payments/:id5a8059637b9f7ddb5e58e0f440aa824211d54199