A full-stack expense tracking application built with React, Node.js, Express, and MySQL. Track your expenses, set budgets, analyze spending patterns, and manage your finances effectively.
- Features
- Screenshots
- Tech Stack
- Getting Started
- Installation
- Environment Variables
- Database Setup
- Running the Application
- API Documentation
- Project Structure
- Contributing
- License
- π User Authentication - Secure signup/login with JWT tokens
- π³ Expense & Income Tracking - Add, edit, delete expenses and income
- π¦ Bank Account Management - Multiple accounts with balance tracking
- π Recurring Transactions - Auto-add monthly salary/expenses
- π Budget Tracking - Set monthly budgets with visual progress indicators
- π Search & Filter - Find expenses by description, category, or amount
- π± Responsive Design - Works seamlessly on desktop, tablet, and mobile
- π Dark/Light Theme - Toggle between themes (Premium feature)
- π‘οΈ Rate Limiting - Arcjet protection against abuse
- β Premium Membership - Razorpay payment integration (βΉ499)
- π Advanced Analytics - Daily, weekly, monthly expense trends
- π Category Breakdown - Visual pie charts of spending by category
- π Leaderboard - Compare spending with other premium users
- π₯ PDF Export - Download detailed expense reports
- π€ AI Receipt Scanner - Auto-fill expenses from receipt images
- π§ Monthly Email Reports - AI-powered financial insights via email
- π€ Profile Management - Update personal info and upload profile photo
- π Real-time Updates - Optimistic UI updates for instant feedback
- π§ Password Reset - Email-based password recovery via Brevo
- πΎ Transaction Safety - Database transactions ensure data consistency
- π Toast Notifications - User-friendly feedback messages
- π Date-based Tracking - Track expenses by specific dates
- π Notes & Comments - Add notes to transactions
- π― Budget Alerts - Visual warnings when approaching budget limits
![]()
Beautiful hero section with call-to-action and feature highlights
![]()
Comprehensive feature showcase with icons and descriptions
![]()
Transparent pricing plans with feature comparison
![]()
Simple and intuitive expense entry form with budget indicator
![]()
View all expenses with search, filter, and pagination
![]()
Premium membership page with Razorpay integration
![]()
User profile with statistics and photo upload
![]()
Premium membership page unlocked with Transaction breakdown days, weekly and monthly spending with pagination and Expense Report PDF Export
![]()
Comprehensive expense Category Breakdown, Expense Trends and Leaderboard comes in Premium membership
![]()
Pie chart showing expense distribution by category
![]()
Visual analytics with charts and spending trends daily, weekly and monthly
![]()
Top spenders list - See how you rank among all users and compete for the top spot
![]()
Beautiful dark theme for comfortable viewing
- React 18 - UI library
- Vite - Build tool and dev server
- Redux Toolkit - State management
- React Router v6 - Client-side routing
- Axios - HTTP client
- Tailwind CSS - Utility-first CSS framework
- Lucide React - Icon library
- Node.js - Runtime environment
- Express.js - Web framework
- MySQL - Relational database
- Sequelize - ORM for MySQL
- JWT - Authentication tokens
- Bcrypt - Password hashing
- Razorpay - Payment gateway
- Brevo (Sendinblue) - Email service
- Arcjet - Rate limiting & security
- Node-cron - Scheduled tasks
- Axios - HTTP client for AI APIs
- OpenRouter - AI model access (GPT-4o-mini, Llama 3.2)
- Zod - Schema validation
- Node.js (v14 or higher)
- MySQL (v8 or higher)
- npm or yarn
- Razorpay account (for premium features)
- Brevo account (for email service - FREE tier available)
- OpenRouter API key (for AI features - FREE tier available)
- Arcjet API key (for rate limiting - FREE tier available)
git clone https://github.com/yourusername/expense-tracker.git
cd expense-trackercd Backend
npm installcd ../Frontend
npm installCreate a .env file in the Backend directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# Database Configuration
DB_NAME=expense_tracker
DB_USER=root
DB_PASSWORD=your_password
DB_HOST=localhost
# JWT Secret
JWT_SECRET=your_super_secret_jwt_key_here
# Razorpay Configuration
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_secret
# Email Configuration (Brevo)
BREVO_API_KEY=your_brevo_api_key
BREVO_SENDER_EMAIL=your_email@example.com
# Frontend URL
FRONTEND_URL=http://localhost:5173
# Arcjet Configuration
ARCJET_KEY=your_arcjet_api_key
ARCJET_ENV=development
# AI Configuration (OpenRouter)
GEMINI_API_KEY=your_openrouter_api_keyCreate a .env file in the Frontend directory:
VITE_API_URL=http://localhost:5000CREATE DATABASE expense_tracker;cd Backend
npx sequelize-cli db:migrateThis will create the following tables:
- Users
- Expenses
- Orders
- ForgotPasswordRequests
- BankAccounts
node scripts/migrateUserTotals.jsThis populates user totals for existing data.
cd Backend
npm run devBackend runs on http://localhost:5000
cd Frontend
npm run devFrontend runs on http://localhost:5173
Open your browser and navigate to http://localhost:5173
Register a new user
{
"name": "John Doe",
"email": "john@example.com",
"password": "password123"
}Login user
{
"email": "john@example.com",
"password": "password123"
}Get all expenses (requires authentication)
Add new expense or income
{
"amount": 500,
"description": "Groceries",
"category": "Food",
"note": "Weekly shopping",
"expenseDate": "2024-01-15",
"type": "expense",
"BankAccountId": 1,
"isRecurring": false,
"recurringDay": null
}Scan receipt image and extract data (AI-powered)
{
"image": "data:image/jpeg;base64,..."
}Update expense
Delete expense
Create Razorpay order
Verify payment and activate premium
Update user profile
{
"name": "John Doe",
"email": "john@example.com",
"phone": "+91 9876543210",
"profilePhoto": "base64_encoded_image"
}Update monthly budget
{
"monthlyBudget": 50000
}Get all bank accounts
Create new bank account
{
"name": "HDFC Savings",
"balance": 50000,
"isDefault": true
}Update bank account
Delete bank account
Request password reset
{
"email": "john@example.com"
}Reset password with token
{
"password": "newpassword123"
}- Upload receipt images to auto-fill expense forms
- Extracts: Amount, Description, Category, Date
- Powered by: GPT-4o-mini via OpenRouter
- Location: Available on
/expensespage
- Automatic: Sent on 1st of every month at 9 AM IST
- Includes:
- Monthly income summary
- Category-wise spending breakdown (βΉ and %)
- AI-generated financial insights (3 actionable tips)
- Powered by: Llama 3.2 via OpenRouter
- Delivered via: Brevo email service
- Multiple Accounts: Track expenses across different bank accounts
- Balance Tracking: Real-time balance updates with transactions
- Default Account: Set a default account for quick expense entry
- Account Management: Add, edit, delete bank accounts
- Transaction History: View all transactions per account
- Monthly Salary: Auto-credit salary on specified day
- Recurring Expenses: Auto-add monthly bills (rent, subscriptions)
- Flexible Scheduling: Set any day (1-28) of the month
- Automatic Processing: Cron job runs daily to process due transactions
- JWT Authentication: Secure token-based auth
- Password Hashing: Bcrypt with salt rounds
- Rate Limiting: Arcjet protection (5 requests/10 seconds for expenses)
- Input Validation: Zod schema validation
- SQL Injection Protection: Sequelize ORM parameterized queries
- CORS Configuration: Controlled cross-origin access
- Password Reset: Secure token-based password recovery
- Monthly Reports: AI-powered financial insights (Premium)
- Transaction Notifications: Optional email alerts
- Brevo Integration: Reliable email delivery (300 emails/day free)
expense-tracker/
βββ Backend/
β βββ config/ # Database and app configuration
β βββ controllers/ # Request handlers
β βββ services/ # Business logic
β βββ models/ # Sequelize models
β βββ routes/ # API routes
β βββ middlewares/ # Auth, validation, rate limiting
β βββ validators/ # Zod schemas
β βββ migrations/ # Database migrations
β βββ scripts/ # Utility scripts
β βββ docs/ # Backend documentation
β βββ .env # Production environment variables
β βββ .env.local # Local development environment variables
β βββ server.js # Entry point
β βββ package.json
β
βββ Frontend/
β βββ src/
β β βββ assets/ # Static assets
β β β βββ react.svg
β β βββ components/ # React components
β β β βββ layout/ # Layout components
β β β β βββ Footer.jsx
β β β β βββ Header.jsx
β β β β βββ Layout.jsx
β β β βββ pages/ # Page components
β β β β βββ analyse/ # Analytics pages
β β β β β βββ AnalysePage.jsx
β β β β β βββ CategoryBreakdown.jsx
β β β β β βββ ExpenseTrends.jsx
β β β β β βββ Leaderboard.jsx
β β β β βββ bankAccount/ # Bank account management
β β β β β βββ BankAccountPage.jsx
β β β β βββ expense/ # Expense management pages
β β β β β βββ ExpenseDetailModal.jsx
β β β β β βββ ExpenseListPage.jsx
β β β β β βββ ExpensePage.jsx
β β β β βββ forms/ # Auth forms
β β β β β βββ ForgotPasswordForm.jsx
β β β β β βββ LoginForm.jsx
β β β β β βββ ResetPasswordForm.jsx
β β β β β βββ SignupForm.jsx
β β β β βββ landing/ # Landing page
β β β β β βββ LandingPage.jsx
β β β β βββ premium/ # Premium features pages
β β β β β βββ PremiumExpenseTracker.jsx
β β β β β βββ PremiumPage.jsx
β β β β β βββ PremiumPurchase.jsx
β β β β βββ profile/ # User profile page
β β β β βββ ProfilePage.jsx
β β β βββ ui/ # Reusable UI components
β β β βββ badge.jsx
β β β βββ button.jsx
β β β βββ card.jsx
β β β βββ input.jsx
β β β βββ label.jsx
β β β βββ Pagination.jsx
β β β βββ toast.jsx
β β βββ config/ # Configuration files
β β β βββ config.js # API URL configuration
β β βββ constants/ # Constants
β β β βββ api/ # API constants
β β β β βββ auth.js
β β β βββ message.js # Message constants
β β βββ context/ # React contexts
β β β βββ ThemeContext.jsx
β β βββ hooks/ # Custom hooks
β β β βββ usePagination.js
β β βββ lib/ # Utilities
β β β βββ utils.js
β β βββ store/ # Redux store
β β β βββ store.js
β β β βββ userSlice.js
β β βββ utils/ # Utilities
β β β βββ api/ # Centralized API calls
β β β β βββ auth/ # Auth API calls
β β β β β βββ forgotPassword.js
β β β β β βββ index.js
β β β β β βββ login.js
β β β β β βββ register.js
β β β β β βββ resetPassword.js
β β β β βββ bankAccount/ # Bank account API calls
β β β β β βββ createAccount.js
β β β β β βββ deleteAccount.js
β β β β β βββ getAllAccounts.js
β β β β β βββ index.js
β β β β βββ expense/ # Expense API calls
β β β β β βββ createExpense.js
β β β β β βββ deleteExpense.js
β β β β β βββ getAllExpenses.js
β β β β β βββ index.js
β β β β β βββ updateExpense.js
β β β β βββ premium/ # Premium API calls
β β β β β βββ downloadExpenses.js
β β β β β βββ getLeaderboard.js
β β β β β βββ index.js
β β β β β βββ purchasePremium.js
β β β β β βββ updateTransaction.js
β β β β βββ profile/ # Profile API calls
β β β β β βββ getStats.js
β β β β β βββ index.js
β β β β β βββ updateBudget.js
β β β β βββ index.js # Main API export
β β β βββ api.js # Request handler (axios wrapper)
β β β βββ validateForm.js
β β βββ App.css # App styles
β β βββ App.jsx # Main app component
β β βββ index.css # Global styles
β β βββ main.jsx # Entry point
β βββ docs/ # Frontend documentation
β βββ .env # Production environment variables
β βββ .env.local # Local development environment variables
β βββ vite.config.js # Vite configuration
β βββ package.json
β
βββ screenshots/ # Application screenshots
βββ README.md # This file
βββ LICENSE # MIT License
Set a monthly budget and track your spending in real-time. Visual indicators show:
- Green: Under 60% of budget
- Yellow: 60-80% of budget
- Orange: 80-100% of budget
- Red: Over budget
All database operations use transactions to ensure:
- Atomicity: Operations complete fully or not at all
- Consistency: Data remains valid
- Isolation: Concurrent operations don't interfere
- Durability: Committed changes persist
The UI updates immediately when you:
- Add an expense
- Edit an expense
- Delete an expense
If the operation fails, changes are automatically reverted.
Unlock advanced features with a one-time payment of βΉ499:
- Advanced analytics and trends
- Category breakdown charts
- Leaderboard access
- CSV export functionality
- Dark/Light theme toggle
- JWT-based authentication with 1-hour token expiry
- Bcrypt password hashing with salt rounds
- SQL injection prevention via Sequelize ORM
- XSS protection with React's built-in escaping
- CORS configuration for API security
- Environment variables for sensitive data
- Auto-logout on token expiration
cd Backend
npm testcd Frontend
npm test- Lazy loading for route-based code splitting
- Optimized bundle size with Vite
- Database connection pooling
- Efficient state management with Redux
- Pagination for large datasets
- Image optimization for profile photos
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Your Name
- GitHub: @MdAbdullahAnwar
- Email: crazydeveloper4444@gmail.com
- React team for the amazing library
- Express.js for the robust backend framework
- Tailwind CSS for the utility-first CSS framework
- Razorpay for payment integration
- All open-source contributors
For support, email crazydeveloper4444@gmail.com or open an issue on GitHub.
- Mobile app (React Native)
- Recurring expenses
- Multi-currency support
- Expense categories customization
- Budget alerts via email/SMS
- Export to PDF
- Expense sharing with family
- AI-powered spending insights
- Bank account integration
- Receipt scanning with OCR
Made with β€οΈ by MD Abdullah Anwar