Strava Calendar
Turns a year of Strava workouts into one shareable heatmap image.
Live siteFrontend on GitHubAPI on GitHub
Why
As a road runner who logs everything on Strava, I wanted a picture of a whole year of training that I could post. Strava's calendar view is for paying members only, and its look is fixed. Strava Calendar gives any athlete, free or paid, a GitHub-style heatmap of their workouts, in seven color schemes.
How it works
Decisions
Keep Strava behind the API
The Angular app never calls Strava. After "Connect with Strava", the API exchanges the OAuth code for tokens, stores them, and hands the browser only an opaque user id. Tokens never reach the client, and changes to Strava's API stay in one place.
Store tokens, not people
The database keeps a short-lived access token, a refresh token and the expiry time. Nothing else: no names, no activities. Before each request the API checks the expiry and refreshes the token if it needs to. Activities are fetched, summarized and drawn on demand, then dropped.
Draw on the server
The heatmap is rendered in Python and returned as a PNG, or as base64 to preview every theme at once. That keeps the frontend small and makes the image identical everywhere it's shared.
Filters that match how athletes think
The API filters by sport type (run, ride, swim, hike and more) and by units (metric or imperial). So a runner can share just their runs, in the units they race in.
Screens
What I'd do next
- Add CI (GitHub Actions) with API tests against recorded Strava responses.
- Cache each athlete's yearly summary so repeat renders skip the Strava API and its rate limits.
- Let athletes revoke access from the site, deleting their tokens in one click.