DazzPOS: Retail POS
How we architected a resilient, offline-first Point of Sale application capable of processing high-volume barcode transactions with zero downtime during internet outages, syncing automatically to PostgreSQL via M-Pesa automated webhooks.
The Challenge: Internet Volatility in Fast-Paced Retail
Retail checkout lines cannot stop because an ISP fiber line drops or mobile connectivity fluctuates. The client was operating across multiple retail locations in Nairobi and surrounding East African commercial centers where legacy cloud-only POS systems froze during outages, creating massive customer queues and lost revenue.
Architectural Strategy: Local-First Storage with Event-Driven Sync
Rather than forcing every barcode scan to ping a remote cloud database, we designed a local-first architecture. The browser terminal writes immediately to an in-memory IndexedDB / SQLite transaction ledger and generates instant receipts, while a background sync engine handles conflict resolution and pushes batches to the central PostgreSQL cluster once connectivity is established.
The Build: Engineering the Solution
We built the cashier interface using Next.js, React, and Tailwind CSS with custom keyboard shortcut hooks for high-speed cashier entry. The backend was structured with Node.js and PostgreSQL, utilizing BullMQ queues for high-volume invoice processing and M-Pesa webhook verification.
The Result: Flawless Retail Operations at Scale
DazzPOS rolled out to more than 50 active retail terminals. During routine local internet disruptions, terminals continued processing sales seamlessly, eliminating checkout wait times and saving hundreds of lost sales hours.
Key Engineering Lessons Learned
- →Building offline-first requires strict transaction idempotency to prevent duplicate inventory deductions during reconnection.
- →Local barcode scanning must bypass React DOM re-render cycles for instant high-frequency scanner input.
- →Automating M-Pesa validation eliminates the primary source of retail checkout cashier error.