project
Payment tracking that runs on-site, on a Pi
Replacing a spreadsheet with retroactive commission logic, month-end PDF reports and automatic Drive backups, reachable remotely over Tailscale.
This started as a request to replace a spreadsheet-based payment process that had got unwieldy. Teachers taught multiple classes at different commission rates, and reconciling payments at month end was slow and error-prone.
Node and Express with PostgreSQL behind them, running on a Raspberry Pi on-site with Tailscale for secure remote access. The hard part was the payment logic: late payments, enrollment periods tracked so historical records stay accurate when students join or leave mid-month, and teacher commissions recalculated retroactively when a late payment lands — all inside database transactions so the numbers stay consistent.
At month end the admin generates a PDF per teacher via server-side Puppeteer rendering: class breakdown, paid and unpaid student counts, commission total. Database backups run to Google Drive on a schedule.
What I took away
Junction tables should carry relationship metadata — enrollment dates, payment status — not just foreign keys. Those extra columns turn a link table into a first-class audit record.
Denormalizing calculated fields like teacher earnings into stored values, rather than computing on every read, is the right call once query frequency passes a handful per minute.
Automated backups need to exist before you go live with real data. The first time a backup would have been useful is always before you set it up.