Skip to content
/ hexy Public

Load your Strava data on a map, fill in hexagons with your activities

License

Notifications You must be signed in to change notification settings

carderne/hexy

Repository files navigation

hexy

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:

  1. Hexagons instead of squares, because hexagons are the Bestagons
  2. Little hexagons, to encourage walks and runs and exploring local spots

Try it out: hexy.rdrn.me

Screenshot 2024-04-13 at 21 24 17

Stack

Rust API with the following bits:

  • rocket: web framework, partially chosen for OpenAPI compatibility with okapi 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 use sqlx next time because why not. Like diesel's in-process migrations!
  • geo with h3o, 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.

Development

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.

About

Load your Strava data on a map, fill in hexagons with your activities

Resources

License

Stars

Watchers

Forks