Case study · ToffeeOS · Multi-tenant café POS
Restaurant software two cafés run on every day.
How I designed, built, tested and shipped a multi-tenant point-of-sale system while finishing my CS degree, and why it keeps selling when the internet doesn’t.
- Role
- Sole engineer, end to end
- Clients
- SPILL & Loom, Bahawalpur
- Stack
- Next.js · Prisma · Supabase
- Status
- In production

01Operational problem
The internet drops. The till can’t.
Cafés in Pakistan take orders through a rush hour where the connection can go at any moment, and they still have to charge the right tax on every bill. Most of the local businesses I worked with were running orders on paper and WhatsApp.
A till that stops when the Wi-Fi does means lost orders and a queue at the counter. So the brief was simple: keep selling, always, and get the numbers right.
The answer became one system from order to report, built multi-tenant from day one: every café is its own tenant on one codebase, so a new client is a setup, not a fork.
POS
Takes orders and cash payments, even while offline.
Kitchen display
Orders reach the kitchen screen as they’re placed.
Inventory
Stock tracked against what’s actually sold.
Delivery riders
Delivery orders assigned and tracked.
QR table ordering
Guests order from their table.
Tax & reports
Punjab’s 16% cash / 8% card split, built in.
02Offline-first sync
Offline-first, so the counter never waits on the network.
The POS treats the connection as optional. When the internet drops, it keeps taking orders and cash payments, the things a counter can settle without a network, and holds them on the device.
The moment the connection is back, those orders sync to the shared Postgres database, and Supabase Realtime pushes the changes out to the kitchen display and every other screen in the café. Staff don’t switch modes or re-enter anything; the till just carries on.
- Frontend
- Next.js App Router, TypeScript
- Data
- Prisma on Supabase Postgres
- Live updates
- Supabase Realtime
- Hosting
- Vercel
- Resilience
- Offline order & cash capture
03Automated tax engine
A tax engine that gets every bill right.
Punjab’s sales tax on restaurant services depends on how the customer pays: 16% when they pay cash, 8% when they pay by card. Getting that wrong on a busy shift means wrong receipts and wrong reports at the end of the month.
ToffeeOS applies the split automatically on every single bill, based on the payment method recorded at the till, and carries it through to the reports. Nobody at the counter has to remember a rate.
Paid in cash
16%
16% of Rs 1,000 = Rs 160
Paid by card
8%
8% of Rs 1,000 = Rs 80
04CI/CD reliability
Live cafés don’t get a beta.
People are ringing up sales on this system right now, so every change has to prove itself first. 333 Playwright end-to-end tests and 228 Vitest unit tests run before every release: 561 checks between a commit and the counter.
That suite is what lets one engineer ship safely. It caught a Prisma transaction timeout before it reached production, a bug that would only have shown up under real load, at the till, mid-service.
333 Playwright E2E
228 Vitest unit
561 checks per release
05Live in production
Live at SPILL and Loom.
ToffeeOS runs SPILL and Loom, two cafés in Bahawalpur, every day: the till, the kitchen screen, inventory, delivery riders, QR table ordering and reports. SPILL’s website also connects to it through a QR scan-to-join loyalty card.
- 80+ orders a day across both cafés (30-day avg)
- ~5,000 real orders processed in production
- ~4,500 real payments processed in production
- 2 cafés live, one codebase
ToffeeOS is one of the products I’ve shipped through Krimsols, alongside software for 20+ paying clients since 2024.
Hiring a remote engineer? Let’s talk.
Available for remote full-stack and Python/AI roles, 30–40 hrs/week.