added src/app/browse folder -> endpoint for UI /browse
added src/app/workouts folder -> endpoint for UI /workouts/:id implemented
Detailed info on Front End
the browse page is able to filter based on type of exercise (strength, yoga etc)
browse page is also able to search for exercises with search bar
upon clicking on a workout, user will be redirected to /workout/workoutId page where the list of exercises (workout exercise objects) will be displayed
clicking on the workout exercise panel currently just prints object to console, however future implementation will see this redirect to a detailed description of the specific exercise
the workouts/workoutId page as mentioned earlier simply displays the workout exercises associated with a specific workout id
Summary Back End
adds src/services/workout-service.js
adds src/services/workoutExercise-service.js
adds src/schemas/Workout.js schema (Schema for DB)
adds src/schemas/WorkoutExercise.js schema (Schema for DB)
adds src/routes/workoutRoutes.js route
testing files to ensure database connections
Detailed info on Back End
create /workout route
this route includes a get all and get by id
the get all route returns a list of all public workouts (denoted by public: true attribute)
the get by id route will return a json of all workout exercises associated with that specific workout id
this route is integrated with the workout-service functions in order to get information from database
create service files
workout-service file used to access documents in the workouts collection
this implements all CRUD operations and specifically for read:
get all (public) workouts
get workout by id
workoutExercise-service file used to access documents in the workoutExercise collection
this implements all CRUD operations and specifically for read:
get workout exercise by workout id (this will return all workout exercises associated with a specific workout)
get workout exercise by id (by workoutExercise id)
create schemas
simple MongoDB schema files for reference by the corresponding service files
Workout schema
WorkoutExercise schema
service test files
these files just ensure the connection to DB works and the CRUD operations function as expected
Usage
to access browsing workout feature on front end -> localhost:3000/browse
What has been done?
Summary Front End
src/app/browse
folder -> endpoint for UI/browse
src/app/workouts
folder -> endpoint for UI/workouts/:id
implementedDetailed info on Front End
/workout/workoutId
page where the list of exercises (workout exercise objects) will be displayedSummary Back End
src/services/workout-service.js
src/services/workoutExercise-service.js
src/schemas/Workout.js
schema (Schema for DB)src/schemas/WorkoutExercise.js
schema (Schema for DB)src/routes/workoutRoutes.js
routeDetailed info on Back End
public: true
attribute)Usage
localhost:3000/browse