DivvyMate
Expense-sharing back end with equal, exact and percentage splits
User, expense and balance-sheet services that split expenses three ways, publish expense events to Kafka, and generate downloadable balance sheets. Runs behind nginx on PostgreSQL and Redis.
- 3 split modes
- 3 services
- Kafka producer/consumer
- Balance-sheet export
§1
The problem
Groups sharing daily expenses need correct per-person balances whether a bill is split equally, by exact amounts or by percentage.
§2
My role
Built the services, split validation, Kafka producer/consumer and the Docker/nginx setup.
§3
Architecture
§4
Key decisions
D/01
Validate splits at the edge
Exact amounts must sum to the total and percentages to 100, rejected before anything is written.
D/02
Balance sheet as a consumer
The balance-sheet service consumes expense events, so writes stay fast and reporting is decoupled.
§5
Challenges
- Rounding: percentage splits that don't divide evenly must still sum to the exact total.
§6
Stack
- Node.js
- Express
- PostgreSQL
- Kafka
- Redis
- Nginx
- Docker
Next case study
NexRule
A rule engine that turns rule strings into stored ASTs