LOOPandaLOOPanda
ENTRY 04 / 05MOBILETYPE: R&D

Fieldkit

An offline-first field-operations app that treats connectivity as a bonus, not a requirement.

STACK — React Native · Expo · SQLite · TypeScript · WatermelonDB

DEVICE.PAIRPUSHSYNCOFFLINE-FIRST · CONFLICT-FREE

FIG. 04.0 — SYSTEM COMPOSITION, DRAWN IN CODE

SEC. 01BRIEF

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.

SEC. 02APPROACH
01

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.

02

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.

03

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.

04

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.

SEC. 03ARCHITECTURE
EXPO · RN UISQLITE · LOCAL DBSYNC ENGINEMUTATION LOGPUSH · CHANNELSAPI · CONFLICT MERGEPEER DEVICE
FIG. — UI reads and writes SQLite directly; an ordered mutation log feeds the sync engine, which reconciles with the API and peer devices when a channel opens.
SEC. 04ARTIFACTS
>_ SYNC SIMULATION
$ fieldkit sync --simulate offline:72h --profile mid-android
 
queued mutations ......... 1,204
batches .................. 25 (48 kB avg, gzip)
conflicts detected ....... 17
resolved by policy ..... 17 (0 escalated)
sync wall-clock .......... 0.9 s on 4G
 
frame budget (list of 5k rows)
js thread p95 .......... 6.8 ms ✓ 60 fps
§ MERGE POLICIES
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.

SEC. 05OUTCOME

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

NEXT ON THE LEDGER — ENTRY 05 / 05Forgeline