This is a Spring Boot Groovy App with Angular Frontend that displays Strava activities and enables you to merge activites into a new one.
You can login to Strava with OAuth, no additional credentials required.
As soon as you are authorized, a table view will open, showing your most recent activities. Clicking on a row will show details and a map.
You can select multiple rows/activities with the checkboxes at the left side. Whenever you have 2 or more activities selected, the merge
button will become active. Clicking on merge
might take some seconds (~8s) before the table is reloaded and shows the new activity. Merged activities get a noticeable pink border.
It is deployed to Google Cloud and can be accessed over http://activity-merger.ddns.net
To get the spec, simply run the Gradle task downloadStravaApi
. You can do this either directly in IntelliJ or with ./gradlew downloadStravaApi
on command line.
Unfortunately the Groovy support is really poor for Swagger/OpenAPI, so it’s required to generate Java code. But since it is generated code and shall not be touched, it doesn’t really matter.
To generate use the IntelliJ plugin. Simply open build/generated/strava-api-definition/api.json
and in the Editor click on the edit button:
And there set the settings as below:
It is important to choose the correct path (according to gradle settings it is src-api
) and to set the correct generator version -→ The generator will be downloaded automatically.
OR! just run Gradle task build
to get everything properly generated.
In order to run the Angular frontend, you need to install NodeJS from https://nodejs.org/en/download/ and run
npm install
npm install @angular/cdk
npm install -g karma-cli
in the repository.
For local purpose no special deployment is required.
But you need a secret file (src/main/resources/.secrets
) with content which is not allowed to be shared. Get both the client id and secret at https://www.strava.com/settings/api by creating your own application. The Google API key must be generated at https://console.cloud.google.com/google/maps-apis/overview. Then enter all 3 values like this:
{
"client_id": "<your strava client id>",
"client_secret": "<your strava client secret>",
"google_api_key": "<your Google static maps api key>"
}
Just run:
-
./gradlew bootRun
to start the backend services -
cd web-app
andng serve --open
to open the web UI in your browser
Done.