How andysq2023/cycling-coach works
Cycling Coach is a single-file browser coaching app with local or hosted service endpoints. The main workflow combines athlete data and training feedback in the app’s coach conversation, produces and adapts a schedule, and persists coaching state. The README documents additional workout, route-reconciliation and strength features implemented in the same front end. Source excerpts are partial, so uncertain internal wiring is omitted; the documented integrations and API responsibilities are retained.
Main entry points: cycling-coach.html Coach interface · server.js Local data proxy · _auth.js API authentication · chat.js Coach chat API
Components 27
Coaching app
- Coach interface
app/cycling-coach.html - Plan and adaptation
app/cycling-coach.html - Session feedback
app/cycling-coach.html - Strength workouts
app/cycling-coach.html - Route planning UI
app/cycling-coach.html
API services
- Coach chat API
api/chat.js - WHOOP API
api/whoop.js - Strava API
api/strava.js - Route planner API
api/route.js - State sync API
api/state.js - Saved routes API
api/routes.js - Weather API
api/weather.js - Intervals API
api/intervals.js - API authentication
api/_auth.js
Data integrations
- Local data proxy
proxy/server.js - Strava shaping
shared/strava-core.js - Forecast shaping
shared/weather-core.js - Training metrics
shared/intervals-core.js
Persistence
- Vercel KV
- State access
api/_state.js
Other components
- Athlete
- Anthropic
- WHOOP
- Strava
- GraphHopper
- Open-Meteo
- intervals.icu
Connections 32
- Athlete → Coach interface: uses
- Coach interface → Coach chat API: sends prompts
- Coach chat API → Anthropic: requests replies
- Coach interface → WHOOP API: fetches recovery
- WHOOP API → WHOOP: refreshes and reads
- Coach interface → Strava API: fetches rides
- Strava API → Strava shaping: shapes activities
- Strava shaping → Strava: fetches ride data
- Coach interface → Plan and adaptation: generates and adapts
- Coach interface → Session feedback: logs sessions
- Session feedback → Plan and adaptation: triggers adaptation
- Coach interface → Strength workouts: manages workouts
- Coach interface → Route planning UI: plans and reconciles
- Route planning UI → Route planner API: requests routes
- Route planner API → GraphHopper: requests directions
- Route planner API → Vercel KV: reads and writes cache
- Coach interface → State sync API: syncs coach state
- State sync API → API authentication: checks access
- Saved routes API → API authentication: checks access
- Coach chat API → API authentication: checks access
- WHOOP API → API authentication: checks access
- State sync API → State access: reads and writes
- State access → Vercel KV: stores state
- Saved routes API → Vercel KV: reads and writes routes
- Local data proxy → Strava shaping: shapes activities
- Local data proxy → Forecast shaping: builds forecast
- Local data proxy → Training metrics: builds training summary
- Local data proxy → Strava: refreshes and fetches
- Forecast shaping → Open-Meteo: fetches forecast
- Training metrics → intervals.icu: fetches metrics
- Coach interface → Weather API: requests forecast
- Coach interface → Intervals API: requests metrics