Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° Expense Tracker

A full-stack Expense Tracker built with the MERN Stack that helps users manage their personal finances through an intuitive dashboard, secure authentication, transaction management, and insightful visualizations.


✨ Features

πŸ” Authentication

  • User Registration
  • User Login
  • JWT Authentication
  • Protected Routes
  • Public Routes
  • Refresh Token Authentication
  • Forgot Password via Email
  • Password Reset using Secure Reset Link
  • Logout

πŸ“Š Dashboard

  • Total Balance
  • Total Income
  • Total Expenses
  • Total Transactions
  • Monthly Income Comparison
  • Monthly Expense Comparison
  • Monthly Balance Comparison
  • Monthly Transaction Comparison
  • Interactive Charts & Analytics

πŸ’³ Transaction Management

  • Add Transaction
  • Edit Transaction
  • Delete Transaction
  • Search Transactions
  • View Recent Transactions
  • Dedicated Transaction History Page

πŸ“‚ Categories

Expense Categories

  • Food
  • Transport
  • Entertainment
  • Shopping
  • Rent
  • Bills & Utilities
  • Healthcare
  • Education
  • Travel
  • Technology
  • Gifts
  • Other

Income Categories

  • Salary
  • Freelance
  • Investments
  • Bonus
  • Refund
  • Gifts
  • Other

🎨 UI Features

  • Dark Mode
  • Toast Notifications
  • Responsive Dashboard
  • Modern UI
  • Sidebar Navigation
  • Avatar Dropdown
  • Authentication Pages
  • Charts & Analytics

πŸ›  Tech Stack

Frontend

  • React
  • React Router DOM
  • Tailwind CSS
  • Axios
  • React Hot Toast
  • Lucide React
  • Recharts

Backend

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT
  • bcrypt
  • Nodemailer

πŸ“ Project Structure

Expense-Tracker
β”‚
β”œβ”€β”€ backend
β”‚   β”œβ”€β”€ src
β”‚   β”‚   β”œβ”€β”€ config
β”‚   β”‚   β”‚   β”œβ”€β”€ db.js
β”‚   β”‚   β”‚   β”œβ”€β”€ generateToken.js
β”‚   β”‚   β”‚   └── mail.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   └── TransactionController.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ middleware
β”‚   β”‚   β”‚   └── protect.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ models
β”‚   β”‚   β”‚   β”œβ”€β”€ Transaction.js
β”‚   β”‚   β”‚   └── User.js
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ routes
β”‚   β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”‚   └── transactionRoutes.js
β”‚   β”‚   β”‚
β”‚   β”‚   └── index.js
β”‚   β”‚
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ package.json
β”‚   └── package-lock.json
β”‚
β”œβ”€β”€ frontend
β”‚   β”œβ”€β”€ public
β”‚   β”‚
β”‚   β”œβ”€β”€ src
β”‚   β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”‚   β”œβ”€β”€ charts
β”‚   β”‚   β”‚   β”‚   └── Charts.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AddTransactionModal.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Avatar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PublicRoute.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ StatCard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Summary.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TransactionRow.jsx
β”‚   β”‚   β”‚   └── TransactionTable.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ pages
β”‚   β”‚   β”‚   β”œβ”€β”€ DashBoard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ForgotPassword.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ResetPassword.jsx
β”‚   β”‚   β”‚   └── TransactionPage.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ main.jsx
β”‚   β”‚   └── index.css
β”‚   β”‚
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ package.json
β”‚   └── package-lock.json
β”‚
└── README.md

πŸ“‹ Prerequisites

Before running the project, make sure you have installed:

  • Node.js (v18 or above)
  • npm
  • MongoDB Atlas (or a local MongoDB instance)
  • Git
  • A Gmail account with an App Password (for password reset emails)

βš™οΈ Installation & Setup

1. Clone the Repository

git clone https://github.com/Asmit-06/Expense-Tracker.git
cd Expense-Tracker

2. Install Dependencies

Backend

cd backend
npm install

Frontend

cd ../frontend
npm install

3. Configure Environment Variables

Backend (.env)

PORT=3000

MONGO_URI=your_mongodb_connection_string

JWT_SECRET=your_jwt_secret
JWT_REFRESH_SECRET=your_refresh_secret
JWT_RESET_SECRET=your_reset_secret

EMAIL=your_email@gmail.com
EMAIL_PASSWORD=your_google_app_password

CLIENT_URL=http://localhost:5173

Frontend (.env)

VITE_API_URL=http://localhost:3000

4. Start the Backend Server

cd backend
npm run dev

Server runs at:

http://localhost:3000

5. Start the Frontend

Open another terminal.

cd frontend
npm run dev

Application runs at:

http://localhost:5173

6. Open the Application

Visit

http://localhost:5173

Register a new account and start tracking your expenses.


πŸš€ Usage

  • Register a new account
  • Login securely
  • Add income and expense transactions
  • Categorize transactions
  • Search transactions
  • Edit or delete transactions
  • Track monthly financial summaries
  • Visualize spending using charts
  • Toggle between Dark and Light mode
  • Reset forgotten password via email

πŸ”’ Authentication Flow

  • Register User
  • Login
  • Generate Access Token
  • Generate Refresh Token
  • Protected API Routes
  • Automatic Token Refresh
  • Forgot Password Email
  • Secure Password Reset
  • Logout

πŸ“Œ Future Improvements

  • Budget Planning
  • Expense Breakdown by Category
  • Export Reports (CSV/PDF)
  • Email Notifications
  • User Profile Management
  • Multi-Currency Support
  • Recurring Transactions
  • Mobile Responsive Improvements

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

Developed as a Full Stack MERN project to strengthen frontend, backend, authentication, and API development skills.

Releases

Packages

Contributors

Languages