Skip to content

Groovy App that displays Strava activities and enables the user to merge them into a new one.

License

Notifications You must be signed in to change notification settings

besessener/StravaActivityMerger

Repository files navigation

This is a Spring Boot Groovy App with Angular Frontend that displays Strava activities and enables you to merge activites into a new one.

How it looks

You can login to Strava with OAuth, no additional credentials required.

login

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.

table

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.

merge

It is deployed to Google Cloud and can be accessed over http://activity-merger.ddns.net

Setup

Get Strava API specification

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.

Generate OpenAPI client code

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:

openapi generate edit

And there set the settings as below:

openapi generate edit dialog

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.

Install NodeJS

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.

run it

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 and ng serve --open to open the web UI in your browser

Done.

API description

About

Groovy App that displays Strava activities and enables the user to merge them into a new one.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published