runbook № 04 — offline-first, demonstrated live

Works where
the signal doesn’t.

Every app I ship treats the network as an optimization. This page is built the same way — so instead of telling you, the console on the left hands you the kill switch. Sever the uplink. Everything keeps working.

live demo
field-logIndexedDB · local-first
writes land locally first · the network is an optimization, not a dependency
THE REAL TEST

Don’t trust a simulation? Turn on airplane mode and reload this page. Still here. A service worker holds the shell, IndexedDB holds your log entries, and the sync engine picks up where it left off.

The discipline

3 rules I don’t bend
01

The cache is the source of truth

The server is a peer you sync with, not a dependency you block on. Every read is answered locally first; the network fills in behind it. That inversion is the whole discipline — everything else follows.

SQLiteRealmIndexedDB
02

Queue, don’t block

Writes commit locally and join an op log with a logical clock. The UI moves on instantly. Replay is idempotent and ordered, so a two-day outage on a trek resolves the same way a two-second one does.

Op logLogical clocksIdempotent replay
03

Conflicts are product decisions

Last-writer-wins is a default, not a strategy. Per-field merge, tombstones, user-visible resolution — I decide per entity with the product owner, then encode it in the sync layer where it’s testable.

Merge policyTombstonesTestable sync

Field record

shipped into real dead zones

OnlyEver

sync architecture · production

AI-powered e-learning with an offline-first Flutter app: MongoDB-backed delta sync, review sessions that work airside, and generative content that lands in the local store the moment the link returns. The patterns on this page run there in production.

Susasan · 12+ municipalities

civic tech · low-connectivity Nepal

Municipal notices, services, and citizen grievances for local governments where connectivity is a rumor. One codebase, Flutter flavors per municipality, and caching decisions made for 2G hill towns — not office wifi.

Label STEP · Artisan Villages

fair trade · field operations

Coordination tool for weavers, manufacturers, and distributors across Nepal’s carpet industry. Field workers sync when they can, not when the app demands — the queue does the waiting, not the human.

open channel

Building for users the network forgot?

Offline-first sync, conflict strategy, store releases that don’t bounce — I’ve owned that path in production more than once. The uplink to me is reliable.

© 2026 Shreedhar Pandeya · works in airplane mode● cached · Kathmandu UTC+5:45