Workout tracking website and optional companion to the Open Workout mobile app. This is very much a work-in-progress and is being done as a spare-time project, so set your expectations appropriately.
Why develop a workout tracker when there are so many closed-source options available?
- I needed a companion website to the mobile app of the same name that I developed. I needed this to make the live tracking feature possible.
- Other workout trackers do not support strength-based exercises, such as pull-ups and push-ups (press-ups).
- I think users should have control over their own data and this is only possible with an open source application.
- There are some analytical ideas that I have which none of the major activity tracking websites perform.
- I want to do some experiments with automatically generating workout plans. This will serve as the platform for this idea.
- Education. For the experience in performing full-stack software development: dealing with website deployment and scalability, and security issues.
- Enables the live tracking feature of the Open Workout mobile app.
- Supports strength (lifting) activities as well as distance (aerobic) activities.
- Support for strength-based activities (this is partially implemented).
- Import from other services.
- Better graphics.
- Replace Google Maps with Open Street Map.
- More analytics.
- Incorporate as few dependencies as possible. Only add dependencies for things that are just too cumbersome or error prone to do otherwise.
- Small web pages that load quickly. This is related to the previous item regarding dependencies.
Full bug and feature tracking.
Step 1. Clone the source code:
git clone https://github.com/msimms/OpenWorkoutWeb
Step 2. Build the docker image:
cd OpenWorkoutWeb
docker build -t openworkout -f docker/Dockerfile .
Step 1. Clone the source code:
git clone https://github.com/msimms/OpenWorkoutWeb
Step 2. Install the python dependencies:
cd OpenWorkoutWeb
python setup.py
Step 3. Install other package dependencies, specifically mongodb
and rabbitmq
, which are services the application depends on:
#
# Example for macOS:
#
# Install mongod and start the service.
brew tap mongodb/brew
brew install [email protected]
brew services start mongodb/brew/mongodb-community
# Install rabbitmq and start the service.
brew install rabbitmq
brew services restart rabbitmq
#
# Example for Ubuntu Linux:
#
# Install mongo.
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt update
sudo apt install mongodb-org
sudo systemctl start mongod.service
sudo systemctl status mongod
# Install rabbitmq.
sudo apt install rabbitmq-server
sudo rabbitmqctl add_user openworkout <password>
sudo rabbitmqctl add_vhost openworkout_vhost
sudo rabbitmqctl set_user_tags openworkout openworkout_tag
sudo rabbitmqctl set_permissions -p openworkout_vhost openworkout ".*" ".*" ".*"
sudo rabbitmqctl delete_user guest
sudo service rabbitmq-server start
The software is designed to work within multiple frameworks. Currently, cherrypy and flask are supported.
Option 1 To run the web service under the cherrypy framework, the wsgi option is the preferred option if the app is sitting behind a proper web server, such as ngnix:
python start_cherrypy.py --config openworkout.config
or
python start_cherrypy_wsgi.py --config openworkout.config
Option 2 To run the web service under the flask framework:
python start_flask.py --config openworkout.config
If a Google Maps key is not provided in the configuration file, OpenStreetMap will be used instead.
The software architecture makes it possible to use this system with different front-end technologies. Also, computationally expensive analysis tasks are kept separate from the main application, communicating via RabbitMQ.
Being a web app, it requires a web framework. I have tried to keep the design flexible enough to support multiple frameworks, to both appease different audiences and also allow the software to be relevant when the fashion in web frameworks inevitably changes. To this end, it currently supports cherrypy and flask with the implementation details for each being isolated in their own modules. A wsgi front end for cherrypy is also provided.
Notable modules:
- App.py contains the logic for handling each page and is framework-agnostic. The page handlers for each framework call into this module.
- Api.py contains all of the API handlers and is also framework-agnostic. Isolating this in its own module also facilitates deploying the API as a microservice.
- Session.py contains the session management code. It has an abstract base class along with subclasses for cherrypy, flask, as well as a custom session manager.
The software is written in python. It was started in python2 and later converted to python3.
This feature is very much under development and will go through several iterations before being ready for general use. The idea is to use the athlete's existing data to generate workouts to help in reaching future goals.
For instructional material, consult the Wiki
- Initial version. Application exhibits basic functionality: can login and view activities received from the iOS companion app.
- Live tracking is functional.
- Added the ability to update email address and password.
- Added the ability to delete one's account and all associated data.
- Added the ability to delete a single activity.
- Added an API for receiving location updates from the companion mobile app.
- Support for HTTPS.
- Many small bug fixes.
- Rudimentary support for lifting activities (pull-ups, push-ups, etc.).
- Support for tags.
- Support for comments.
- Allow activities to be public or private.
- Implemented basic user following.
- Many small bug fixes.
- Activity importing from TCX and GPX files.
- Beginnings of statistical analysis.
- Ability to switch between metric and imperial units.
- Code refactoring to support multiple frameworks (cherrypy and flask).
- Automated data analysis, i.e. an activity is automatically analyzed when the upload is complete or when it has been updated by the mobile application. The results are cached for efficiency.
- Automatic identification of different workout types, such as tempo and interval runs and bike rides.
- Better support for the flask web application framework.
- Ability to upload an entire directory.
- Ability to import an entire directory of files.
- Added a calendar view.
- Activity export.
- Added celery and rabbitmq to distribute analysis tasks.
- Results from distributed tasks are now written direclty to the database for efficiency purposes.
- File imports are now also distributed over rabbitmq and celery with the results being written directly to the database.
- API documentation in RAML.
- Added profile option for resting heart rate.
- Added VO2Max, BMI, and estimated FTP calculations.
- Beginnings of automated workout plan generation. Still plenty of work to do.
- Support for OpenStreetMaps (support for Google Maps is still available).
- Activity export in GPX format.
- Fetch six month records, to use as the basis for workout plan generation.
- Fixes to adding tags and gear to activities.
- Added cycling power distribution graph.
- Too many optimizations to list.
- Too many small bug fixes to list.
- Generation of feature list prior to automated workout plan generation.
- Updates to the flask front end.
- Updates to the OpenStreetMap option.
- Bug fixes.
- Bug fixes.
- Added gear tracking. Feature Page
- Added location descriptions (i.e., Florida, United States).
- Importing data now also starts the analysis process.
- Bug fixes.
- Rudimentary run plan generation - still much to do.
- Updates to support python3.
- Bug fixes.
- Bug fixes when importing and exporting activities.
- Ability to export position data as a CSV file.
- Bug fixes in computing gear distances.
- Bug fixes, including many pertaining to the flask front end as well as activity analysis.
- Added an iCal server for subscribing to planned workouts.
- Added planned workouts to the My Activities calendar.
- Added a map that shows the countries, US states, and Canadian provinces in which activities were recorded. Feature Page
- Bug fixes and performance improvements.
- Moved more functionality to the API.
- Display US and Canada together for state/province statistics as it just looks better.
- Reworked the follower/following system, so that everyone is just 'friends'.
- Track mile and kilometer split times. Feature Page
- Bug fixes.
- Moved more functionality to the API.
- Moved distance and pace calculations to the front end (at least when using Google Maps). Feature Page
- Bug fixes.
- Bug fixes.
- Bug fixes. Includes python2 and python3 fixes for the activity analyzer as well as fixes to managing activity tags.
- Bug fixes and performance optimizations.
- More work on run workout plan generation.
- Added gear defaults. Feature Page
- Display mile and kilometer split times. Feature Page
- Ability to import FIT files. Feature Page
- Ability to export workouts in ZWO fomrat. Feature Page
- More work on run workout plan generation.
- Replaced command line options with a configuration file. Feature Page
- More work on run workout plan generation.
- Bug fixes and performance optimizations.
- More work on run workout plan generation.
- Added the ability to retire gear.
- Bug fixes with respect to python3.
- Added a 404 page for the cherrypy front end.
- More work on run workout plan generation.
- Bug fixes.
- Work towards saving photos.
- Now saving the final that was uploaded and not just the data that was extracted from it.
- More work on run workout plan generation.
- Bug fixes and performance optimizations.
- Moved more logic to the client.
- More work on run workout plan generation, specifically updating the scheduler.
- Bug fixes.
- Minor UI updates.
- Bug fixes and performance optimizations.
- Minor UI updates.
- Ability to upload photo upload.
- Bug fixes and performance optimizations.
- Bug fixes and performance optimizations.
- Minor UI updates.
- Ability to synchronize with the mobile app (i.e. receive activities that we don't already have).
- More API work.
- Bug fixes and performance optimizations.
- Added pace plan synchronization with the mobile app.
- More API work.
- Bug fixes and performance optimizations.
- Fixed planned workout synchronization with the mobile app.
- Fixed heart rate zone generation.
- Bug fixes and performance optimizations.
- Bug fixes and performance optimizations, specifically on activity deletion and when loading the activities calendar view.
- Bug fixes and performance optimizations, including a lot of graph fixes.
- Initial cut of csv import functionality.
- Bug fixes and performance optimizations.
- Bug fixes and performance optimizations.
- Project renamed.
- Bug fixes and performance optimizations.
- Temperature data is now shown.
- Pool swimming workouts can now be imported.
- Default gear can now be specified.
- Bug fixes to personal record tracking.
- Style fixes.
- Bug fixes and performance optimizations.
- Bug fixes and performance optimizations.
- Added support for browser dark mode.
- Added the ability to edit gear names.
- Bug fixes and performance optimizations.
- Added a race calendar, to replace manually specifying goals.
- Bug fixes.
- Bug fixes.
- Analysis service now scans for unanalyzed activities.
- Bug fixes.
- First cut at a wsgi front end.
- Bug fixes.
- Bug fixes.
- Updated unit tests.
- Bug fixes.
- Updated unit tests for workout plan generation.
- More work on workout plan generation.
- Bug fixes.
- Updated API unit tests.
- Bug fixes.
- More work on workout plan generation.
- Bug fixes.
- More work on workout plan generation.
- Bug fixes.
- More work on workout plan generation.
- Bug fixes.
- More work on workout plan generation.
- Bug fixes.
- More work on workout plan generation and scheduling.
- Bug fixes.
- Added the ability to merge activities.
- More work on workout plan generation and scheduling.
This software uses several other source projects to work properly:
- LibMath - A collection of math utilities, including a peak finding algorithm.
- ZwoReader - A simple utility for parsing a ZWO-formatted file.
- fullcalendar - A Javascript calendar implementation.
- chosen - A select box implementation that is used for the tag user interface.
- pymongo - Python interface to mongodb.
- cherrypy - A framework for python-based web apps (optional).
- flask - A microframework for python-based web apps (optional).
- python-fitparse - A library for parsing .FIT files.
The app is written in a combination of Python, HTML, and JavaScript.
Currently proprietary (though many of the source files are under the MIT license). However I am considering moving the remainder of the source code to either an MIT or MPL license.