feat: Kokonut Field Collector — offline-first mobile companion app #66
Merged
wasabi opened 4 days ago

Summary

Adds the Kokonut Field Collector — an offline-first, PWA-ready companion app for field data collection on mobile devices.

What's included

  • Field Collector UI (services/mobile/field-collector.html): Single-page app with form rendering, GPS capture, photo upload, offline queue, and sync
  • Mobile API (services/mobile/api.py): Device registration, form listing, collection sync, and sync status endpoints
  • Gateway integration: Mobile API mounted at /api/mobile/*, field collector served at /mobile via Caddy TLS
  • Caddy TLS: Self-signed cert with SANs for localhost + LAN IP — iOS users accept the cert warning once, then GPS works
  • iOS GPS fixes: isSecure() check, navigator.permissions probe, HTTPS-required banner, 15s timeout
  • Device registration fix: Resolved 500 error by switching from get_connection() (wrapper) to get_db() (raw psycopg2), added missing device_token_hash column
  • Provider snapshot fix: list(providers) snapshot in remote_sensing_fetcher.py to avoid Semgrep list-modify-while-iterate finding
  • Test env cleanup: tests/test_common_env.py now clears production-required env vars

How to test

  1. docker compose up -d
  2. On iMac: https://localhost/mobile
  3. On iPhone: https://10.108.1.215/mobile (accept cert warning)
  4. Register device, fill a form, check GPS capture
Commits were merged into target branch
1/1
Submitter wasabi
Target main
Source feat/mobile-field-collector
Jobs
Merge Strategy
Create Merge Commit
Watchers (1)
Reference
pull request KI-66
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover