expense-tracker
A small app with production-grade engineering: idempotent APIs, 113 tests.
- FastAPI
- SQLAlchemy
- PostgreSQL
- React
- Docker
- Nginx
See it working
Problem
An expense tracker is a deliberately boring domain. That's the point: with nothing novel to hide behind, the engineering is the product.
Every practice here is one I use on production systems that move real money: requests that survive flaky networks and double-clicks, money that cannot drift by a single paisa, and logs that can replay any bug report exactly.
Architecture
Decisions and trade-offs
1. Idempotent creation with client-generated UUIDs.
The client generates a UUID per submission. Double-click the button or let a laggy network retry the request, and the primary key catches it: the server returns the same expense with an X-Idempotent-Replayed header, never a duplicate.
2. Money as integer paisa.
No floats near currency, ever. Formatting is the frontend's job.
3. Trace every request.
X-Request-ID flows through logs end to end, so any bug report can be replayed against exactly what happened.
What I measured
113 integration tests
one-script EC2 deploy with TLS, built and operated by me
multi-stage Docker build