An app using Express, Mongoose, and mongoDB to track fitness progress over time. Users can input their fitness data, tracking workouts and exercises within those workouts, which will be stored in a NoSQL database.
The Mongoose schema has Exercises as a populated field in Workouts. Additionally, I used Mongoose's discriminator mechanism to inherit and extend Exercise attributes.
I also used Mongoose's virtual attribute function to calculate total duration for the homepage.
Link to Gist Writeup of Project
Link to Deployed Project || Link to GitHub Repo
- Clone this repo.
- Set up your local MongoDB URI inside a .env file. My .env file contained:
MONGODB_URI=mongodb://localhost:27017/fitnessTrackerDB
- Use your preferred method to establish environmental variables - I used VSCode's built-in launch configurations with the added parameter
"envFile": "${workspaceFolder}/.env"
. - Launch your app with
npm start
ornode server.js
.
A Note: Hosting with Heroku takes a few more steps. You can find more instructions on how to set up Heroku here, and how to connect your MongoDB Atlas cloud db with Heroku.
Create a new workout or add to an existing one.
Each exercise can be either cardio or resistance.
View your progress over time on the dashboard and current stats on the homepage.
MIT
Please let me know how I can improve on this project! Issues and pull requests are welcome.
Please address questions to GAFelton.