DOSTI field ops
Donation boxes and school aid on patchy mobile data
The smaller number is the true one.
Next.js · IndexedDB · PWA · MongoDB · WhatsApp Cloud API · VitestISubjectWho it was for
A US-registered nonprofit whose Pakistan office has no reliable internet: field staff placing, collecting and auditing donation boxes across Peshawar and Khyber, and five years of school-aid handovers kept in one Excel sheet.
IIPresenting symptomThe problem
Data dying in transit. Field entries with nowhere to go when the signal dropped, and quantity cells Excel had quietly turned into negative numbers.
IIIReconstructionWhat was really going on
Both failures had the same root: the source of truth was wherever the data happened to be. On the phone it was a form that needed a network. In the office it was a spreadsheet that rewrote numbers without telling anyone.
I reconstructed each failure until I could watch it happen, then designed around it.
IVInterventionWhat I built
- 01
Dosti Impact writes to IndexedDB first and syncs deltas with a cursor when the network comes back. Photos queue in their own store with orphan pruning and client-side compression; duplicate collections are guarded.
- 02
WhatsApp receipts retry until they land, and moved off the AiSensy aggregator to Meta's Cloud API directly.
- 03
The DOORS importer is idempotent: it parses Excel's mangled quantity cells, fills a missing district only when every clue agrees, and reloads a corrected sheet without duplicates.
- 04
Data migrations run behind a write guard with a mandatory dry run. The outreach dashboard reports only what the forms actually record.
VEvidenceResults
- 1,130
- donation boxes tracked
- production export, 20 May 2026
- 281
- tests: unit, integration, IndexedDB persistence
- 1,245
- deliveries imported
- Nov 2020 – Apr 2026
- 10,161
- units recovered from 311 mangled cells
- 96%
- district inference accuracy
- in backtest
- PKR 15 → 2.9
- per WhatsApp receipt
- per-message rate, Sept 2026
VILimitationsWhat it doesn't do
- An earlier outreach headline was withdrawn as inaccurate once the importer showed what the forms record: about 7,500 students across 1,245 deliveries. The smaller number is the true one.
- I have not measured a sync-reliability rate, so I do not quote one.
- District inference is 96% in backtest, not 100%. That is why the importer leaves a district blank unless every clue agrees.
- PKR 15 → 2.9 is a per-message rate, not a measured total saving, and Meta reprices Pakistan from 1 Oct 2026.
- The code and data belong to DOSTI, so there is no public repository.
Email or form · reply within 24 h