A simple webapp that loads your Strava data, displays it on a map, and let you fill in hexagons with your activities.
Similar to VeloViewer Max Squares, but with two differences:
- Hexagons instead of squares, because hexagons are the Bestagons
- Little hexagons, to encourage walks and runs and exploring local spots
Try it out: hexy.rdrn.me
Rust API with the following bits:
rocket
: web framework, partially chosen for OpenAPI compatibility withokapi
but I've ripped that out anyway. Easy HTML templating and slightly-too-clever db pool.diesel
: db queries to on-disk SQLite. Will probably usesqlx
next time because why not. Like diesel's in-process migrations!geo
withh3o
,polyline
,dbscan
for the fun geo bits!serde
,reqwest
,chrono
,anyhow
for the usual.
Bit of plain HTML, JavaScript and Tailwind for the frontend. I'd like to find a nice setup for using compiled TypeScript for the frontend (React or Svelte) together with a backend-first (single server, lots of HTTP) compiled language approach but I haven't found it yet...
Running on render.com with a local SQLite DB on a persistent disk.
You'll need to create a .env
file with the following:
RUST_LOG=info
FERNET_KEYS='32-bytes-of-base64-encoded,another-one-for-rotation'
ROCKET_DATABASES='{db={url="db.sqlite"}}'
ROCKET_SECRET_KEY=''
REDIRECT_URI='http://localhost:8000/callback'
STRAVA_BASE='https://www.strava.com'
STRAVA_CLIENT_ID=''
STRAVA_CLIENT_SECRET=''
OS_KEY=''
The usual:
cargo fmt
check
clippy
build
test
run
Once running, go to localhost:8000 and follow the prompts.