Skip to content

NikithaDineshKumar/FinanceTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° Finance Tracker

A full-stack personal finance tracking application built with the MERN stack. Track your daily expenses, set monthly budgets, visualize spending patterns, get AI-powered financial insights, and chat with an AI budget advisor.

Finance Tracker License Status


πŸš€ Live Demo

🌐 Frontend: https://finance-tracker-gray-xi.vercel.app
πŸ”§ Backend API: https://financetracker-w0af.onrender.com

⚠️ The backend is hosted on Render's free tier and may take 30-50 seconds to wake up on the first request.


✨ Features

Core Features

  • πŸ” Secure Authentication β€” JWT-based login/signup with bcrypt password hashing
  • πŸ’Έ Expense Management β€” Add, edit, and delete daily expenses
  • πŸ“‚ Smart Categories β€” 16 predefined categories (Food, Transport, Grocery, etc.)
  • 🏷️ Needs vs Wants β€” Automatically tag every expense to track spending habits
  • πŸ“Š Visual Dashboard β€” Day-wise area charts and category pie charts
  • πŸ’° Budget Management β€” Set monthly budgets with health indicators
  • 🟒 Budget Health β€” Green/Yellow/Red indicator based on spending percentage
  • πŸ“… Expense History β€” View and analyze expenses from previous months
  • πŸ“„ PDF Report Export β€” Download monthly reports as beautifully formatted PDFs

AI Features

  • πŸ€– AI Expense Categorizer β€” Auto-categorize expenses using Google Gemini 2.5 Flash
  • πŸ”„ Rule-based Fallback β€” Smart keyword-based categorization when AI is unavailable
  • πŸ’¬ RAG Budget Advisor Chatbot β€” Chat with an AI advisor about your spending habits
  • πŸ“ˆ Smart Spending Insights β€” AI-generated personalized financial insights

Security Features

  • πŸ”’ JWT Authentication with 30-day expiry
  • πŸ”‘ bcrypt password hashing (salt rounds: 10)
  • πŸ›‘οΈ Protected API routes with middleware
  • πŸ” Environment variables for all secrets

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
React.js UI Framework
React Router DOM Client-side routing
Recharts Data visualization
Axios HTTP requests
jsPDF + jspdf-autotable PDF report generation
React Toastify Notifications
React Icons Icon library
CSS3 Custom responsive styling

Backend

Technology Purpose
Node.js Runtime environment
Express.js Web framework
MongoDB Atlas Cloud NoSQL database
Mongoose MongoDB ODM
JWT Authentication
bcryptjs Password hashing
CORS Cross-origin requests
dotenv Environment variables

AI

Technology Purpose
Google Gemini API LLM inference
Gemini 2.5 Flash Expense categorization, insights, chatbot
Rule-based NLP Fallback categorization

Deployment

Service Purpose
Vercel Frontend hosting
Render Backend hosting
MongoDB Atlas Cloud database

πŸ“ Project Structure

FinanceTracker/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”œβ”€β”€ Expense.js
β”‚   β”‚   └── Budget.js
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚   β”‚   β”œβ”€β”€ expenses.js
β”‚   β”‚   β”œβ”€β”€ budget.js
β”‚   β”‚   β”œβ”€β”€ ai.js
β”‚   β”‚   β”œβ”€β”€ insights.js
β”‚   β”‚   └── chatbot.js
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ aiCategorizer.js
β”‚   β”‚   β”œβ”€β”€ insightsService.js
β”‚   β”‚   └── chatbotService.js
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ package-lock.json
β”‚   └── server.js
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”‚   └── manifest.json
β”‚   β”‚
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Auth/
β”‚   β”‚   β”‚   β”‚   └── PrivateRoute.js
β”‚   β”‚   β”‚   └── Navbar.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── AuthContext.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Expenses.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Budget.js
β”‚   β”‚   β”‚   └── History.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”‚   └── pdfReport.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ App.js
β”‚   β”‚   β”œβ”€β”€ App.css
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   └── index.css
β”‚   β”‚
β”‚   β”œβ”€β”€ package.json
β”‚   └── package-lock.json
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

βš™οΈ Installation & Setup

Prerequisites

  • Node.js v18+
  • MongoDB (local) or MongoDB Atlas account
  • Google Gemini API key

1. Clone the repository

git clone https://github.com/NikithaDineshKumar/FinanceTracker.git
cd FinanceTracker

2. Backend Setup

cd backend
npm install

Create a .env file in the backend folder:

PORT=5000
MONGO_URI=mongodb://localhost:27017/financetracker
JWT_SECRET=your_jwt_secret_key
NODE_ENV=development
GEMINI_API_KEY=your_gemini_api_key

Start the backend server:

npm run dev

3. Frontend Setup

Open a new terminal:

cd frontend
npm install
npm start

4. Open the app

Go to http://localhost:3000


πŸ”Œ API Endpoints

Auth Routes

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login user

Expense Routes (Protected)

Method Endpoint Description
GET /api/expenses Get all expenses
POST /api/expenses Add new expense
PUT /api/expenses/:id Update expense
DELETE /api/expenses/:id Delete expense
GET /api/expenses/summary Get monthly summary

Budget Routes (Protected)

Method Endpoint Description
GET /api/budget Get monthly budget
POST /api/budget Set/update budget
GET /api/budget/all Get all budgets

AI Routes (Protected)

Method Endpoint Description
POST /api/ai/categorize AI expense categorization
GET /api/insights Get AI spending insights
POST /api/chatbot Chat with budget advisor

πŸ“Š Expense Categories

Needs: Food β€’ Grocery β€’ Vegetables β€’ Medicine β€’ Hospital β€’ Milk β€’ Current β€’ Tuition

Wants: Shopping β€’ Transport β€’ Cosmetics β€’ Dress β€’ Service β€’ Maid β€’ Stationary β€’ Other


πŸ” Environment Variables

Variable Description
PORT Server port (default: 5000)
MONGO_URI MongoDB connection string
JWT_SECRET Secret key for JWT tokens
NODE_ENV Environment (development/production)
GEMINI_API_KEY Google Gemini API key

πŸ—ΊοΈ Roadmap

  • User authentication (JWT)
  • Expense CRUD operations
  • Budget management
  • Visual charts and dashboard
  • Monthly history
  • Responsive design with hamburger menu
  • AI expense categorizer (Google Gemini 2.5 Flash)
  • Rule-based fallback categorizer
  • Smart spending insights
  • RAG budget advisor chatbot
  • PDF report export
  • Deploy to Vercel + Render + MongoDB Atlas

🀝 Contributing

This is a personal project but feel free to fork and build on it!


πŸ“„ License

This project is licensed under the MIT License.


πŸ‘©β€πŸ’» Author

Nikitha Dinesh Kumar


⭐ If you found this project helpful, please give it a star!

Releases

No releases published

Packages

 
 
 

Contributors