# RunCandles — Implementation Prompt (autonomous run) You are implementing **RunCandles** (runcandles.com, tagline “GPX for Traders”) end to end in one uninterrupted session. Do not stop to ask questions — every product decision has already been made and published. If something seems ambiguous, the spec wins; if the spec is silent, choose the simplest option consistent with it and note the choice in the README. ## 1. Read the spec first — all of it, before writing any code - https://says.hermione.online/gpxfortraders-spec/ (index; the directory keeps the old working-title URL on purpose) - https://says.hermione.online/gpxfortraders-spec/01-overview.html - https://says.hermione.online/gpxfortraders-spec/02-ingestion-speed.html - https://says.hermione.online/gpxfortraders-spec/03-chart.html - https://says.hermione.online/gpxfortraders-spec/04-map.html - https://says.hermione.online/gpxfortraders-spec/05-ui.html - https://says.hermione.online/gpxfortraders-spec/06-tech.html - https://says.hermione.online/gpxfortraders-spec/decisions.html Every requirement ID (OV-xx, GX-xx, CH-xx, MP-xx, UI-xx, TS-xx) and every decision D-01…D-30 is binding. The spec has **zero open questions**. ## 2. Repository & delivery (TS-10) - Remote: `git@github.com:Piotr12/runcandles.com.git` (SSH keys are already exchanged in this container) - Work on and push branch **`v1_1`** — create it if it does not exist; do not push to main - Commit in coherent increments with meaningful messages; push the branch as the final step ## 3. Fixed technology choices (do not substitute) - Vite + **vanilla TypeScript**, no UI framework (TS-03) - **TradingView lightweight-charts** for the chart (TS-02) - **Leaflet + OpenStreetMap** tiles, no API keys (MP-03) - **Vitest** for unit tests (TS-06) - Static `dist/` output; no backend; only runtime network traffic is map tiles (TS-01, TS-04) ## 4. The product in one breath One GPX in, trading terminal out: canonical speed curve (±10 s centered distance slope, GX-06) → distance-window candles (100 m … 10 km, CH-02) plotted in km/h, MA(20)/MA(50) overlays, zero-centered elevation-delta volume panel, header stat block with ticker and negative-split change %, and a Leaflet map whose route is segmented per candle window and uniformly coloured by segment average speed, bidirectionally linked to the chart crosshair. Dark terminal theme default, light toggle. Demo run auto-loads. ## 5. Branding & design quality The product is named **RunCandles** — use it in the site title, header/logo text, README and page metadata, with the tagline “GPX for Traders” (OV-10). OV-04 mandates a polished, public-facing result: **use the frontend-design skill** before building the UI. Target: it should look like a real charting terminal that happens to be about running, not like a GPX utility with a chart bolted on. ## 6. Working mode 1. Clone the repo, create branch `v1_1`, scaffold Vite + TS project, install pinned deps. 2. Build the pure data core first — GPX parsing, haversine, canonical speed curve, candle aggregation, MAs, ticker derivation — as framework-free modules **with Vitest tests as you go**, including the worked example from chapter 2 as a fixture (10.0 km/h → 6:00 min/km) and the CH-03 candle-count cases. 3. Generate the synthetic demo GPX per TS-05 (script it; commit the generated .gpx as an asset). 4. Chart panel (candles/line/bar, MAs, volume, crosshair, zoom/pan) per chapter 3. 5. Map panel + bidirectional linking per chapter 4. 6. Header stats, toolbar, themes, layout, mobile stacking per chapter 5. 7. Error handling per TS-07 (bad files fail visibly and gracefully). 8. README per TS-08, referencing the spec URL. 9. Push branch `v1_1`. Keep the data core UI-free and fully tested. ## 7. Definition of done (TS-09) - Demo run renders on load: candles, both MAs, volume, header stats, coloured segmented route, bidirectional linking — all live. - All seven window sizes, three chart types, and both themes switchable at runtime. - A real phone-recorded GPX dropped onto the page behaves correctly, pauses and all. - All Vitest tests green; `npm run build` clean; output is purely static. - Branch `v1_1` pushed to `git@github.com:Piotr12/runcandles.com.git`. Build the whole thing. Do not stop halfway. Done means done.