Skip to content

darkaico/strava-extensions

Repository files navigation

Quality Gate Status

Strava Extensions

App that fetchs information from strava and show in a simple flask application.

Note

I'm using redis to store Strava access token and set an expiration time. Could it be easily change to just store it plain during app run in case you want to test it without it.

Strava API

First of all you need Strava API credentials could be found here.

Once you got it you should set the following environment variables

STRAVA_API_CLIENT_ID=<strava api client id>
STRAVA_API_CLIENT_SECRET=<strava api client secret>
STRAVA_API_REFRESH_TOKEN=<strava api refresh token>
STRAVA_CLUB_ID=<strava club id>
# Optional in case you want to test it locally, otherwise its being updated in docker-compose file
REDIS_URL=redis://localhost:6379

To make things easier to test in local env im using python-dotenv so you could create a new file called .env under strava_extensions folder (there is an .env.example you could us as example).

Start the App

Docker

Start the app by just calling

$ docker-compose up

or using make

$ make up

Local Development

Poetry

Im using poetry as dependency management, make sure you have it installed before following next steps.

  • Install dependencies
poetry install
  • Run Flask Project
poetry run python strava_extensions/flask_server/main.py
  • Run tests
poetry run pytest