Build Bellingham Tidal Observatory (FastAPI + Vite/React/TS)#1
Merged
Conversation
Replace the starter stub with a full tides dashboard scaffolded to mirror the navigator project's structure (clean FastAPI backend on uv, Vite/React/TS frontend, multi-stage Dockerfile, docker-compose dev stack, CI). Backend (backend/): async noaa_coops wrapper with TTL cache, half-cosine interpolation between real NOAA hi/lo predictions, astral sun/moon, and a /api/bootstrap endpoint serving 6 Bellingham Bay / San Juan stations. Tests cover the tide math, API shape, health, and static SPA serving. Frontend (frontend/): the Grafana/Ganglia-style "Tides Tracker" dashboard from the design handoff — glacier sidebar, KPI strip, station grid (density/sort/ group), focus drilldown with an interactive SVG chart, compare overlay, tweaks panel, and keyboard shortcuts.
frontend/src/lib/ matched the repo .gitignore "lib/" rule, so tweaks.ts was never committed and CI's type-check failed to resolve it. moved to src/tweaks.ts and updated imports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the starter stub (
main.py+ barepyproject.toml) with a complete Bellingham Tidal Observatory — a Grafana/Ganglia-style tide dashboard backed by real NOAA CO-OPS predictions. Structure deliberately mirrors thenavigatorproject: clean FastAPI backend onuv, a Vite/React/TS frontend, a multi-stage Dockerfile, a docker-compose dev stack, and CI.What's included
Backend (
backend/) — FastAPI onuv,BTO_settings prefix, health + CORS + SPA-static fallback.noaa.py— async wrapper over the (sync)noaa_coopspackage viaasyncio.to_thread, with an in-memory TTL cache.tides.py— half-cosine interpolation between real NOAA hi/lo predictions (verified to match official NOAA exactly), plus per-station snapshot (height/rate/trend/day-range/next hi-lo).astro.py— sun/moon facts viaastral.api.py—/api/bootstrapreturns the 6 Bellingham Bay / San Juan stations + extrema + sun/moon in one call.Frontend (
frontend/) — the "Tides Tracker" design from the handoff, recreated in React/TS:/api/bootstrap.Infra — root multi-stage
Dockerfile(build frontend → serve from FastAPI),.dockerignore,docker-compose.yml(hot-reload dev), and.github/workflows/ci.yml(ruff + pytest, eslint + vitest + build, container scan).Reviewer notes
Sean-Michael.devsite (homepage widget +/tidesroute); this repo is the canonical source for the dashboard.main.py,pyproject.toml,uv.lock) were removed; the Python project now lives underbackend/.Test plan
cd backend && uv sync && uv run pytest(backend tests pass)cd frontend && npm ci && npm run build(type-check + build)docker compose up --build→ UI on :5173, API on :8000docker build -t bto . && docker run -p 8000:8000 bto→ app on :8000CI: initial run failed because
frontend/src/lib/tweaks.tsmatched the repo's.gitignorelib/rule and wasn't committed; moved it tofrontend/src/tweaks.ts. All checks now green (backend lint+test, frontend lint+test+build, and the three grype image scans).