Unit 17 NoSQL Homework: Workout Tracker:
This is a Workout Tracker App created with a MongoDB
database and Mongoose schema
, which handles routes with Express
. The user can log multiple exercises in a workout on a given day as well as track the name, type, weight, sets, reps, and duration of each exercise.
App deployed on Heroku: nosql-fitnezz-trakker
Repository on GitHub: NoSQL_FitnessTracker
- User Story
- Business Context
- Mock Up
- Installation
- Usage
- Features
- Resources
- Submitted For Review
- Questions
- License
As a user, I want to be able to view create and track daily workouts. I want to be able to log multiple exercises in a workout on a given day. I should also be able to track the name, type, weight, sets, reps, and duration of exercise. If the exercise is a cardio exercise, I should be able to track my distance traveled.
A consumer will reach their fitness goals more quickly when they track their workout progress.
The following screenshots demonstrate the apps functionality:
Node.Js
must be installed to run this application.
You'll need to set up a MongoDB Atlas
account and connect a database to your application.
Fork or clone repository and open application.
From the command line:
run npm init -y
to create package.json
npm i
for package manager and node_modules
npm i mongoose
to create path to Mongo database.
npm i express
for web framework for node.js
npm i morgan
for request logger middleware.
From the the terminal,
Run node seeders/seed
to import the initial data set.
Run node server
to establish a connection with Mongo Atlas
.
Usehttp://localhost:3000/
to run this application in your browser.
Users can start a new exercise routine or continue with an existing workout.
The Features of this application are described in the next section and listed as part of the acceptance criteria for this assignment.
Save time and skip installation! For greater accessibility and ease of use, check out the deployed application on Heroku:
Visit this link: Fitness Tracker
For more information on deploying with MongoDB Atlas and Heroku, please visit the resources section.
When the page loads, users are given the option to create a new workout or continue with their last workout.
This app includes the following features:
-
Add exercises to the most recent workout plan.
-
Add new exercises to a new workout plan.
-
View the combined weight of multiple exercises from the past seven workouts on the
stats
page. -
View the total duration of each workout from the past seven workouts on the
stats
page.
Heroku cloud-application platform
MongoDB NoSQL document database composed of field and value pairs.
NodeJS open-source, cross-platform, back-end JavaScript runtime environment.
Mongoosea MongoDB object modeling tool designed to work in an asynchronous environment. Mongoose supports both promises and callbacks.
Express a node.js web application framework known as middleware for API creation.
Morgan HTTP request logger middleware for node.js
MongoDB documentation on the $addFields aggregate function to dynamically add up and return the total duration for each workout. MongoDB documentation on the $sum operator
Mongoose documentation on aggregate functions to learn how it can be accomplished.
Deploy with Heroku and MongoDB Atlas
-
The URL to the deployed application.
-
The URL to the GitHub repository.