Skip to content

Fitness tracker: create workouts and add exercises to track exercise routines. (Needs update as a result of mLab being removed from Heroku for the deployed version to run.) Uses MongoDB and Mongoose, Node.js, Express, jQuery, Bootstrap, HTML & CSS. It is a progressive web app.

Notifications You must be signed in to change notification settings

MauraSlavin/fitness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fitness Tracker

Fitness tracker using mongoDB and Mongoose

Link to Github repository.

Link to deployed app.

The Fitness Tracker is PWA that has some functionality when offline, and displays a message explaining to the user what will and won't work until an Internet connection is re-established.

Code and images have been compressed an minified for efficiency.

User story

Someone is more likely to follow good exercise habits if they can see their progress.

Technologies & Tools used

- MongoDB
- Mongoose
- Express
- jQuery
- Webmanifest (to make it a Progressive Web App)
- Html
- Bootstrap
- CSS

Home page

Allows users to see:

1. the current workout, 
2. allows them to create a new workout, and
3. a list of past workouts (by name only - click on to see details).

The workouts in this example are:

- Strength (current workout)
- Easy
- Aerobic

The user can easily navigate to any of these workouts by clicking on it. A new workout is created (with no exercises in it to begin with) by entering a name and clicking on "Go!". This brings them to the workout page for that workout.

Home page

Workout page

The workout page shows the details for a given workout in three sections:

1. The top section shows the exercises entered (done) with some details and a time stamp (the time zone is set to New York in Heroku).  This is informational.
2. The middle section shows exercises available that have been entered into the app.  Users click on "Add to workout" when the exercise is completed to add it to the workout.  The exercise is defined by a description, unit (such as weight, miles, minutes, etc.), and reps.
3. The bottom section allows the user to enter a new workout, which will be available to add to any workout.  The user enters the description, unit and reps, and clicks "Add New Exercise."  This adds it to the list of available exercises, and can then be added to the workout.

Workout page

Database

The database is Mongo, and uses Mongoose to interact with it.

There are two collections in the database.

Workouts Collection

The workouts collection has documents that look like this:

    - name (string, required, and must be unique),
    - current (only exists if this workout is the current one, and it will be true),
    - exercises, which is an array of:
        * exercise ID (referencing exercise in exercises collection
        * whenDone (timestamp when exercise entered(done))

Exercises Collection

The exercises collection has documents that look like this:

    - description (string, required)
    - unit (string, required - defaults to 1 in Javascript code)
    - reps (number, defaults to 1)

About

Fitness tracker: create workouts and add exercises to track exercise routines. (Needs update as a result of mLab being removed from Heroku for the deployed version to run.) Uses MongoDB and Mongoose, Node.js, Express, jQuery, Bootstrap, HTML & CSS. It is a progressive web app.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published