Phase 5c: GPS Nearby Locations (Overpass API)

phase-mcd-tracker-5c-gps-nearby Phase

phase
Goal: Auto-detect nearest McDonald's via GPS coordinates + OpenStreetMap Overpass API. The location picker has a backend.
Owner: Dev agent
Repo: forgejo_admin/mcd-tracker-api
Depends on: Phase 5 (COMPLETED)

Scope

Implements arch-dataflow-mcd-tracker#flow-5-auto-detect-location. Uses the Overpass API (OpenStreetMap) to find McDonald's near the user's GPS coordinates. Free, no API key, well-mapped for US chain restaurants.
  • Add GET /locations/nearby?lat=39.74&lng=-104.99&radius=5000 endpoint:
  • Add src/mcd_tracker_api/services/overpass.py — Overpass API client (httpx)
  • Add distance calculation utility (Haversine formula for lat/lng distance)
  • Update Location model: ensure latitude/longitude are required for new locations (nullable for legacy)
  • Integration tests with mocked Overpass responses (don't hit real API in CI)

  • pending
  • phase-mcd-tracker-5-core-api — parent phase
  • plan-mcd-tracker — parent plan
  • arch-dataflow-mcd-tracker#flow-5-auto-detect-location — GPS flow