Skip to content

Mahim-Github/Fintrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FinTrack

Mini Expense Tracker with Intelligent Insights

πŸš€ Overview

FinTrack is a MERN stack Mini Expense Tracker application designed to help users manage their expenses efficiently while providing intelligent insights into their spending patterns. The app allows users to securely authenticate, add, update, delete, and analyze their expenses with dynamic visualizations.

πŸ› οΈ Tech Stack

  • Frontend: React.js (Vite) | ShadCN for UI components | Tailwind CSS for styling | Recharts for data visualization
  • Backend: Node.js | Express.js | MongoDB (Mongoose ORM)
  • Authentication: JWT-based authentication with HTTP-only cookies
  • Deployment: Vercel (Frontend) | Render (Backend)

🌟 Features

1️⃣ Authentication

  • Secure JWT authentication with HTTP-only cookies
  • User registration with First Name, Last Name, Email, Password
  • Login and Logout functionality
  • Token expiry handling with automatic session refresh
  • Middleware-based authentication to protect all routes

2️⃣ Expense Management (CRUD)

  • Users can add, update, delete, and view expenses
  • Each expense includes:
    • Amount (numeric, required)
    • Category (Food, Travel, Bills, etc.)
    • Date (required)
    • Description (optional)
  • Expenses are paginated and filterable by date range and category

3️⃣ Spending Insights & Analytics

  • Total spending per category
  • Percentage distribution of expenses across categories
  • Graphical representation using Recharts:
  • Category-wise expense breakdown (Bar Chart)
  • Most expensive category
  • Total expenses over time (Line Chart)
  • Expense growth rate over 7, 30, 90 days

4️⃣ Dynamic & Responsive Dashboard

  • Displays a list of all expenses
  • Each expense can be edited or deleted
  • Popup UI for each table row with Edit and Delete buttons for quick actions
  • Dark & Light mode support πŸŒ™βœ¨

🎯 Approach & Implementation

πŸ”Ή Frontend (React.js + ShadCN + TailwindCSS)

  • Component-based architecture with reusable UI elements
  • ShadCN for sleek UI elements (buttons, modals, tables, form inputs)
  • Recharts for interactive charts & insights
  • State management with React Hooks
  • Responsive design with Tailwind CSS

πŸ”Ή Backend (Node.js + Express.js + MongoDB)

  • RESTful API with Express.js
  • Mongoose ORM for MongoDB schema & queries
  • Authentication middleware (authMiddleware.js) to protect routes
  • JWT authentication using HTTP-only cookies
  • Optimized query performance for expense analytics

πŸ”Ή Database (MongoDB + Mongoose)

  • User Schema: Stores user details & hashed passwords
  • Expense Schema: Stores user expenses linked via userId
  • Indexes & query optimizations for faster data retrieval

πŸ”’ Security & Authentication

  • Secure token storage in HTTP-only cookies
  • Middleware-based access control
  • Bcrypt.js for password hashing
  • Environment variables for sensitive credentials

πŸš€ Deployment

  • Frontend: Deployed on Vercel for fast & scalable hosting
  • Backend: Deployed on Render with an always-on server
  • MongoDB: Hosted using MongoDB Atlas

πŸ“œ API Endpoints

πŸ”Ή Auth Routes

  • POST /api/auth/register β†’ Register a new user
  • POST /api/auth/login β†’ Authenticate user and set JWT in cookies
  • GET /api/auth/user β†’ Get authenticated user details
  • POST /api/auth/logout β†’ Logout and clear JWT

πŸ”Ή Expense Routes

  • POST /api/expenses β†’ Add new expense
  • GET /api/expenses β†’ Fetch all expenses (paginated & filterable)
  • GET /api/expenses/expense/:id β†’ Fetch a single expense (using the expense id)
  • PUT /api/expenses/:id β†’ Update an existing expense
  • DELETE /api/expenses/:id β†’ Delete an expense
  • GET /api/expenses/insights β†’ Fetch analytics (category-wise spending, total expense, growth rate)

βœ… Evaluation Criteria

πŸ”Ή Code Quality

  • Modular, clean, and well-structured React components & Express routes
  • Proper state management & efficient API handling
  • Reusable UI components for scalability

πŸ”Ή Problem-Solving & Performance Optimization

  • Efficient query handling for spending insights
  • Pagination & filtering for expenses to optimize data handling
  • Optimized authentication & authorization logic

πŸ”Ή Frontend & UI/UX

  • Interactive, smooth, and modern UI
  • Responsive design across devices
  • Smooth user experience with modal popups & transitions

πŸ”Ή Backend & API Design

  • RESTful API design with structured endpoints
  • Middleware-based security for protected routes
  • Efficient database schema & indexing for performance

πŸ“Œ Installation & Setup

πŸ”Ή Clone Repository

git clone https://github.com/yourusername/fintrack.git
cd fintrack

πŸ”Ή Backend Setup

cd backend
npm install
npm start

πŸ”Ή Frontend Setup

cd frontend
npm install
npm run dev

πŸ’‘ Future Improvements I will be looking into

βœ… Add income tracking to balance expenses πŸ’° βœ… Implement AI-based insights for smarter expense categorization 🧠 βœ… Allow exporting data to CSV or Excel πŸ“Š βœ… Enable multi-user support for family/group expenses 🏠


πŸ“ž Contact

πŸš€ Hope you like my project! Looking forward to the opportunity! πŸ˜ƒ

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •