feat: build the Cool City public route demo
ci / check (push) Successful in 55s

- add /cool, /cool?vote=1, /cool/stage and /cool/city on the existing Nuxt/Onyx stack
- wire real route/shade metrics and OSM geometry from the route bundle; city-gap data for the city view
- show shade % and direct-sun minutes together; recommend Accessible for Ruth with the 15% ramp trade-off
- add in-memory time/scene/round state and one anonymous vote per session, polled every 2 s
- keep the retail module linked but out of the Cool City story
This commit is contained in:
Noel Sabia committed 2026-11-14 13:49:22 +01:00
1 parent 33063afbdf
commit 2bc52a314d
28 files changed
+8633 -45

No files matched your search

+17
View File
@@ -167,6 +167,9 @@ deployed path are the real API.
| Route | Purpose |
| --- | --- |
| `/cool` | **Cool City public hero.** Ruth card, time, three real route options, vote buttons; `/cool?vote=1` is the minimal audience vote page |
| `/cool/stage` | **Cool City projector.** Ruth card, cool places, data honesty, route board with exact labels, live vote, city view, retail link |
| `/cool/city` | Cooling-gap module: eight ranked catchments, one-line reasons, top block and “What would help” |
| `/` | Landing: the live shift board, peak shift, cost vs flat, coverage and the measured/modelled/assumed chain |
| `/forecast` | 7-day daily forecast, uncertainty band, weather strip |
| `/plan` | **Hero.** Peak decision, weekly shift board, coverage, cost vs flat, settings, hourly detail |
@@ -179,6 +182,20 @@ deployed path are the real API.
The layout targets **390 px** (single column, mobile Onyx nav, day cards) and
**1440 px** (Onyx horizontal nav, two-column plan with tables).
### Cool City demo data and state
- `/cool` reads `public/cool-city/route.json`, normalised from
`cool-city-data/route/shade.json`, `routes.geojson` and `places.json`.
`/cool/city` reads `public/cool-city/city-gap.json`.
- Vote and demo state are in-memory Nitro routes: `GET/POST /api/cool/state`,
`GET/POST /api/cool/vote`, `POST /api/cool/reset`. `round` is
`preselection` or `final`; votes never mix. The stage and phones poll every
2 seconds. No database and no PII.
- Stage labels: `Cool places`, `Data honesty`, `Find routes`, `Shortest`,
`Shaded`, `Accessible`, `Start vote`, `Lock vote`, `City view`,
`Retail module`, `Reset round`. The model recommendation is
**“Accessible for Ruth”**.
## Plan logic
`shared/staffing.ts` is the single implementation of the contract heuristic: