A full-stack expense tracker application built with:
- Backend: Node.js, Express, Prisma (PostgreSQL)
- Frontend: React (TypeScript), Axios, Tailwind CSS
- PDF Export: jsPDF + jspdf-autotable
root/
│
├── server/ # Backend (Node.js + Express + Prisma)
│ ├── src/
│ ├── prisma/
│ └── .env
│
├── client/ # Frontend (React + Vite + TypeScript)
│ └── src/
│
└── README.md # Project instructions
- Node.js ≥ 18.x
- PostgreSQL running locally (or Neon)
- pnpm / npm / yarn
cd servernpm installCreate .env from the example:
cp .env.example .envUpdate the .env:
DATABASE_URL=postgresql://username:password@localhost:5432/expensetracker
JWT_SECRET=your_jwt_secret
npx prisma migrate dev --name inittsc -b
npm run startAPI will run on http://localhost:3000
cd clientnpm installcp .env.example .envConfigure:
VITE_API_URL=http://localhost:3000
npm run devReact app will run on http://localhost:5173
- ✅ User authentication with JWT
- ✅ Add / delete expenses
- ✅ Income summary
- ✅ PDF export (supports thousands of rows)
- ✅ Token-injected Axios instance
- ✅ Prisma PostgreSQL backend
- Login → returns
{ user, token } - Token stored in
localStorage - Authenticated endpoints require Bearer token
GET /auth/validateused on load to verify session
Large datasets are supported using jsPDF + jspdf-autotable.
Data is paginated internally to avoid memory crashes.
- New expenses use
Omit<Expense, "id" | "createdAt"> - Axios instance is configured in
client/src/api/axios.ts - Prisma schema is in
server/prisma/schema.prisma
Use Postman or Insomnia.
Endpoints:
POST /loginPOST /signupGET /expensesPOST /expensesDELETE /expenses/:id
Open an issue or ping the maintainer.
MIT – free to use, modify, and distribute.