Skip to content

robiningelbrecht/strava-statistics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Strava Statistics

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


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

ShowcaseDisclaimerWikiPrerequisitesInstallationImport and build statisticsLocales and translations

📸 Showcase

showcase.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

⚠️ 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 strava-statistics
> cd strava-statistics

# 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

# 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:8081/
# 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 or nl_BE
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='[]'
# Your birthday. Needed to calculate heart rate zones.
ATHLETE_BIRTHDAY=YYYY-MM-DD
# 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='{
    "YYYY-MM-DD": 74.6,
    "YYYY-MM-DD": 70.3
}'
# History of FTP. Needed to calculate activity stress level.
# Check https://github.com/robiningelbrecht/strava-statistics/wiki for more info.
FTP_VALUES='{
    "YYYY-MM-DD": 198,
    "YYYY-MM-DD": 220
}'
# 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=''
# An array of activity ids to skip during import. 
# This allows you to skip specific activities during import.
ACTIVITIES_TO_SKIP_DURING_IMPORT='[]'

# 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

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.