Skip to content

palowenstein/aerobics-fitness-tracker-mongoose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#17-aerobics-fitness-tracker-mongoose

Project license

1980s aerobics flavored workout tracker enabled via MongoDB, Mongoose schema, Express routing and Morgan middleware.

Github Repository Page: https://github.com/palowenstein/aerobics-fitness-tracker-mongoose

Heroku Deployment Page: https://afternoon-oasis-52971.herokuapp.com/

Table of Contents

GIF

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Application Demo (GIF)

Fig. 1. Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Application Demo (GIF)


Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Workout Stats Interaction (GIF)

Fig. 2. Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Workout Stats Interaction (GIF)

Overview

  • The 1980s aerobics flavored workout tracker enables the following actions:
    1. Create, View and Track daily workouts.
    2. Log multiple exercises in a specific workout on a given day.
    3. Exercises are broken up in two types:
      1. Cardio exercises which can be tracked with the following parameters:
        • Name
        • Distance
        • Duration
      2. Resistance exercises which can be tracked with the following parameters:
        • Name
        • Weight (lbs)
        • Sets
        • Reps
        • Duration (minutes)
  • The separate "Workout Statistics" page allows the end user to visualise:
    1. workout duration in minutes (line graph),
    2. pounds lifted (bar graph),
    3. exercises performed (pie chart).

    Note: This last type can be edited on the fly (Fig. 2).

Details

  • A .gitignore file is present at the root level to prevent the upload of node_modules, Macintosh .DS_Store files.
  • For this application to run locally, MongoDB must be installed and running in the background as seen in the terminal screen capture below. The application will not run correctly without a valid MongoDB install.
  • The end user must first execute the package.json file located in the root folder of the application. This can be done in Apple's Terminal via the npm install command and will install the required dependencies (Express, Mongoose schema, Morgan middleware) needed for the program to run.
  • For the application to run in an heroku environment, a Procfile file with the startup instruction node server.js has been placed into the application folder.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — MongoDB Background Execution / Apple Terminal (PNG)

Fig. 3. Background execution of MongoDB in Apple's Terminal. MongoDB is called via the mongo command.

Instructions

  • Makes sure MongoDB is installed locally and running in the background as seen in Fig.1.
  • In Terminal, locate the application's root directory and enter it via the cd command: cd aerobics-fitness-tracker-mongoose.
  • While in the root directory, run the npm install command to install the necessary node modules (mongoose, morgan, express) from the package.json.
  • In Terminal, locate the seeders directory located in the main application directory via cd application then cd seeders.
  • In the seeders directory, run the node seed.js command.
  • This will pre-populate the mongoose schema so that the application doesn't start with null data.
  • Back in the Application directory via the cd .. command, run the node server.js command.
  • This will launch the application which, in terminal, will indicate 1980s Aerobics & Fitness Tracker Application now running on port 4000.
  • You can now access the application in your browser by loading localhost:4000 from the address bar.
  • When run initially, except for the date, the landing page will show null data.
  • However, if the seed.js file has been properly executed, the workout statistics pages will appear pre-filled at launch.
  • Note: Pre-configured version of this application is accessible via Heroku: https://afternoon-oasis-52971.herokuapp.com/

Screenshots

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Workout Stats page during initial use. Populated with information extracted from seeders/seed.js (PNG)

Fig. 4. "Workout Stats" page during initial use. Populated with information extracted from seeders/seed.js.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Landing page, Last Workout with null information. (PNG)

Fig. 5. Landing page, "Last Workout" with null information. Appears when application is first used or after a database flush.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Add Cardio Exercise Example (PNG)

Fig. 6. Cardio Exercise parameters: name, distance, duration.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Add Resistance Exercise Example (PNG)

Fig. 7. Resistance Exercise parameters: name, weight, sets, reps, duration.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Workout Added Successfully Bubble (PNG)

Fig. 8. Workout Added Successfully Bubble.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Landing page with previous exercise information (PNG)

Fig. 9. Landing page impacted with previous exercise information.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Terminal activity while application is running (PNG)

Fig. 10. Terminal activity while application is running.

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — MongoDB properly filled with seeders/seed.js (Robo 3T) (PNG)

Fig. 11. MongoDB properly filled with seeders/seed.js (Robo 3T)

Video

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Application Demo (MP4)

Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Workout Stats Interaction (MP4)

References

  • MongoDB + Mongoose (NoSQL).
  • Node.js Javascript Library.
  • Express for GET/POST/DELETE Requests between REST APIs.
  • Morgan Middleware.
  • Package.JSON / NPM for installing dependencies.
  • Thunderstom font (1980s flavored font).

License

MIT License | Copyright © [2021] Pierre André Lowenstein

Contributions

  • Pull/Fork from master.
  • Create your own branch.
  • Add your own code (must be tested).
  • Push your branch.
  • Request a pull.

Please use the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md)

For major changes, please open an issue beforehand to discuss the changes.

Contact

[www] pierreandrelowenstein.com  |  [e-mail] Send me a 'courriel'

About

1980s Aerobics Fitness Tracker built with MongoDB database connection, Mongoose ODM (Object Data Modeling) Schema and Express route handling to complement front-end javascript, html+css code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published