feat(mobile): Field Collector with LAN gateway access #65
Merged
wasabi opened 4 days ago

Summary

  • Add offline-first Kokonut Field Collector (services/mobile) with GPS/photos, localStorage queue, and device-token register/forms/sync API on the FastAPI gateway.
  • Ship Compose gateway service (Dockerfile.gateway) and Caddy/Traefik routes for /mobile and /api/mobile/* so phones on the LAN can collect and sync same-origin without manual API URL setup.
  • Document local, production Caddy, and Traefik deployment steps in docs/deployment.md and the root README.md.

Entry points

  • Preferred LAN: https://<host-lan-ip>/mobile (after docker compose up -d --build gateway caddy)
  • Static: https://<host-lan-ip>/field/field-collector.html
  • Loopback: http://127.0.0.1:8099/mobile
  • Directus redirect: /field-collector/ → Caddy static path

Test plan

  •  KOKONUT_ALLOW_PLAINTEXT_ENV=true POSTGRES_PASSWORD=test CLICKHOUSE_PASSWORD=test .venv/bin/python -m pytest tests/test_mobile_api.py tests/test_gateway_auth.py tests/test_documentation_consistency.py -q
  •  docker compose config -q and CADDY_DOMAIN=example.com docker compose -f docker-compose.yml -f docker-compose.prod.yml config -q
  •  ./scripts/check-image-digests.sh
  •  docker compose up -d --build gateway caddy then curl -fsS http://127.0.0.1:8099/health and curl -kfsS https://localhost/mobile
  •  On a LAN phone: open https://<host-lan-ip>/mobile, save a record offline, sync when online (accept dev cert warning)

Closes KI-65

Co-Authored-By: Oz oz-agent@warp.dev

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-65
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover