This database allows users to register, login, and view all of their workouts in the database. It also allows users to create, edit, and delete their OWN workouts. Users can also create, edit and delete exercises within workouts, and create edit and delete sets within exercises.
Method | Endpoint | Body (required) | Body (optional) | Notes |
---|---|---|---|---|
GET | / | N/A | N/A | returns object -> { "message": "Server Up!" } |
Method | Endpoint | Body (required) | Body (optional) | Notes |
---|---|---|---|---|
POST | /api/auth/register | email, password | name, avatarUrl | Creates a new user object in the database. Returns userID |
POST | /api/auth/login | email, password | N/A | Returns JSON Web Token |
***EXAMPLES***
POST Register
2
POST Login
{
'token': '<really long token value here.....>,
}
Method | Endpoint | Body (required) | Body (optional) | Notes |
---|---|---|---|---|
GET | /api/users/:id/workouts | N/A (though keep in mind you do need to be logged in as user to view, edit, add, or delete users workouts | N/A | Returns a singular workout object based on user_id and workout_id. |
POST | /api/users/:id/workouts | workoutName | N/A | Workout ID |
PUT | /api/workouts/:id | workoutName | N/A | Workout ID |
DELETE | /api/workouts/:id | N/A | N/A | Allows users to delete ANY OF THEIR OWN events. |
***EXAMPLES***
GET User Workouts by userID in req.body.params
[
{
"name": "Willy L",
"workoutName": "leg-day",
"date": "Saturday"
},
{
"name": "Willy L",
"workoutName": "core",
"date": "Monday"
},
{
"name": "Willy L",
"workoutName": "upper-body",
"date": "Tuesday"
},
{
"name": "Willy L",
"workoutName": "Back day",
"date": null
},
{
"name": "Willy L",
"workoutName": "Back day",
"date": null
}
]
POST Added Workout to User Account
13
PUT Edited Workout previously added
{
"message": "Updated workout",
"workout": [
{
"id": 13,
"workoutName": "testEditName"
}
]
}
DELETE User Workout from User Account
{
"message": "Deleted Workout"
}
Method | Endpoint | Body (required) | Body (optional) | Notes |
---|---|---|---|---|
GET | /api/workouts/:id/exercises | N/A | N/A | Returns all exercises for a users workout routine. |
POST | /api/workouts/:id/exercises | exerciseName, musclesName | completed | returns exercise ID |
PUT | /api/exercises/:id | N/A | exerciseName, musclesName, completed | Returns edited object |
DELETE | /api/exercises/:id | N/A | N/A | Returns deleted message |
***EXAMPLES***
GET
POST User Exercise inside User Workout
5
PUT User Exercise inside User Workout
{
"message": "Updated exercise",
"workout": [
{
"id": 5,
"exerciseName": "testNamechange",
"musclesName": "testNamechange",
"completed": false
}
]
}
DELETE User Exercise inside User Workout
{
"message": "Deleted Exercise"
}
Method | Endpoint | Body (required) | Body (optional) | Notes |
---|---|---|---|---|
GET | /api/exercises/:id/sets | N/A | N/A | Returns all sets for a user workout routine. |
POST | /api/exercises/:id/sets | reps, weight | N/A | Allows users to post brand new sets to specific exercise routine in database. |
PUT | /api/sets/:id | N/A | reps, weight | Allows users to edit their OWN sets from an exercise routine. |
DELETE | /api/sets/:id | N/A | N/A | Allows users to delete their OWN sets from exercise routine. |
***EXAMPLES***
POST User Set inside User Exercise
{
}
PUT User set inside User Exercise
{
}
DELETE User Exercise inside User Exercise
{
}
Jackson Ogles: https://github.com/cjogles
Eddie Madrigal: http://github.com/eddiemadrigal
Matthew Heideman: https://github.com/MatthewHeideman
Myco Sullivan: https://github.com/mjs001
Nicole White: https://github.com/Nicci498
Jake Johnson: https://github.com/ekajjj
Leo Sanchez: https://github.com/LeoSanchez89
Jackson Ogles: https://github.com/cjogles
Abdi Farah: https://github.com/abdirahmanfarah