From f71162d177dd3b45a9cd5269bdc1fae2ed5dfb75 Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Wed, 13 May 2026 22:57:17 +0200 Subject: [PATCH] CLAUDE.md: document implemented features and remaining work --- CLAUDE.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..3267b2b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,54 @@ +# BincioPlanner — CLAUDE.md + +Route planning tool for bincio members. Intentionally separate from `bincio_activity` — different product scope, different lifecycle, no shared codebase. + +## Stack + +- **Vite + Svelte 5** (no Astro — single page, no SSR needed) +- **MapLibre GL JS** for the map +- **Brouter public API** for routing (`https://brouter.de/brouter`) +- Pure static output — no backend, no Python + +## Dev & deploy + +```bash +# local dev (requires bincio_activity running on localhost:4321) +npm run dev + +# deploy to planner.bincio.org +bash deploy.sh +``` + +`.env.local` sets `VITE_ACTIVITY_URL=http://localhost:4321` for dev. +`deploy.sh` overrides it with `https://activity.bincio.org` for production. + +## Auth + +On load, fetches `$VITE_ACTIVITY_URL/api/me` with `credentials: 'include'`. +The bincio session cookie is scoped to `.bincio.org` so it works across subdomains. +Non-authed users are redirected to the bincio login page. + +The bincio_activity server must allow CORS from `planner.bincio.org` — this is handled by the regex in `bincio/serve/server.py`. + +## What's implemented + +- [x] Click map to place numbered draggable waypoints +- [x] Route computed via Brouter, drawn on map (debounced 400ms) +- [x] Drag waypoint to move — re-routes correctly +- [x] Profile selector: Road / Gravel / MTB / Hiking +- [x] "Close loop" button (duplicates first waypoint as last) +- [x] "Clear all" button +- [x] Route stats: distance + elevation gain +- [x] GPX export (generated from Brouter GeoJSON response) +- [x] Elevation chart below map (SVG, responsive) +- [x] Race-calendar palette (Giro/Tour/Vuelta/default), mirrors bincio_activity +- [x] Auth gate with redirect to bincio login +- [x] Deployed to `https://planner.bincio.org` with HTTPS + +## What's missing (from original plan) + +- [ ] **Map tile switcher** — toggle between OSM and OpenCycleMap (Thunderforest, requires free API key). OpenCycleMap is significantly better for route planning. +- [ ] **Drag-to-modify route polyline** — click and drag a point on the route line to insert a new waypoint. Deferred: requires hit-testing which segment was dragged, then inserting a waypoint at the right index. Doable but fiddly. +- [ ] **Heatmap overlay** — nice-to-have. Our own data is too sparse (~20 users). Public options: Strava global heatmap (legally gray), Waymarked Trails (clean, OSM-based). +- [ ] **Palette flash** — the race-calendar palette runs in `onMount`, so there's a brief flash from the default CSS vars to the correct palette. In bincio_activity this is avoided by an inline `