Skip to content

Repository files navigation

FitQuest

Click here to see deployed project


Description

FitQuest is a fitness tracker app that allows users to create and track daily workouts. As a full CRUD application, users can log multiple exercises in a workout on a given day. They can track the name, sets, weights and reps of their exercises, and these are assigned a points value based on their difficulty.

On their profile page, users can edit a number of details about themselves like profile pictures and weight, and they can see a summary of their workout history.

Technologies used include JS ES6, Express, MongoDB, Mongoose, and Bootstrap. Styled with a mobile first approach.

This app utilizes the API Ninjas Exercise API to provide a list of exercises to choose from, complete with difficulty levels, equipment needed, and instructions. It also uses the Cloudinary API to allow users to upload profile pictures.

Developed at the end of Module Two of the Ironhack Web Development Bootcamp.

This project was completed with a partner, Tzu-Yun.


MVP

  • A working fitness tracker app that will allow users to:
    1. Sign up and log in
    2. Create a workout
    3. Add exercises to a workout
    4. Edit a workout
    5. Delete a workout
    6. View their workout history
  • Authentication for routes
  • At least 2 models and 1 relationship

Models

  • User model: Represents a user in the application. Each user can have multiple workouts.

  • Workout model: Represents a workout session created by a user. Each workout session can have multiple exercise logs.

  • ExerciseLog model: Represents an individual exercise performed within a workout session. Each exercise log references a specific exercise from the Exercise model.

  • Exercise model: Represents a predefined exercise available in the app. This model doesn't have any direct relationship with other models, but it's referenced by the ExerciseLog model.

  • SetSchema model: Represents a set within an exercise log (used in exerciseLogSchema). It doesn't have direct relationships with other models, but it's embedded within the ExerciseLog model in the sets array.

To summarize:

  • A User has a one-to-many relationship with Workout.
  • A Workout has a one-to-many relationship with ExerciseLog.
  • An ExerciseLog has a many-to-one relationship with Exercise.
  • An ExerciseLog has a one-to-many relationship (embedded) with SetSchema.

Data structure

server.js

  • Entry point to start the server and connect to the database

app.js

  • Sets up a Node.js web application using the Express framework and loads necessary middleware and configurations. It defines routes for the main page, authentication, session management, protected routes, and API routes for workout data. It also sets up error-handling middleware

routes/

  • Contains the routes for the application, separated by concern.

  • auth.routes.js: authentication (sign up, log in, log out).

  • profile.routes.js: routes for user profile page

  • session.routes.js: routes for session management (check if user is logged in, redirect to login page if not).

  • workout.routes.js: routes for workout data (create, edit, delete, view).

middleware/

  • route-guard.js: Checks if a user is logged in before allowing access to protected routes.
  • inputValidation.js: Validates user input for the sign up and edit profile forms.
  • cloudinary.config.js: Configures the Cloudinary API for uploading profile pictures.

utils/

  • Helper functions for the backend, like storeExercise() which converts the API Ninjas exercise data into a format that can be stored in the database.

config/

  • session.config.js: Configures the express-session middleware for session management.

views/

  • auth/: Contains views for authentication (sign up, log in, log out).
  • protected/: Contains views for protected routes (user profile page and create workout page).
  • index.ejs and layout.ejs

js/

  • Contains the JavaScript files for the application, separated by concern.

  • workout.js: Contains the bulk of the logic for handling the functionality of the workout page. The main features include:

    1. Creating a new workout.
    2. Searching for exercises using an input field and displaying the results.
    3. Adding or removing exercises to/from the current workout.
    4. Showing more information about an exercise, such as equipment needed and instructions.
    5. Displaying a workout summary upon completion, including the total score.
  • profile.js: Contains logic for handling the functionality of the profile page. The main features include:

    1. Editing user details such as profile picture, weight, and height.
    2. Displaying a summary of the user's workout history.
  • exerciseCard.js: Provides helper logic for handling interactivity on the exercise cards on the workout page.


Backlog

  • Add functionality for recording time and distance for cardio exercises
  • Assign points for 0kg sets with reps (e.g. pushups)

Links

About

A full CRUD Fitness Tracker App, allowing users to create and track daily workouts, and view their unique workout history.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages