Epic: #198 (E1)
Wire the running app to read from Postgres instead of the in-memory seed + live NDBC. Depends on #210 (ingestion populating observations).
Scope
cmd/api: build a pgx pool + store.New from env.GetString("DATABASE_URL"); fail fast if unset/unreachable (the app is DB-backed).
SpotService (internal/http/spot.go): read spots via store.ListSpots/GetSpot and latest conditions via store.LatestObservation — instead of spot.All()/spot.ByID() + live noaa.Realtime.
- Map
store.Observation → proto Conditions (mirroring the current toProtoConditions).
Acceptance
Split from #210.
Epic: #198 (E1)
Wire the running app to read from Postgres instead of the in-memory seed + live NDBC. Depends on #210 (ingestion populating
observations).Scope
cmd/api: build a pgx pool +store.Newfromenv.GetString("DATABASE_URL"); fail fast if unset/unreachable (the app is DB-backed).SpotService(internal/http/spot.go): read spots viastore.ListSpots/GetSpotand latest conditions viastore.LatestObservation— instead ofspot.All()/spot.ByID()+ livenoaa.Realtime.store.Observation→ protoConditions(mirroring the currenttoProtoConditions).Acceptance
cmd/apirequires DATABASE_URL; refuses to start without a reachable DBGetSpot/ListSpotsreturn DB-backed data; latest observation comes fromobservationsSplit from #210.