Fieldkit
An offline-first field-operations app that treats connectivity as a bonus, not a requirement.
STACK — React Native · Expo · SQLite · TypeScript · WatermelonDB
FIG. 04.0 — SYSTEM COMPOSITION, DRAWN IN CODE
THE PROBLEM, PLAINLY
Field teams — inspectors, technicians, delivery crews — spend their day where connectivity is worst, using apps designed as if it were perfect. Fieldkit inverts the assumption: the device is the source of truth, and the server is an eventually-consistent peer.
The R&D goal was a sync engine we would trust in production: deterministic conflict resolution, a replayable mutation log, and a UI that never shows a spinner for something the device already knows.
Local database first
Every read and write hits SQLite on-device. The UI is fully functional at 30,000 feet; the network is an optimization that runs when it can.
A mutation log, not a mirror
Changes append to an ordered log with device IDs and vector clocks. Sync replays intent, not state — which makes conflicts explicit, rare, and resolvable by rule.
Conflicts resolved by policy
Each entity declares its merge policy — last-writer-wins for notes, additive for checklists, human-review for safety-critical fields. Policy lives in one file, tested like code.
Sixty frames or it doesn’t ship
Lists virtualize, images decode off-thread, and the JS thread stays under 8 ms per frame on a mid-range Android — profiled, not hoped.
$ fieldkit sync --simulate offline:72h --profile mid-androidqueued mutations ......... 1,204batches .................. 25 (48 kB avg, gzip)conflicts detected ....... 17resolved by policy ..... 17 (0 escalated)sync wall-clock .......... 0.9 s on 4Gframe budget (list of 5k rows)js thread p95 .......... 6.8 ms ✓ 60 fps
- Notes / free text
- Last-writer-wins, full history retained
- Checklists
- Additive union — no completed step is ever lost
- Safety-critical fields
- Both versions held, human review forced
- Attachments
- Content-addressed — identical bytes never re-upload
ENGINEERING NOTE
Offline-first is a UX stance disguised as an architecture: the moment the app stops asking the network for permission, every interaction becomes instant — and instant is what users read as quality.
0%
FUNCTIONAL WITH ZERO SIGNAL
0.0s
SYNC AFTER 72 H OFFLINE
0
CONFLICTS AUTO-RESOLVED IN SIM
0fps
LIST SCROLL ON MID-RANGE ANDROID

