Calamity-cycling is a flask application that analyze my cycling activities.
Using the refresh
endpoint, It downloads all my activities from my strava account and store them in MongoDB.
The app use d3.js to draw graphs. Multiple information are available :
- You must create a file named .env into the repository project which contain these variable
CLIENT_ID=client_id_of_your_app_created_in_strava
CLIENT_SECRET=client_secret_app_retrieve_from_strava
READ_AUTHORIZATION_CODE=below_how_to_retrieve_the_read_authorization_code
WRITE_AUTHORIZATION_CODE=below_how_to_retrieve_the_write_authorization_code
Warning .env file must finish with an empty line (\n)
- Retrieve read authorization code
Paste the below link into your browser. Don't forget to replace client_id with the id of your app created in strava. Authenticate and authorize the app with the checked permission.
http://www.strava.com/oauth/authorize?client_id={client_id}&response_type=code&redirect_uri=http://localhost/exchange_token&approval_prompt=force&scope=profile:read_all,activity:read_all You will be redirect to a non working page. Extract the authorization_code from this page url.
- Retrieve write authorization code
Same procedure as read procedure, but use the below link
- Run the below command to start the app
# Suppose that you have docker installed
docker build . -t calamity-cycling-app
docker run --name cycling-app --rm -p 5000:5000 -it calamity-cycling-app
go to http://localhost:5000 on your browser
- you've to started packaging calamity app into docker. Check how to pass CLIENT_ID env variable from docker run. automate the process of getting user credentials in order to automatically create the .env file.
- show segment info when clicking on a graph point
- create a graph for monthly elevation and burned calories
- add a section to show top 10 segments (name, dist, avg grade, number of time you've passed through)
- add the refresh button