The problem
Work orders live in a spreadsheet, crews are dispatched over the phone, and the office rebuilds each invoice from photos sent to WhatsApp. Nobody can answer what a job cost until three weeks after it is finished.
Our approach
One record per job, owned by the field. The mobile app is offline-first: a crew records materials, hours and photos with no signal and the device reconciles when it reconnects. The office sees the same record update, and invoicing reads from it instead of re-typing it.
Architecture
- Clients
- React Native app (offline-first)Next.js dispatch console
- Edge
- API gatewayAuth + device tokens
- Services
- Job serviceSync + conflict resolverInvoice workerNotification worker
- Data
- PostgreSQLAppend-only job event logRedis queueS3 (photos)
- External
- ERPAPNs / FCM
React Native app with a local SQLite journal and last-write-wins reconciliation per field
Job service exposing a typed REST contract, deployed behind an API gateway
PostgreSQL as the record of truth, with an append-only event log per job for the audit trail
Background workers for invoice generation, ERP sync and push notifications
Next.js dispatch console with live map, capacity view and cost-to-date per job
What usually goes wrong
Offline sync is where these projects die. We fix the conflict rules per field in the architecture phase — before the app is built — and we test them on a device in a basement with airplane mode on, not in a simulator.