A comprehensive full-stack expense tracking application built with React and Node.js that helps users manage their finances, track transactions, and visualize spending patterns with modern UI/UX.
- Features
- Tech Stack
- Prerequisites
- Installation
- Environment Setup
- Database Schema
- Running the Application
- API Documentation
- Project Structure
- Usage Guide
- Deployment
- Contributing
- License
- Support
- JWT Authentication - Secure login/logout with JSON Web Tokens
- Social Authentication - Firebase integration for Google/Facebook login
- Password Encryption - Bcrypt hashing for secure password storage
- Protected Routes - Middleware-based route protection
- Multi-Account Support - Bank accounts, cash, credit cards, savings
- Real-time Balance - Dynamic balance calculations
- Account Categories - Organized account types with visual indicators
- CRUD Operations - Full create, read, update, delete functionality
- Income & Expense - Complete transaction categorization
- Date Filtering - Advanced date range filtering capabilities
- Transaction Categories - Customizable expense and income categories
- Bulk Operations - Multiple transaction management
- Search & Filter - Advanced search with multiple criteria
- Interactive Charts - Using Recharts for beautiful visualizations
- Pie Charts - Category-wise expense breakdown
- Line Charts - Spending trends over time
- Bar Charts - Monthly/yearly financial summaries
- Dashboard Analytics - Comprehensive financial overview
- Excel Export - Export transactions to Excel files
- Data Validation - Form validation with Zod schemas
- Real-time Updates - Live data synchronization
- Responsive Design - Mobile-first design approach
| Technology | Purpose | Version |
|---|---|---|
| React | UI Framework | 18.2.0 |
| Vite | Build Tool | 6.3.5 |
| Tailwind CSS | Styling | 3.4.3 |
| Zustand | State Management | 4.5.2 |
| React Router | Navigation | 6.23.1 |
| React Hook Form | Form Management | 7.51.4 |
| Recharts | Data Visualization | 2.12.7 |
| Firebase | Authentication | 10.14.1 |
| Axios | HTTP Client | 1.6.8 |
| Sonner | Notifications | 1.4.41 |
| Technology | Purpose | Version |
|---|---|---|
| Node.js | Runtime Environment | 16+ |
| Express.js | Web Framework | 5.1.0 |
| PostgreSQL | Database | 8.15.6 |
| JWT | Authentication | 9.0.2 |
| Bcrypt | Password Hashing | 5.1.1 |
| CORS | Cross-Origin Requests | 2.8.5 |
| Dotenv | Environment Variables | 16.5.0 |
Before you begin, ensure you have the following installed:
- Node.js (v16.0 or higher) - Download
- PostgreSQL (v12 or higher) - Download
- Git - Download
- npm or yarn package manager
git clone https://github.com/Likhi2005/ExpenseTracker.git
cd ExpenseTrackercd backend
npm installcd ../frontend
npm installCreate .env file in the backend directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# Database Configuration
PG_USER=your_postgres_username
PG_HOST=localhost
PG_DB=expense_tracker
PG_PASSWORD=your_postgres_password
PG_PORT=5432
# Authentication
JWT_SECRET=your_super_secret_jwt_key_here
# Optional: Database URI (alternative to individual PG_ variables)
# DATABASE_URI=postgresql://username:password@localhost:5432/expense_trackerCreate .env file in the frontend directory:
# API Configuration
VITE_API_URL=http://localhost:5000/api-v1
# Firebase Configuration (for social authentication)
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id-
Start the Backend Server
cd backend npm start # Server runs on http://localhost:5000
-
Start the Frontend Development Server
cd frontend npm run dev # Application runs on http://localhost:5173
-
Access the Application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/api-docs (if implemented)
-
Build Frontend
cd frontend npm run build -
Start Production Server
cd backend NODE_ENV=production npm start
POST /api-v1/auth/register- User registrationPOST /api-v1/auth/login- User loginPOST /api-v1/auth/logout- User logout
GET /api-v1/accounts- Get user accountsPOST /api-v1/accounts- Create new accountPUT /api-v1/accounts/:id- Update accountDELETE /api-v1/accounts/:id- Delete account
GET /api-v1/transactions- Get transactions with filtersPOST /api-v1/transactions- Create new transactionPUT /api-v1/transactions/:id- Update transactionDELETE /api-v1/transactions/:id- Delete transaction
GET /api-v1/users/profile- Get user profilePUT /api-v1/users/profile- Update user profile
ExpenseTracker/
βββ backend/ # Node.js Express API
β βββ controllers/ # Request handlers
β β βββ authController.js
β β βββ accountControllers.js
β β βββ transactionController.js
β β βββ userController.js
β βββ libs/ # Utilities and configurations
β β βββ database.js # PostgreSQL connection
β β βββ index.js
β βββ middleware/ # Custom middleware
β β βββ authMiddleware.js
β βββ routes/ # API route definitions
β β βββ authRoutes.js
β β βββ accountRoutes.js
β β βββ transactionRoutes.js
β β βββ userRoutes.js
β β βββ index.js
β βββ index.js # Main server file
β βββ package.json
βββ frontend/ # React Vite Application
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ ui/ # Basic UI components
β β β βββ wrappers/ # Layout components
β β βββ libs/ # Utilities and API calls
β β βββ pages/ # Page components
β β β βββ auth/ # Authentication pages
β β βββ store/ # Zustand state management
β β βββ assets/ # Static assets
β β βββ App.jsx # Main app component
β β βββ main.jsx # App entry point
β βββ public/ # Static public assets
β βββ index.html
β βββ vite.config.js
β βββ tailwind.config.js
β βββ package.json
βββ .gitignore
βββ README.md
- Create a new account or sign in with existing credentials
- Option for social authentication via Firebase
- Add your financial accounts (bank, cash, credit cards)
- Set initial balances for each account
- Categorize accounts by type
- Record income and expense transactions
- Categorize transactions for better tracking
- Add descriptions and transaction dates
- View interactive charts and graphs
- Filter data by date ranges
- Export transaction data to Excel
- Monitor spending patterns and trends
- Update personal information
- Change password
- Manage account preferences
-
Build the application
cd frontend npm run build -
Deploy to Netlify
npm install -g netlify-cli netlify deploy --prod --dir=dist
-
Prepare for deployment
# Add start script in package.json "scripts": { "start": "node index.js", "dev": "nodemon index.js" }
-
Deploy to Heroku
heroku create your-expense-tracker-api heroku addons:create heroku-postgresql:hobby-dev git push heroku main
- Set all required environment variables in your deployment platform
- Use production database credentials
- Set
NODE_ENV=production - Configure CORS for production domain
We welcome contributions! Please follow these steps:
-
Fork the Repository
git fork https://github.com/Likhi2005/ExpenseTracker.git
-
Create Feature Branch
git checkout -b feature/amazing-feature
-
Commit Changes
git commit -m 'Add amazing feature' -
Push to Branch
git push origin feature/amazing-feature
-
Open Pull Request
- Follow the existing code style
- Write clear commit messages
- Add tests for new features
- Update documentation as needed
This project is licensed under the ISC License - see the LICENSE file for details.
Likhi2005
- GitHub: @Likhi2005
- Repository: ExpenseTracker
If you encounter any problems or have questions:
- Check Issues: Browse existing GitHub Issues
- Create New Issue: Report bugs or request features
- Documentation: Refer to this README for setup instructions
- Contact: Reach out via GitHub
- Inspired by modern financial management applications
- Built with love using open-source technologies
- Special thanks to the React and Node.js communities
β Star this repository if you found it helpful!
π Found a bug? Report it here
π‘ Have a feature idea? Suggest it here