A modern, full-stack expense tracking application built with React, Node.js, Express, and PostgreSQL.
- 🔐 User Authentication - Secure JWT-based login and registration
- 💵 Expense Management - Add, edit, delete expenses with categories
- 📊 Category Filtering - Filter expenses by category
- 📈 Real-time Totals - Automatic expense total calculation
- 🎨 Modern UI - Beautiful gradient design with smooth animations
- 📱 Responsive - Works perfectly on mobile and desktop
- 💾 Persistent Data - All data saved to PostgreSQL database
- Node.js 16+ installed
- PostgreSQL installed and running
- Git
git clone https://github.com/m-bwela/expense-tracker.git
cd expense-trackercd server
npm install
# Create .env file
echo "PORT=5000
DB_HOST=localhost
DB_USER=postgres
DB_PASSWORD=your_password
DB_DATABASE=expense_tracker
DB_PORT=5432
JWT_SECRET=your_jwt_secret_here" > .env
# Create database and tables
# Use pgAdmin or psql to run: server/schema.sql
# Start backend
npm run devBackend will run on http://localhost:5000
cd "../client side"
npm install
# Start frontend
npm run devFrontend will run on http://localhost:5173
- Visit
http://localhost:5173 - Register a new account
- Add some expenses
- Logout and login to verify persistence
This app is designed to be deployed on free hosting platforms:
- Backend + Database: Render (Free tier)
- Frontend: Vercel (Free tier)
📖 Full deployment guide: See DEPLOYMENT.md
expense-tracker/
├── client side/ # React frontend (Vite)
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── context/ # Auth context
│ │ ├── services/ # API service
│ │ └── assets/ # CSS and images
│ └── package.json
│
├── server/ # Node.js backend
│ ├── config/ # Database config
│ ├── routes/ # API routes
│ ├── middleware/ # Auth middleware
│ ├── schema.sql # Database schema
│ └── package.json
│
└── DEPLOYMENT.md # Deployment instructions
- React 19 - UI library
- Vite - Build tool
- React Router - Navigation
- Axios - HTTP client
- Material-UI Icons - Icons
- Context API - State management
- Node.js - Runtime
- Express 5 - Web framework
- PostgreSQL - Database
- JWT - Authentication
- bcryptjs - Password hashing
- CORS - Cross-origin support
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user (protected)
GET /api/expenses- Get all user expenses (protected)POST /api/expenses- Create expense (protected)PUT /api/expenses/:id- Update expense (protected)DELETE /api/expenses/:id- Delete expense (protected)
- Password hashing with bcrypt
- JWT token authentication
- Protected API routes
- Input validation
- SQL injection prevention (parameterized queries)
- CORS configuration
Modern gradient design with smooth animations
Clean expense table with filtering and totals
Works perfectly on all devices
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is open source and available under the MIT License.
m-bwela
- GitHub: @m-bwela
- Icons from Material-UI
- Gradient inspiration from modern SaaS designs
- Built with love and ☕
Happy expense tracking! 💰