Selected work

Mobile Engineer · Flutter, Offline-first · 2026

The field-agent app and offline sync layer for a cocoa traceability platform in Ghana.

  • Flutter
  • Riverpod
  • Drift
  • SQLCipher
  • Offline sync
  • GPS mapping
  • EUDR
  • 2,544

    Tests passing

  • 240

    Form questions

  • 995

    Commits to the field app

  • 15 m

    GPS accuracy gate

GreenTrace Ghana is a multi-tenant ESG-compliance and traceability platform for Ghana's cocoa supply chain, starting with Licensed Buying Companies, with timber and textiles later and TradeIQ commodity intelligence on top. It maps farms to the Rainforest Alliance GPS spec, traces lots from farm to port, runs deforestation checks, and produces EU Deforestation Regulation (EUDR) due diligence statements and Bank of Ghana ESG reports. My part is the Flutter field-agent app and its offline sync layer. The backend and web portal were built by the rest of the team.

The platform and my part

Enterprise admins and supervisors use the web portal, field agents use mobile, auditors and banks, DFIs and regulators get read-only reporting views, and farmers reach the system by WhatsApp or USSD. The platform is Go microservices on Cloud Run with Postgres and PostGIS under forced row-level security, behind a gateway that exposes 347 API operations. I authored about 995 of roughly 1,050 commits in the mobile repo and own its CI. I did not build the backend or the portal.

Offline-first sync

The app uses Flutter with Riverpod 3 (codegen), go_router, Dio and Freezed, over an encrypted local store with Drift on SQLCipher. Writes go through a transactional outbox with idempotency keys and UUID operation ids. A lease-based sync engine drains it with retry, dead-lettering and conflict handling, and a sync-queue screen shows server error codes and request ids so an agent can report a failure precisely. I chose a custom outbox over PowerSync.

Dynamic forms

The 240 questions across 9 stakeholder questionnaire packs are turned into JSON-Schema forms, and the app renders them from cached definitions. The catalogue can change without an app release, and agents can keep filling forms with no signal.

GPS boundary mapping

An agent can capture a boundary corner by corner, with about 10 seconds of averaging per corner, or walk it continuously, dropping any fix worse than 25 m. A 15 m median-accuracy gate asks the agent to re-trace a poor boundary. Farms of 4 ha or more require a polygon, which mirrors the EUDR rule. Results show on a flutter_map basemap.

Evidence, custody and rollout

Evidence uploads go by signed URL straight to cloud storage at up to 50 MiB per file, with photos compressed and hashed on the device and location EXIF stripped. The app also does camera document scanning, QR scanning, lot custody transfer with a handover code, a shade-tree census with canopy photos, biometric or PIN sign-in, and a minimum-version gate. It ships in 4 build flavors: dev, staging, prod and a GPS field-test build. English and Twi localisation is in progress, with layouts built for Twi and Hausa text running 20 to 30 percent longer. The build started in September 2026 on a 9-month MVP, and about 2,544 tests were passing at the October handover.

Highlights

  • Flutter field-agent app with Riverpod 3, go_router, Dio and Freezed
  • Encrypted Drift store over SQLCipher
  • Transactional outbox with idempotency keys and a lease-based sync engine with dead-lettering
  • Sync-queue screen that shows server error codes and request ids
  • 240 questions across 9 questionnaire packs rendered as JSON-Schema forms from cached definitions
  • GPS capture with a 15 m median-accuracy gate and a polygon requirement at 4 ha or more
  • Evidence upload by signed URL, with on-device hashing and location EXIF stripped
  • Analytics in PostHog, push through OneSignal, no Firebase

© 2026 Theophilus Rex Danquah

Accra, Ghana