Skip to content

TheNewThinkTank/fitness-tracker

Repository files navigation

commit activity CI GitHub repo size

Fitness-Tracker

Documentation Status codecov

Intro

Full stack fitness tracking application using TinyDB and FastAPI. Add weight-training logs continuously to db.json and query the data through the browser. Visually inspect your progression through dates and exercises

Architecture Diagram

architecture

Getting started

First, clone the project:
git clone https://github.com/TheNewThinkTank/Fitness-Tracker.git

Upload your workouts

  • Add your workout log to the data folder under the correct workout date
  • Edit bin/fitcli.sh: Specify the WORKOUT_DATE and TRAINING_PROGRAM values
  • Execute ./bin/fitcli.sh which will insert your log(s) into the TinyDB database

Analyze your data

Run FastAPI web app with Docker from CLI: docker-compose up
then visit the URL: http://localhost:8080/docs

Alternatively,

docker build -t ftimage .
docker run -d -p 8000:8000 --name ftcontainer ftimage

Update docs

cd docs
make clean
sphinx-apidoc -o ./source ../src
make html

Features

  • FastAPI app "Fitness-Tracker", with TinyDB backend, exposed through Docker container
  • Program logging (Located in folder: logs)
  • Plotting (with the Seaborn library. Located in folder: img)
  • Documentation (auto-generated by Sphinx and hosted on readthedocs): https://fitness-tracker.readthedocs.io/en/latest/index.html#
  • Multiple unit test suites (Pytest)
  • BDD (Behavior Driven Development, using the Behave framework)
  • Multiple GitHub Actions workflows
  • Data quality validation (Great Expections)
  • Package dependency management (Poetry)
  • KPI tracking: 1-Rep-Max estimation (Epley and Brzycki formulas)
  • Realistic workout data simulation (with naturally progressing trend over time)
  • Catalogue of musclegroups, corresponding exercises and suggested weight ranges (for simulations)

Examples

training plots etc.

Similar projects

If you liked this fitness tracker then you might also be interested in the workout-generator Django project,
the nutrition-planner Streamlit project, with associated development guide:
medium,
the athlete project,
or the Dojo martial arts project which can be found on GitLab and is a Rust & TypeScript based general purpose martial arts desktop application

TODOs

  • add quantitative flexibility measurements / estimations
  • quality control for TS and JS
  • timezone check; check stated timezone in workout logs are consistent with the definition: CEST spans from the last Sunday in March to the last Sunday in October. start by checking that workout logs timezone data for November -> February are not CEST
  • YAML support

Known Issues

  • Google Drive on macOS Ventura 13.4.1 spontaneously switches local mounting point between /Users/<USER>/Google Drive/ and /Users/<USER>/Library/CloudStorage/GoogleDrive-<EMAIL>/, or fails to sign in.
    Fix
  • Mounting directories directly from Google Drive is not supported by Docker Compose. Docker Compose can only mount directories that are accessible on the local filesystem.

About

Full stack fitness tracking application using TinyDB and FastAPI

Resources

License

Stars

Watchers

Forks