clubmirror v0.1.2: a static website generator for Strava club events

My local bike shop posts its group rides in a Strava club, but you need a Strava account to see them. So I wrote a small tool that publishes those events as a static page that they could link. It sat in a private repository for far too long because I kept thinking “it’s not ready yet”. But it’s public now, as clubmirror.

Actually it’s part of a process where I try to publish projects that were sitting in private repositories for far too long because I thought that they were not ready yet. This is the first one, but you can expect more of them to come.

What it does

clubmirror is a Rust command-line tool meant to run from cron/periodic. Each run it:

  • fetches the club’s group events from the Strava API,
  • renders them with Tera templates into plain static files,
  • writes an .ics calendar people can subscribe to,
  • downloads the GPX/TCX files of the routes attached to the events.

Then it exits, and that’s it. So there is no daemon, no database, no server-side code. It handles any number of clubs, each with its own templates, timezone and time window.

Try it without a Strava account

The repository includes a sample of fake events to play with:

git clone https://github.com/gawen947/clubmirror
cd clubmirror
chmod 600 examples/config.toml
cargo run -- -c examples/config.toml -v
python3 -m http.server -d public 8000   # open http://localhost:8000

Edit templates/default/, run again, and see the result. For a real club you need a Strava API application and a refresh token (cf README).

clubmirror is unofficial and not affiliated with Strava. Strava’s API terms restrict how its data can be displayed, so check them for your use.

What’s next?

  • Scripted per-club quirks with Rhai, instead of hardcoded ones
  • Proper debug options
  • Event filtering, for example keeping members-only events out of the calendar
  • Configurable event duration in the calendar
  • Processing clubs in parallel