trails/docs/ideas/mobile-nearby-sync/proposal.md
Ullrich Schäfer 621d91e14f
Park mobile-activity-recording + mobile-nearby-sync under docs/ideas
Both are blocked on the mobile-app foundation and on a user base that
actually records activities or needs offline peer sync. With 3 users
and 0 activities on prod today, these are engineering for a
hypothetical population.

Move the artifact sets out of openspec/changes/ (so openspec list
stays clean) and under docs/ideas/ where self-host-overpass already
lives. Each gets a short README documenting:

- current parked status
- revive triggers (when should we look at this again?)
- key constraints not to rediscover (background-GPS privacy review;
  BLE dev-build requirement; QR-only subset as a cheaper path)

Reviving is `git mv docs/ideas/<name> openspec/changes/<name>` and
running /opsx:apply, same pattern as self-host-overpass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 08:23:44 +02:00

1.8 KiB

Why

When bikepacking or hiking in a group, one person may update the route at the last café with WiFi. Once the group is in the middle of nowhere with no signal, the others are stuck with the old route. There's no way to share route updates between nearby devices without internet.

What Changes

  • BLE route sync: Devices discover each other via Bluetooth LE and transfer route data (waypoints + GPX geometry) directly. Uses react-native-ble-plx for cross-platform iOS ↔ Android compatibility.
  • QR waypoint sharing (v1, simpler): Generate a QR code with compressed waypoint coordinates. The receiver scans it and gets the waypoints immediately — full route geometry recomputes when signal returns.
  • Sync protocol: A lightweight protocol over BLE that handles discovery ("who nearby has this route?"), versioning ("is your copy newer than mine?"), and transfer (chunked GPX data).

Capabilities

New Capabilities

  • mobile-nearby-sync: BLE-based route sync between nearby devices, QR waypoint sharing fallback

Non-Goals

  • Real-time collaborative editing over BLE (too complex — this is one-shot sync)
  • Syncing activities or other data (routes only for v1)
  • Mesh networking (direct device-to-device only, no relay through third devices)

Impact

  • Depends on mobile-app change being implemented first
  • New dependency: react-native-ble-plx (requires Expo dev build)
  • BLE background advertising needs careful battery management
  • iOS requires Bluetooth usage description in Info.plist
  • Android requires BLUETOOTH_SCAN, BLUETOOTH_CONNECT, BLUETOOTH_ADVERTISE permissions

Future ideas

  • TXQR (animated QR codes via camera) as an alternative transfer method — ~13KB/s demonstrated, no pairing needed, but requires porting the fountain code protocol to TypeScript