A clean, modern full-stack budget tracker built with React, Express, and MongoDB.
- User Authentication - Register and login with JWT-based authentication
- Protected API Routes - Transactions and categories require valid auth tokens
- Transaction Management - Add, edit, delete, and clear transactions
- Category Management - Add, edit, and delete custom categories
- Smart Defaults - New users get default categories automatically
- Visual Insights - Monthly overview and expense category charts
- Time Filtering - Filter by week, month, last30days, year, or all
- React 19
- Vite
- Tailwind CSS
- React Router
- Recharts
- Axios
- Radix UI primitives
- Node.js
- Express
- MongoDB + Mongoose
- JWT authentication
- bcryptjs
- Node.js 18 or higher
- npm
- MongoDB (local or Atlas)
From the root folder:
npm install
cd client
npm installCreate a .env file in the project root:
MONGO_URI=your_mongodb_connection_string
JWT_TOKEN=your_jwt_secret
PORT=5000
CLIENT_URL=http://localhost:5173Create a .env file in client/:
VITE_API_URL=http://localhost:5000Run backend (from root):
npm run devRun frontend (from client/):
npm run devDefault local URLs:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:5000
npm run dev- Start backend with nodemonnpm start- Start backend with node
npm run dev- Start Vite dev servernpm run build- Build production bundlenpm run preview- Preview production buildnpm run lint- Run ESLint
Base URL: /api
POST /auth/registerPOST /auth/login
GET /transactions?period=week|month|last30days|year|allPOST /transactionsPUT /transactions/:idDELETE /transactions/:idDELETE /transactions
GET /categoriesPOST /categoriesPUT /categories/:idDELETE /categories/:id
Protected routes require a bearer token:
Authorization: Bearer <token>- CORS allows
CLIENT_URLfrom.envandhttp://localhost:5173 - Registration creates default categories (
Food,Transportation,Miscellaneous) - Client falls back to
http://localhost:5000ifVITE_API_URLis not set
- Add automated tests (backend + frontend)
- Add refresh-token/session strategy
- Add CI lint/build checks
- Add Docker setup