Skip to content

iamklager/lean_gym

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeanGym

A lean mobile app to track your workout progress. It is limited only to the most basic functionalities and all data is stored locally.

Written in Python using the Kivy and KivyMD frameworks.

Use Case & Background

Most gym apps do things I don't want them to do, such as collecting your data, being full of advertisements or limiting their functionalities unless you pay a subscription. Therefore, I made my own.

The app allows you to create and track your workouts. Data is being stored locally and can be exported and imported.

How to Run

On Your PC

To run the app on your pc, you need to install python and the packages listed in the 'requirements.txt' file. You can also do this using one pip command:

pip install -r requirements.txt

On Your Mobile Phone

To run and deploy the app on both Android and iOS, you can use Buildozer.
The current buildozer.spec file is setup for deploying on Android.

Technologies Used

  • Python: + Kivy, KivyMD, Matplotlib
  • SQLite3
  • Buildozer
  • json

Functionality

On the app's home screen, you can start, add, edit and delete workouts.

During a workout, selecting an exercise will bring you to a screen displaying either your last session's sets as a table or this exercise's history as a chart, as well as the set's of your current session. After each set, you will enter a pause screen, displaying the countdown until the next exercise. You can always skip this pause or set the pause time in the settings tab to 00:00, to disable the pause screen entirely. During each workout, you can also track your bodyweight, and view its history.

In the settings screen, you can adjust your pause countdown time, and whether or not your phone should vibrate or play a sound at the end of your pause. Here you can also export and import your data. Note that exported data is stored as json, and that importing data will overwrite all existing data.

Implementation Details

Exercises

Upon running the application for the first time, allexercises are being generated from the "/app/settings/exercises.json" file and stored in the database. The exercises in this file follow a tree-like structure consisting of the overarching exercise's name, the units for intensity and volume, as well as its variations (Spec1 to Spec4). Each individual exercise is then being formed by following the root (the overarching exercise's name) to the each leaf.
Take the bench press as an example of this structure:

"Bench Press": {
    "Units": {
        "Intensity": "kg",
        "Volume": "Reps"
    },
    "Specifications": {
        "": {
            "Flat": {
                "Barbell": ["2 Hands"],
                "Dumbbell": ["2 Hands", "1 Hand"],
                "Smith": ["2 Hands"]
            },
            "Incline": {
                "Barbell": ["2 Hands"],
                "Dumbbell": ["2 Hands", "1 Hand"],
                "Smith": ["2 Hands"]
            },
            "Decline": {
                "Barbell": ["2 Hands"],
                "Dumbbell": ["2 Hands", "1 Hand"],
                "Smith": ["2 Hands"]
            }
        }
    }
},

This generates all different variations of the bench press, from the flat barbell bench press done with two hands to a one hand incline dumbbell bench press.

Data Import & Storage

All the data is stored using a local SQLite3 database. From the settings tab, user data can be exported to/ imported from a json file.

Data Processing

Not much to say here. It happens when it needs to happen and is done via Python and SQLite queries.

UI

The UI was built in KivyMD, and kivy_garden.graph was used for the charts. Tables are custom widgets.

Demo Screenshots


About

A lean mobile app to track your workouts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors