Elevate
A sport app to "Elevate" your training experience and goals! Track your fitness and progressions over time. Analyse deeper your activities. And more...
✨ A sport app to "Elevate" your training experience and goals! Track your fitness and progressions over time. Analyse deeper your activities. And more... The project is written primarily in TypeScript, distributed under the Mozilla Public License 2.0 license, first published in 2014. It has gained significant community traction with 1,447 stars and 192 forks on GitHub. Key topics include: angular, chrome, cycling, electron, running.
Screenshots And Features
<p align="center"> <img src="./.screenshots/fitness-chart.png" alt="fitness-chart" /> <br> <em>Track your long-term fitness trend and performance improvements visually.</em> </p> <p align="center"> <img src="./.screenshots/activities.png" alt="activities" /> <br> <em>Browse and filter your recorded rides with summary statistics for each activity.</em> </p> <p align="center"> <img src="./.screenshots/activity-main.png" alt="activity-main" /> <br> <em>Review in-depth ride details including map and core metrics for every session.</em> </p> <p align="center"> <img src="./.screenshots/activity-stats.png" alt="activity-stats" /> <br> <em>View essential ride stats including averages and highlight metrics for each activity.</em> </p> <p align="center"> <img src="./.screenshots/activity-peaks.png" alt="activity-peaks" /> <br> <em>See peak values for power, heart rate, speed, and cadence across your ride.</em> </p> <p align="center"> <img src="./.screenshots/activity-zones.png" alt="activity-zones" /> <br> <em>Explore how much time was spent in various heart rate, power, and cadence zones during a ride.</em> </p> <p align="center"> <img src="./.screenshots/activity-splits.png" alt="activity-splits" /> <br> <em>Analyze best splits and key segment statistics like fastest speeds and highest cadence.</em> </p> <p align="center"> <img src="./.screenshots/year-progress-ytd.png" alt="year-progress-ytd" /> <br> <em>Monitor your yearly progression with cumulative activity and training volume charts.</em> </p> <p align="center"> <img src="./.screenshots/year-progress-rolling-volume.png" alt="year-progress-rolling-volume" /> <br> <em>Visualize rolling training volume and track period-over-period improvements.</em> </p> <p align="center"> <img src="./.screenshots/athlete-settings.png" alt="athlete-settings" /> <br> <em>Adjust personal data, physical metrics, and measurement preferences over time.</em> </p> <p align="center"> <img src="./.screenshots/zones-settings-hr.png" alt="zones-settings-hr" /> <br> <em>Customize your training zones for heart rate, power, and cadence.</em> </p> <p align="center"> <img src="./.screenshots/connectors.png" alt="connectors" /> <br> <em>Manage integrations with external services and sync activities easily.</em> </p>Install
Desktop App
Download & Install
- For Windows
- For macOS
- For Linux: not shipped yet
Build from sources
Go to chapter Environment setup.
Web extension
Download for Chrome, Chromium, Edge (from 2020), Brave, Opera, Vivaldi, Yandex, ...
Go to Chrome Web Store
From the sources
Go to chapter Environment setup.
Star History
<p align="center"> <img src="https://api.star-history.com/svg?repos=thomaschampagne/elevate&type=Date)](https://www.star-history.com/#thomaschampagne/elevate&Date" alt="Star History" /> </p>Development
This section covers the environment setup to develop and build both desktop app and web extension.
Global solution structure
The solution is cut in 3 folders/projects: the appcore, the desktop & webextension
App-core project
Contains the Elevate App shared and loaded by both desktop and webextensionprojects. Appcore contains core features like fitness trend, year progressions, athlete settings...
The Appcore main technology stack is:
- Typescript as programming language.
- Angular as frontend (build with @angular/cli).
- Angular Material for material designed components.
- Metrics Graphics, Plotly & D3 for charting.
- LokiJS as in-memory NoSQL database persisted in IndexedDB.
- Jest as Javascript test runner (instead of "stock" karma one).
Desktop project
Holds the container behaviour to provide a cross-platform desktop app under Windows, Linux & MacOS. It contains desktop specific features like connectors synchronization (to fetch athlete activities from external).
The Desktop main technology stack is:
- Typescript as programming language.
- Jest as Javascript test runner.
- Electron as cross-platform desktop container.
- Electron-builder to build, sign and publish installers per platform. Also handle app updates process (via
electron-updater). - Rollup.js to load & bundle modules.
- Vue.js for splash-screen update window.
Web-extension project
Contains the web extension behaviour that acts directly on strava.com website. This includes extended stats on activities & segments efforts, best splits, etc...
Environments setup
Install requirements
You will need to install NodeJS (v15+) to build both desktop and chrome web extension.
Clone the git-flow based project
bashgit clone https://github.com/thomaschampagne/elevate.git
or
bashgit clone git@github.com:thomaschampagne/elevate.git
The new mono-repo including the desktop app and the web extension is on develop-new branch at the moment. So checkout/track this branch to build the desktop app:
bashcd ./elevate git checkout --track origin/develop-new
Then install npm dependencies:
bashnpm install
Run solution tests (appcore + desktop + webextension):
bashnpm test
(Should be executed with success for any pull request submission).
Desktop development environment
All commands displayed in this section will be executed in ./desktop/ folder. So:
bashcd ./desktop/
- Run in development:
bashnpm start
This npm task will create a
./desktop/distoutput folder and re-compile bothappcoreanddesktopprojects on any code changes
To open the desktop app, open another terminal, then run:
bashnpm run launch:dev:app
- Run unit tests:
bashnpm test
- Generate production installers and publish them per platforms:
First switch to desktop directory with cd desktop/
-
Build
Windowsx64.exe:bashnpm run build:publish:windows -
Build
Linuxx64.deb:bashnpm run build:publish:linux -
Build
MacOSx64.dmg:bashnpm run build:publish:macos
Output installers will be located in
./desktop/package/
The build targets are defined in./desktop/package.json(buildkey section). See https://www.electron.build for more info.
-
(Optional) To sign the production installers read the how to sign appendix
-
(Optional) To publish the production installers on github read the how to publish on github appendix
-
Clean outputs:
bashnpm run clean
Web extension development environment
To develop the web extension, you need a Chrome based browser such as Chrome, Chromium, Edge (from 2020), Brave, Opera, Vivaldi, Yandex, ...
All commands displayed in this section will be executed in ./webextension/ folder. So:
bashcd ./webextension/
- Run in development:
bashnpm start
This npm task will create a
./webextension/distoutput folder and re-compile bothappcoreandwebextensionprojects on any code changes
-
To load the web extension into your chrome based browser:
- Open new tab and type
chrome://extensions, then enter. - Tick
Developer Modecheckbox. - Click
Load Unpacked Extensionbutton, then choose./webextension/distdirectory (this is where you have themanifest.jsonfile) - Make sure to disable other instances of elevate. You can re-enable them back from same tab.
- Open strava.com OR click on the Elevate icon in the browser toolbar.
- Open new tab and type
-
Run unit tests
bashnpm test
- Production package
You can package the extension with the following command
bashnpm run package
Output release will be located in
./webextension/package/
- Clean outputs:
bashnpm run clean
Build with docker
Desktop app
@TODO
Web extension
Create docker your image from Dockerfile
bashdocker build . -t elevate-chrome-builder
Run a docker production build through a container. Replace /path/to/your/directory/ with a folder on your host to fetch the packaged build when done.
bashdocker run --rm --name elevate-chrome-build -v /path/to/your/directory/:/package elevate-chrome-builder
Appendix
Add a new desktop migration for a next release
Register your new migration in below file
bash./appcore/src/app/desktop/migration/desktop-registered-migrations.ts
Tip: to emulate a version upgrade, you may downgrade the version property inside ipc.storage.json file (user app data folder)
Sign application
Self-sign with OpenSSL for windows build
- Create & edit a
code_sign.cnfopenssl config:
bash[req] distinguished_name = req_distinguished_name x509_extensions = v3_req prompt = no [req_distinguished_name] countryName = FR stateOrProvinceName = Rhone Alpes localityName = Grenoble organizationName = Elevate commonName = Elevate Sports App emailAddress = you@email.com [v3_req] basicConstraints = CA:FALSE keyUsage = critical,digitalSignature extendedKeyUsage = critical,codeSigning
- Generate private key and certificate with a
passphrase
bashopenssl req -x509 -newkey rsa:4096 -sha256 -keyout code_sign.key -out code_sign.crt -days 3650 -config code_sign.cnf
- Create
.pxffile from the private key and certificate previously generated..pxffile will be used to sign app under windows.
bashopenssl pkcs12 -export -legacy -name "elevate-sports-app" -out code_sign.pfx -inkey code_sign.key -in code_sign.crt
- Convert
.pxffile tobase64
bashbase64 code_sign.pfx -w 0
- Create/edit
electron-builder.envfile under./desktop/folder, and add following keys:
bashCSC_LINK= CSC_KEY_PASSWORD=
-
Assign the
base64previously generated to the keyCSC_LINK -
Assign the
passphrasepreviously used to the keyCSC_KEY_PASSWORD -
Then run packaging for windows:
bashnpm run package:windows
Publish to github releases
-
Generate a github personal access token at https://github.com/settings/tokens/new
-
Tick
write:packagesscope. Therepoandread:packagesscopes should be automatically ticked too. Leave them ticked. -
Enter a
Notefor your token, then clickGenerate token. Keep this token safe. If lost you will have to re-generate one. -
Create/edit
electron-builder.envfile under./desktop/folder, and add following key:
bashGH_TOKEN=
-
Assign the generated token to the key
GH_TOKEN. -
Open
./desktop/package.jsonfile and go to the keybuild.publish. -
Edit the
ownerandrepovariables to match with your target github repository.
Note: To publish a new version on github, a github draft release has to exist on the remote target repo.
The github draft release value should match the version value of ./desktop/package.json file.
New version must be compliant with semver convention and higher than previous version if exists.
You can use this semver compare tool that your new version is higher than your previous one.
-
Open https://github.com/your_owner/your_repo/releases and click
Draft a new release. -
Enter the semver version to draft and click
Save draft.
Note: You may already pushed a git tag matching your version. If not, the git tag will be created on publish.
- Run packaging to publish installer:
bashnpm run publish:win
or
bashnpm run publish:mac
-
Open https://github.com/your_owner/your_repo/releases/edit/your_version: Some files should have been uploaded on the github draft release.
-
You can update the uploaded files draft with a new packaging process. Once ready, click
Publish release: users will receive the update.
Use custom browser for unit-testing (web-extension only)
Create a browsers.karma.conf.js file in webextension folder.
To run unit test in a headless chromium instead of chrome, inject below javascript code:
javascriptmodule.exports = { browsers: [ "HeadlessChrome" ], customLaunchers: { HeadlessChrome: { base: "Chromium", flags: [ "--no-sandbox", // See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md "--headless", "--disable-gpu", // Without a remote debugging port, Google Chrome exits immediately. " --remote-debugging-port=9222" ] } } };
Desktop: Debug the calculated watts against real power
This works in development build only
- Create a new local storage key named
DEBUG_EST_VS_REAL_WATTSand set it totrue - Reload application and go to activities performed with a real power meter (cycling or running)
Contributors
Showing top 12 contributors by commit count.
