A full-stack expense tracker built with a FastAPI + SQLite backend and a React (Vite) frontend.
- Add an expense (amount, category, description, date)
- View all expenses
- Filter expenses by category and/or date
- Look up a single expense by ID
- Delete an expense
- Spending summary: total spent, highest expense, totals by category
- Backend: FastAPI, SQLite (sqlite3), Pydantic
- Frontend: React 19, Vite
- Deployment: Render
Expense Tracker/
├── main.py # FastAPI app and routes
├── database.py # Creates the SQLite expenses table
├── pyproject.toml # Backend dependencies (uv)
└── frontend/ # React + Vite app
└── src/
├── App.jsx
└── components/
Requires Python 3.14+ and uv.
uv sync
uv run uvicorn main:app --reload --port 8000The API is served at:
Swagger API documentation:
cd frontend
npm install
npm run devThe app is served at:
| Method | Path | Description |
|---|---|---|
| GET | /expenses/view | List all expenses |
| GET | /expenses/summary | Total, highest, and per-category totals |
| GET | /expenses/{id} | Get a single expense by ID |
| GET | /expenses?category=&date= | Filter expenses |
| POST | /expenses | Add an expense |
| DELETE | /expenses/{id} | Delete an expense |
Dates are expected in DD/MM/YYYY format.
The application is deployed on Render.
- Live frontend: https://expense-tracker-1-3td8.onrender.com/
- Backend API: https://expense-tracker-53ma.onrender.com/
- API documentation: https://expense-tracker-53ma.onrender.com/docs
- CORS is configured for the local Vite development server and the deployed frontend.
- expenses.db is gitignored and is created automatically when the API starts.
- The deployed version currently uses SQLite. Since SQLite stores the database as a local file, data on the deployed service is not guaranteed to persist across service replacements or redeployments.
- The deployed application does not currently have authentication, so expenses are shared between users.