A secure and feature-rich RESTful API designed for personal finance management. Built for real-world use, it allows users to track transactions, set budgets, monitor savings goals, and generate detailed financial reports — all with multi-currency support and role-based access.
This API was developed as a comprehensive financial management solution as part of the AF Assignment 01 project. Built with security, scalability, and user experience in mind, the system offers a full suite of features to help users take control of their finances. It supports:
- User Roles & Authentication: Secure registration, login, and role‑based access control using JWT.
- Expense & Income Tracking: CRUD operations for transactions (including recurring transactions and custom tagging).
- Budget Management: Set budgets (general or category‑specific) with notifications when spending nears or exceeds limits; also provides adjustment recommendations.
- Financial Reports: Generate reports for spending trends over custom date ranges; supports filtering by category and tags and includes multi‑currency conversion.
- Notifications & Alerts: Sends alerts for budget warnings, recurring transactions, and goal milestones.
- Goals & Savings Tracking: Users can set savings goals and benefit from automatic allocation of a percentage (or fixed amount) of income toward their goals.
- Multi‑Currency Support: Transactions are converted to a base currency (USD) and reported in the user’s preferred currency.
- Role‑Based Dashboards: Separate dashboards provide an admin overview of system activity and personalized user dashboards showing recent transactions, budgets, and goals.
- Backend: Node.js, Express.js
- Database: MongoDB (Atlas)
- Authentication: JSON Web Tokens (JWT)
- Security: express‑mongo‑sanitize, express‑rate‑limit, express‑validator
- Documentation: Postman collection
- Testing: Jest, Supertest
git clone https://github.com/R-Tharanka/Finance-Tracker-API.git
cd Finance-Tracker-APInpm installCreate a .env file in the root directory and add:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_keynpm run devThe API will be running at http://localhost:5000/.
npm testThe API is documented via a Postman collection included in the repository. (See Finance Tracker System API.postman_collection.json).
├── app.js # Express application setup
├── Finance Tracker System API.postman_collection.json # API documentation
├── package.json # Project dependencies and scripts
├── server.js # Server initialization and scheduled tasks
├── config/ # Configuration files
│ └── logger.js # Logging configuration
├── controllers/ # Route controllers
│ ├── adminController.js # Admin functionality
│ ├── authController.js # Authentication
│ ├── budgetController.js # Budget management
│ ├── categoryController.js # Categories
│ ├── dashboardController.js # Dashboard data
│ ├── financialReportsController.js # Financial reports
│ ├── goalController.js # Savings goals
│ ├── notificationController.js # User notifications
│ ├── savingsController.js # Savings management
│ ├── spendingLimitController.js # Spending limits
│ ├── transactionController.js # Transactions
│ └── userController.js # User management
├── middlewares/ # Custom middleware
│ └── authMiddleware.js # Authentication middleware
├── models/ # MongoDB models
│ ├── AdminLog.js # Admin activity logging
│ ├── Budget.js # Budget data
│ ├── Category.js # Transaction categories
│ ├── Goal.js # Savings goals
│ ├── Notification.js # User notifications
│ ├── SpendingLimit.js # Spending limits
│ ├── Transaction.js # Financial transactions
│ └── User.js # User accounts
├── routes/ # API routes
│ ├── adminRoutes.js # Admin endpoints
│ ├── authRoutes.js # Authentication endpoints
│ ├── budgetRoutes.js # Budget endpoints
│ ├── categoryRoutes.js # Category endpoints
│ ├── dashboardRoutes.js # Dashboard endpoints
│ ├── financialReports.js # Reports endpoints
│ ├── goalRoutes.js # Goals endpoints
│ ├── notificationRoutes.js # Notification endpoints
│ ├── spendingLimitRoutes.js # Spending limit endpoints
│ ├── transactionRoutes.js # Transaction endpoints
│ └── userRoutes.js # User management endpoints
├── tests/ # Test suites
│ ├── auth.test.js # Authentication tests
│ ├── budgets.test.js # Budget tests
│ ├── dashboard.test.js # Dashboard tests
│ ├── transactions.test.js # Transaction tests
│ └── users.test.js # User tests
└── utils/ # Utility functions
└── currencyConverter.js # Currency conversion utility
- Auth:
/api/auth- User registration and login - Transactions:
/api/transactions- Manage income and expenses - Budgets:
/api/budgets- Budget management - Categories:
/api/categories- Transaction categories - Goals:
/api/goals- Savings goals - Reports:
/api/reports- Financial reports - Dashboard:
/api/dashboard- User and admin dashboards - Notifications:
/api/notifications- User alerts - Users:
/api/users- User management - Admin:
/api/admin- Admin-specific endpoints
This project was developed based on the AF Assignment for the BSc (Hons) in Information Technology at SLIIT.