all projects
Offline-First POS preview

Offline-First POS

Privateweb

IndexedDB-backed POS designed for low-connectivity retail environments. Works fully offline with Service Workers, queues transactions locally, and syncs cleanly when network returns.

React.jsIndexedDBService WorkersNode.js
A POS that doesn't care if your internet works.

The problem

Most cloud POSes die the moment Wi-Fi flickers, which is unacceptable in markets, rural shops, kiosks, and food trucks — exactly the kinds of merchants who can't afford backup connectivity. The store can't tell a customer 'sorry, the internet is down'.

The approach

Inverted the dependency: the local app is the source of truth, and the cloud is the eventually-consistent replica. Catalogue, transactions, and customer data live in IndexedDB and the entire UI works fully offline. A Service Worker queues every transaction with a monotonic local ID; when the network returns, a background sync replays the queue against the server with conflict resolution. The cashier never knows the network was down.

Tech decisions

IndexedDB
Local-first storage with proper transactions; survives reloads and tab closes without losing work
Service Worker + background sync
Queues writes during offline windows and replays automatically on reconnect
Monotonic local IDs
Transaction order is preserved across the offline → online boundary
Conflict-resolution rules on the server
Server is the arbiter when two clients sync overlapping changes

Outcomes

  • Full POS flow (catalogue → cart → checkout → receipt) works fully offline
  • Transactions queue locally and sync on reconnect with no data loss
  • Cashier UX is identical whether online or offline
  • Tested across simulated connectivity drops and tab kills

What I learned

Offline-first is a design choice, not a feature to bolt on. You either own the local database from day one or you spend forever retrofitting consistency. Service Worker background sync is criminally underused — it's a one-line API for a hard problem.