Skip to content

robiningelbrecht/strava-statistics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Statistics for Strava

CI Publish Docker image License Docker Image Size Docker pulls Docker version


Statistics for Strava is a self-hosted web app designed to provide you with better stats.

ShowcaseDisclaimerWikiPrerequisitesInstallationImport and build statisticsLocales and translations

Buy Me A Coffee

📸 Showcase

Note

This app is in no way affiliated with or part of the official Strava software suite.

cursorful-video-1739104506503.mp4

Key Features

  • Dashboard with various stats and charts
  • Detailed list of all your activities
  • Monthly stats with calendar view
  • Gear stats
  • Eddington for biking and running activities
  • Detailed list of your segments and corresponding efforts
  • Heatmap
  • History of completed Strava challenges
  • History of activity photos
  • User badge

⚠️ Disclaimer

  • 🛠️ Under active development: Expect frequent updates, bugs, and breaking changes.
  • 📦 Backup before updates: Always backup your Docker volumes before upgrading.
  • 🔄 Stay up-to-date: Make sure you're running the latest version for the best experience.
  • 🤓 Check the release notes: Always check the release notes to verify if there are any breaking changes.

📚 Wiki

Read the wiki before opening new issues. The question you have might be answered over there.

🪄 Prerequisites

You'll need a Strava client ID, Strava client Secret and a refresh token

  • Navigate to your Strava API settings page. Copy the client ID and client secret
  • Next you need to obtain a Strava API refresh token.

🛠️ Installation

Note

To run this application, you'll need Docker with docker-compose.

Start off by showing some ❤️ and give this repo a star. Then from your command line:

# Create a new directory
> mkdir statistics-for-strava
> cd statistics-for-strava

# Create docker-compose.yml and copy the example contents into it
> touch docker-compose.yml
> nano docker-compose.yml

# Create .env and copy the example contents into it. Configure as you like
> touch .env
> nano .env

docker-compose.yml

services:
  app:
    image: robiningelbrecht/strava-statistics:latest
    volumes:
      - ./build:/var/www/build
      - ./storage/database:/var/www/storage/database
      - ./storage/files:/var/www/storage/files
    env_file: ./.env
    ports:
      - 8080:8080

.env

Important

Every time you change the .env file, you need to restart your container for the changes to take effect.

# ⚠ ️Every time you change the .env file, you need to restart your container for the changes to take effect.

# The URL on which the app will be hosted. This URL will be used in the manifest file. 
# This will allow you to install the web app as a native app on your device.
MANIFEST_APP_URL=http://localhost:8080/
# The client id of your Strava app.
STRAVA_CLIENT_ID=YOUR_CLIENT_ID
# The client secret of your Strava app.
STRAVA_CLIENT_SECRET=YOUR_CLIENT_SECRET
# The refresh of your Strava app.
STRAVA_REFRESH_TOKEN=YOUR_REFRESH_TOKEN
# Strava API has rate limits (https://github.com/robiningelbrecht/strava-statistics/wiki),
# to make sure we don't hit the rate limit, we want to cap the number of new activities processed
# per import. Considering there's a 1000 request per day limit and importing one new activity can
# take up to 3 API calls, 250 should be a safe number.
NUMBER_OF_NEW_ACTIVITIES_TO_PROCESS_PER_IMPORT=250
# The schedule to periodically run the import and HTML builds. Leave empty to disable periodic imports.
# The default schedule runs once a day at 04:05. If you do not know what cron expressions are, please leave this unchanged
# Make sure you don't run the imports too much to avoid hitting the Strava API rate limit. Once a day should be enough.
IMPORT_AND_BUILD_SCHEDULE="5 4 * * *"
# Set the timezone used for the schedule
# Valid timezones can found under TZ Identifier column here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=Etc/GMT

# Allowed options: en_US, fr_FR, nl_BE, de_DE, pt_PT or zh_CN
LOCALE=en_US
# Allowed options: metric or imperial
UNIT_SYSTEM=metric
# Time format to use when rendering the app
# Allowed formats: 24 or 12 (includes AM and PM)
TIME_FORMAT=24
# Date format to use when rendering the app
# Allowed formats: DAY-MONTH-YEAR or MONTH-DAY-YEAR
DATE_FORMAT=DAY-MONTH-YEAR
# Sport types to import. Leave empty to import all sport types
# With this list you can also decide the order the sport types will be rendered in.
# A full list of allowed options is available on https://github.com/robiningelbrecht/strava-statistics/wiki/Supported-sport-types/
SPORT_TYPES_TO_IMPORT='[]'
# Activity visibilities to import. Leave empty to import all visibilities
# This list can be combined with SPORT_TYPES_TO_IMPORT.
# Allowed values: ACTIVITY_VISIBILITIES_TO_IMPORT='["everyone", "followers_only", "only_me"]', 
ACTIVITY_VISIBILITIES_TO_IMPORT='[]'
# Optional, an array of activity ids to skip during import. 
# This allows you to skip specific activities during import.
# ACTIVITIES_TO_SKIP_DURING_IMPORT='["123456789", "987654321"]'
ACTIVITIES_TO_SKIP_DURING_IMPORT='[]'
# Your birthday. Needed to calculate heart rate zones.
ATHLETE_BIRTHDAY=YYYY-MM-DD
# Optional, history of weight (in kg or pounds, depending on UNIT_SYSTEM). Needed to calculate relative w/kg.
# Check https://github.com/robiningelbrecht/strava-statistics/wiki for more info.
#ATHLETE_WEIGHTS='{
#    "2024-10-03": 74.6,
#    "2025-01-10": 70.3
#}'
ATHLETE_WEIGHTS='[]'
# Optional, history of FTP. Needed to calculate activity stress level.
# Check https://github.com/robiningelbrecht/strava-statistics/wiki for more info. Example:
# FTP_VALUES='{
#    "2024-10-03": 198,
#    "2025-01-10": 220
#}'
FTP_VALUES='[]'
# Optional, a link to your profile picture. Will be used to display in the nav bar and link to your Strava profile.
# Leave empty to disable this feature.
PROFILE_PICTURE_URL=''
# Optional, your Zwift level (1 - 100). Will be used to render your Zwift badge. Leave empty to disable this feature
ZWIFT_LEVEL=
# Optional, your Zwift racing score (0 - 1000). Will be used to add to your Zwift badge if ZWIFT_LEVEL is filled out.
ZWIFT_RACING_SCORE=
# Optional, full URL with ntfy topic included. This topic will be used to notify you when a new HTML build has run.
# Leave empty to disable notifications.
NTFY_URL=''

# The UID and GID to create/own files managed by strava-statistics
# May only be necessary on Linux hosts, see File Permissions in Wiki
#PUID=
#PGID=

Importing challenges and trophies

Important

Only visible challenges on your public profile can be imported. Please make sure that your profile is public, otherwise the app won't be able to import them

Importing complete history

Strava does not allow to fetch a complete history of your completed challenges and trophies. There's a little workaround if you'd still like to import these:

⚡️Import and build statistics

docker compose exec app bin/console app:strava:import-data
docker compose exec app bin/console app:strava:build-files

🗺️ Locales and translations

Currently, the app is translated to:

If you want to see a new locale added, please open a new issue. Only do this if you are willing to help on the actual translation 🙃.

💡 Feature request?

For any feedback, help or feature requests, please open a new issue. Before you do, please read the wiki. The question you have might be answered over there.