A full-stack web application for tracking income and expenses with data visualization, user authentication, and Excel export functionality.
- User Authentication: Secure login and registration with JWT tokens
- Dashboard Overview: Visual representation of income and expense data
- Income Management: Add, view, and delete income entries
- Expense Management: Add, view, and delete expense entries
- Data Visualization: Interactive charts using Recharts library
- Excel Export: Download income and expense data as Excel files
- Image Upload: Support for uploading images with entries
- Responsive Design: Modern UI with Tailwind CSS
- React 19 - UI library
- Vite - Build tool and dev server
- React Router DOM - Client-side routing
- Tailwind CSS v4 - Styling
- Recharts - Data visualization
- Axios - HTTP client
- Moment.js - Date formatting
- React Hot Toast - Toast notifications
- React Icons - Icon library
- Emoji Picker React - Emoji selection
- Node.js - Runtime environment
- Express.js v5 - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- bcryptjs - Password hashing
- Multer - File upload handling
- XLSX - Excel file generation
- CORS - Cross-origin resource sharing
Expense-Tracker/
βββ backend/
β βββ config/ # Database configuration
β βββ models/ # Mongoose models
β βββ routes/ # API routes
β βββ uploads/ # Uploaded files
β βββ server.js # Entry point
β βββ package.json
βββ frontend/
β βββ expense-tracker/
β βββ src/
β β βββ pages/ # Page components
β β βββ components/ # Reusable components
β β βββ context/ # React Context
β β βββ utils/ # Helper functions
β β βββ App.jsx
β βββ package.json
βββ vercel.json
- Node.js (v14 or higher)
- MongoDB
- npm or yarn
-
Clone the repository
git clone https://github.com/Shanidhya01/Expense-Tracker.git cd Expense-Tracker -
Setup Backend
cd backend npm install -
Setup Frontend
cd frontend/expense-tracker npm install
Create a .env file in the backend directory:
PORT=5000
MONGO_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
CLIENT_URL=http://localhost:5173Create a .env file in the frontend/expense-tracker directory:
VITE_API_BASE_URL=http://localhost:5000-
Start Backend Server
cd backend npm run devBackend runs on
http://localhost:5000 -
Start Frontend Development Server
cd frontend/expense-tracker npm run devFrontend runs on
http://localhost:5173
POST /api/v1/auth/register- Register new userPOST /api/v1/auth/login- User loginGET /api/v1/auth/getUser- Get user info
GET /api/v1/dashboard- Get dashboard data
POST /api/v1/income/add- Add income entryGET /api/v1/income/get- Get all incomesDELETE /api/v1/income/:id- Delete incomeGET /api/v1/income/downloadexcel- Download income Excel
POST /api/v1/expense/add- Add expense entryGET /api/v1/expense/get- Get all expensesDELETE /api/v1/expense/:id- Delete expenseGET /api/v1/expense/downloadexcel- Download expense Excel
POST /api/v1/image/upload-image- Upload image
- Visual overview of total income and expenses
- Bar charts showing income over time
- Line charts showing expense trends
- Recent transactions list
- Add new income entries with source, amount, and date
- View all income records
- Delete individual entries
- Download income data as Excel
- Add new expense entries with category, amount, and date
- View all expense records
- Delete individual entries
- Download expense data as Excel
- Upload receipt images
- Modern card-based layout
- Custom styled buttons and inputs
- Interactive charts and graphs
- Toast notifications for user feedback
- Responsive sidebar navigation
- User registers with email and password
- Password is hashed using bcryptjs
- JWT token is generated upon login
- Token is stored in localStorage
- Protected routes verify token on each request
cd frontend/expense-tracker
npm run buildThe backend is ready for production deployment. Ensure environment variables are properly configured.
The project includes a vercel.json configuration for easy deployment to Vercel.
# Deploy backend
vercel --prod
# Deploy frontend
cd frontend/expense-tracker
vercel --prodContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Shanidhya01
- GitHub: @Shanidhya01
- React team for the amazing library
- Tailwind CSS for the utility-first CSS framework
- Recharts for beautiful data visualizations
Made with β€οΈ by Shanidhya01