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/
Fig. 1. Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Application Demo (GIF)
Fig. 2. Aerobics Fitness Tracker (NoSQL, MongoDB, Mongoose, Node, Express, Morgan) — Workout Stats Interaction (GIF)
- The 1980s aerobics flavored workout tracker enables the following actions:
- Create, View and Track daily workouts.
- Log multiple exercises in a specific workout on a given day.
- Exercises are broken up in two types:
- Cardio exercises which can be tracked with the following parameters:
- Name
- Distance
- Duration
- Resistance exercises which can be tracked with the following parameters:
- Name
- Weight (lbs)
- Sets
- Reps
- Duration (minutes)
- Cardio exercises which can be tracked with the following parameters:
- The separate "Workout Statistics" page allows the end user to visualise:
- workout duration in minutes (line graph),
- pounds lifted (bar graph),
- exercises performed (pie chart).
Note: This last type can be edited on the fly (Fig. 2).
- 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.
Fig. 3. Background execution of MongoDB in Apple's Terminal. MongoDB is called via the mongo command.
- 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/
Fig. 4. "Workout Stats" page during initial use. Populated with information extracted from seeders/seed.js.
Fig. 5. Landing page, "Last Workout" with null information. Appears when application is first used or after a database flush.
Fig. 6. Cardio Exercise parameters: name, distance, duration.
Fig. 7. Resistance Exercise parameters: name, weight, sets, reps, duration.
Fig. 8. Workout Added Successfully Bubble.
Fig. 9. Landing page impacted with previous exercise information.
Fig. 10. Terminal activity while application is running.
Fig. 11. MongoDB properly filled with seeders/seed.js (Robo 3T)
- 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).
MIT License | Copyright © [2021] Pierre André Lowenstein
- 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.
[www] pierreandrelowenstein.com | [e-mail] Send me a 'courriel'