How xander-coetzee/whooshcoach works
WhooshCoach is a self-hosted cycling-coaching app: athletes use its calendar and settings UI, the API stores ride and training data, and the coach combines deterministic load/readiness calculations with Gemini to generate and adapt plans. The calendar also tracks races, rest days, and protected manual events; background sync imports completed rides from MyWhoosh and Zwift. The README documents these capabilities, while source excerpts confirm selected call paths. Some API, scheduler-startup, and external-service details are not fully shown, so uncertain connections are omitted.
Main entry points: main.py HTTP API · gemini_coach.py AI plan generation · database.py SQLite training store · scheduler.py Periodic sync scheduler
Components 16
Athlete experience
- Web calendar UI
app/static/app.js
Application API
- HTTP API
app/main.py - Calendar and race events
app/main.py
Coaching engine
- Athlete context
app/context_engine.py - Load and readiness
app/physiology.py - AI plan generation
app/gemini_coach.py - Post-ride adaptation
app/gemini_coach.py
Ride synchronization
- Periodic sync scheduler
app/scheduler.py - MyWhoosh ride sync
app/mywhoosh_service.py - Zwift ride sync
app/zwift_service.py
Training data
- Workout catalog
app/database.py - SQLite training store
app/database.py
Other components
- Athlete
- MyWhoosh cloud
- Zwift cloud
- Gemini model
Connections 26
- Athlete → Web calendar UI: uses
README.md - Web calendar UI → HTTP API: requests
app/static/app.js - HTTP API → Calendar and race events: routes events
app/main.py - HTTP API → SQLite training store: reads and writes
app/main.py - HTTP API → AI plan generation: requests plans
app/main.py - HTTP API → Athlete context: uses
app/main.py - HTTP API → Load and readiness: uses
app/main.py - HTTP API → Periodic sync scheduler: starts
app/main.py - Athlete context → SQLite training store: reads
app/context_engine.py - Athlete context → Load and readiness: calculates metrics
app/context_engine.py - AI plan generation → Athlete context: builds context
app/gemini_coach.py - AI plan generation → Load and readiness: uses metrics
app/gemini_coach.py - AI plan generation → SQLite training store: reads and writes
app/gemini_coach.py - AI plan generation → Workout catalog: resolves workouts
app/gemini_coach.py - AI plan generation → Gemini model: requests plan
- Post-ride adaptation → Gemini model: requests adjustment
- Periodic sync scheduler → SQLite training store: loads athletes
app/scheduler.py - Periodic sync scheduler → MyWhoosh ride sync: dispatches sync
app/scheduler.py - Periodic sync scheduler → Zwift ride sync: dispatches sync
app/scheduler.py - MyWhoosh ride sync → MyWhoosh cloud: fetches activities
app/mywhoosh_service.py - MyWhoosh ride sync → SQLite training store: stores rides
app/mywhoosh_service.py - Zwift ride sync → Zwift cloud: fetches activities
app/zwift_service.py - Zwift ride sync → SQLite training store: stores rides
app/zwift_service.py - MyWhoosh ride sync → Post-ride adaptation: requests adaptation
app/mywhoosh_service.py - Zwift ride sync → Post-ride adaptation: requests adaptation
app/zwift_service.py - Calendar and race events → SQLite training store: stores events
app/main.py