Building Offline-First POS for Singapore Hawker Centres
WiFi in Singapore hawker centres is unreliable. Here's how we built Lunchbox to handle offline-first transactions with automatic sync. The Challenge A hawker stall doing 200+ transactions per day c...

Source: DEV Community
WiFi in Singapore hawker centres is unreliable. Here's how we built Lunchbox to handle offline-first transactions with automatic sync. The Challenge A hawker stall doing 200+ transactions per day can't afford downtime when the WiFi drops. Traditional cloud POS systems freeze. Customers leave. The lunch rush doesn't wait for your router to reboot. We learned this the hard way during early pilot testing at a hawker centre in Toa Payoh. The merchant lost 15 minutes of transactions during peak hour because the shared WiFi went down. That's roughly $300 in lost revenue โ in one lunch service. Our Approach We rebuilt the core transaction engine to be offline-first: Local-first data storage with IndexedDB โ every transaction is written locally before any network call Background sync when connectivity returns โ uses the Background Sync API with exponential backoff Conflict resolution for multi-device setups โ timestamp-based last-write-wins with manual override for edge cases Payment fallback