Modern, responsive Strava dashboard built with React, Vite and Tailwind CSS. It shows weekly KPIs, your latest run. Data is read from a JSON file you export from Strava.
- Weekly KPIs: mileage, avg HR, training load change
- Last run: distance, moving time, pace, HR, elevation, energy
- Personal bests: projected times for 1k, 5k, 10k, Half-marathon, 30k, marathon
- Dark mode, smooth animations, responsive layout
npm install
npm run devOpen the local URL printed by Vite. To see metrics, add a public/data/activities.json file (see βGet your dataβ).
Use the Python exporter in python/export_data.py to pull your activities from the official Strava API.
- Create Strava API credentials: https://www.strava.com/settings/api (scopes:
read,activity:read_all) - Put credentials in
python/.env:
STRAVA_CLIENT_ID=...
STRAVA_CLIENT_SECRET=...
STRAVA_REFRESH_TOKEN=...
- Export activities to JSON:
python python/export_data.py --out data/activities.json- Make the JSON available to the app by copying it to
public/data/activities.json. The app fetches/data/activities.json. Supported shapes:
- Object:
{ "exported_at": ISO-8601, "count": N, "activities": [ ... ] } - Array:
[ ... ]also works (noexported_at)
npm run dev: start Vite dev servernpm run build: production build todist/npm run preview: preview the prod buildnpm run lint: run ESLint Note: The βFetch your data!β button calls
Simple Streamlit dashboard to explore your Strava activities with quick charts and KPIs. Data is exported from the official Strava API, then visualized locally.
git clone https://github.com/yourusername/strava-dashboard.git
cd strava-dashboard
python3.12 -m venv .stravadash
source .stravadash/bin/activate
pip install -r requirements.txt
streamlit run streamlit_app.pypython3.12 -m venv .stravadash
source .stravadash/bin/activate # on macOS/LinuxOn Windows: .stravadash\Scripts\activate
pip install -r requirements.txtPython version: the project targets Python 3.12 (see .python-version). Other versions may work but are not tested here.
-
Go to Strava API settings and create an application.
- Use
localhostas Authorization Callback Domain during local development. - Note down your Client ID and Client Secret.
- Use
-
Authorize the application with the proper scopes:
https://www.strava.com/oauth/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2Fexchange_token&approval_prompt=force&scope=read,activity:read_all
-
After login/authorization, copy the
codeparameter from the redirect URL. -
Exchange the code for tokens:
curl -X POST https://www.strava.com/oauth/token \
-d client_id=YOUR_CLIENT_ID \
-d client_secret=YOUR_CLIENT_SECRET \
-d code=AUTH_CODE \
-d grant_type=authorization_codeThis returns an access_token (short lived) and a refresh_token (long lived).
- Add credentials to
.env:
STRAVA_CLIENT_ID=...
STRAVA_CLIENT_SECRET=...
STRAVA_REFRESH_TOKEN=...
Notes:
- The export script will first look for
.envnext toexport_data.py, then fall back to the current working directory. - Ensure your token scopes include
read,activity:read_all.
python python/export_data.py --out ./data/activities.json --per-page 200or as CSV:
python python/export_data.py --out data/activities.csv --per-page 200You can filter by dates:
python python/export_data.py --out data/activities.json --after 2025-01-01 --before 2025-12-31Show all options:
python python/export_data.py -hOutput examples:
- JSON:
{ "exported_at": ..., "count": N, "activities": [...] } - CSV: flattened fields (distance, times, heart rate, etc.)
By default, files are written under data/. Create the folder if needed.
Start Streamlit locally:
streamlit run streamlit_app.pyIn the app sidebar, click βRefresh data from Stravaβ to re-export and reload data/activities.json without leaving the app.
export_data.py: CLI exporter for Strava activities (JSON/CSV)streamlit_app.py: Streamlit dashboard (charts, KPIs, filters)data/: exported datasets.env: Strava credentials (STRAVA_CLIENT_ID,STRAVA_CLIENT_SECRET,STRAVA_REFRESH_TOKEN)requirements.txt: pinned dependencies
- Unauthorized 401: refresh token invalid or missing scopes. Re-run OAuth and update
.env. - No data in app: ensure
data/activities.jsonexists and is valid JSON (or click βRefresh dataβ). - Missing columns error: export as JSON for the app (
.csvis for external analysis). - Rate limits: the exporter paginates; if you hit limits, reduce
--per-pageor try later.
- Keep
pip,setuptools, andwheelup to date for smoother installs. - If Streamlit fails to launch, try:
pip install --upgrade streamlit.

