Skip to content

FinTracker is a personal finance tool with a C++ engine and Node.js backend, letting users log income and expenses, set budgets, analyze spending, and catch unusual transactions using Python-based detection. Simple UI, secure accounts, and clear insights for smarter money management. Provides category tracking, alerts, and clear summaries.

Notifications You must be signed in to change notification settings

Luv-valecha/FinTracker

Repository files navigation

Finance Tracker

A full-stack personal finance management application combining a C++ backend with a Node.js/Express web interface using RESTful APIs. Track expenses, manage budgets, get personalized spending recommendations, and with anomaly detection to flag unusual transactions.

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6

Navigation

Features

Core Features

  • User registration and authentication
  • Add and track transactions
  • Set budgets by category
  • View spending analytics
  • Get personalized recommendations
  • Category-wise expense breakdown
  • Anomaly Detection: Detects unusual spending patterns and alerts the user for confirmation before adding suspicious transactions with an achieved accuracy of 94.63% .

Available Categories

  • Food
  • Shopping
  • Entertainment
  • Personal
  • Health
  • Travel
  • Rent
  • Income
  • Miscellaneous

Tech Stack

Backend

  • C++ core engine
  • File-based data persistence
  • Custom data structures (doubly linked lists)
  • Priority queue for recommendations
  • Node.js
  • Express.js
  • JWT (JSON Web Tokens) for user authentication and authorization
  • Python Backend for Anomaly Detection:
    • Isolation Forest Model
    • Flask API for anomaly detection

Frontend

  • HTML/CSS
  • Javascript
  • REST APIs

Installation

  1. Clone the repository
git clone https://github.com/Luv-valecha/Finance_Tracker.git
cd Finance_Tracker
  1. Install Node.js dependencies
npm install
  1. Compile C++ backend
cd .\backend\
g++ -o finance_tracker main.cpp Login_system.cpp Transactions.cpp post_data.cpp get_data.cpp BudgetNRecommender.cpp Statistics.cpp
  1. Set up the Anomaly Detection Python server:
  • Navigate to the "Anomaly_Detection_Model" folder:
cd ./backend/Anomaly_Detection_Model
  • Install required Python dependencies (ensure Python 3.x is installed):
Install required Python dependencies (ensure Python 3.x is installed):
  • Run the Python server:
python anomaly_detector.py

This will start a Flask server that listens for anomaly detection requests.

  1. Create environment file
# .env
PORT=3000
  1. Start the Node.js server
cd .\frontend\
node server.js

API Endpoints

Authentication

POST /api/register - Register new user
POST /api/login - Login user (JWT generated on success)
GET /api/logout - Logout user (invalidate JWT on client-side)

Transactions

POST /api/add-transaction - Add new transaction
GET /api/transactions - Get all transactions
GET /api/cattransactions - Get transactions by category
GET /api/daterangetransactions - Get transactions by date range
POST /api/detect-anomaly - Detect anomalies in a new transaction

Budget & Analytics

POST /api/setbudget - Set category budgets
GET /api/categorywisespend - Get spending breakdown
GET /api/getrecommendation - Get spending recommendations

Project Structure

├── backend/
│   ├── main.cpp
│   ├── Login_system.cpp/h  
│   ├── Transactions.cpp/h
│   ├── Transhist.h
│   ├── post_data.cpp
│   ├── get_data.cpp
│   ├── BudgetNRecommender.cpp
│   ├── Statistics.cpp
│   └── Anomaly_Detection_Model/
│       ├── anomaly_detector.py
│       ├── requirements.txt
│       ├── encoder.pkl
│       ├── scaler.pkl
│       └── anomaly_detection_model.pkl
├── frontend/
│   ├── public/
│   │   ├── index.html
│   │   ├── register.html 
│   │   ├── dashboard.html
│   │   ├── css/
│   │   │   ├──images/
│   │   │   └──style.css
│   │   └──js/
│   │   │   ├──app.js
│   │   │   └──utils.js
│   ├── routes/
│   │   └── api.js
│   └── server.js
├── package.json
└── README.md

Usage

  1. Register a new account at /register

  2. Login at /login

    • JWT token will be returned upon successful login. Store it securely (e.g., in a cookie or localStorage)
  3. Add transactions:

    • Enter date
    • Enter amount
    • Select category
    • Add description
  4. View transactions:

    • See all transactions
    • Filter by category
    • Filter by type
    • Filter by date range
  5. Manage budget:

    • Set category budgets
    • Track spending vs budget
    • View recommendations
  6. Anomaly Detection:

    • When a user adds a new transaction, the system sends the transaction data to the Python backend.
    • The Python server uses an Isolation Forest model, trained on the user’s past transactions, to detect anomalies in the new transaction.
    • If an anomaly is detected, the user is alerted to confirm the transaction details.
    • The transaction is either confirmed and added to the system or rejected based on the user's input.
    • Achieved an accuracy of 94.63%
    • Note: To use the anomaly detection feature, ensure the Python server is running separately.

Prerequisites

  • Node.js
  • C++ compiler
  • npm
  • Python 3.x
  • Required Python dependencies (pip install -r requirements.txt)

Security

  • Password hashing
  • JWT authentication (using tokens for secure user authentication and session management)
  • Input validation
  • Secure file operations

Contributing

  1. Fork the repo
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Open pull request

Support

For issues or questions, please open an issue in the repository.

About

FinTracker is a personal finance tool with a C++ engine and Node.js backend, letting users log income and expenses, set budgets, analyze spending, and catch unusual transactions using Python-based detection. Simple UI, secure accounts, and clear insights for smarter money management. Provides category tracking, alerts, and clear summaries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published