
Papirun
A production-grade food delivery system — not a website, an operation. Three apps, one PostgreSQL backbone, real-time order flow from checkout to driver hand-off, and a custom dispatch engine that decides who delivers what.
- Three role-aware surfaces on one codebase: customer ordering app, admin operations console, and driver delivery app — all subscribed to the same Realtime channels
- Custom ECT (Expected Completion Time) algorithm auto-assigns drivers by remaining workload, with manual override and live re-routing on the admin map
- Order lifecycle workflow: cart → checkout → kitchen ticket → driver pickup → live tracking → PDF invoice — every state change is auditable in PostgreSQL
- Layered API architecture — typed src/lib/*Api.ts modules isolate the data layer from React components, so business rules live in one place
- Bidirectional chat (customer ↔ admin ↔ driver) with operator handoff, push notifications and structured incident reporting
- PWA + Capacitor hybrid — one codebase ships to web, iOS and Android with native push, haptics, geolocation and background refresh
- Role-Level Security policies on every table so the customer app, driver app and admin console literally cannot see each other's data



