Marc wants to build muscle
Marc enters his goals by calling POST /goals passing “get big”, “workout”, 2800.
He then begins adding workouts with with POST /workout passing “deadlift”, 3, 10, 0.
He does this with multiple workouts at varying lengths, set, reps.
His friends asks him what workouts he’s done, so he GET /workouts/days and returns a list of workout with “id”, “name”, “sets”, “reps”, “length”, "type", "group"
His friend asks what to do for back, GET /workout/muscle_group/{type} passing “back” as type and returns a list of workouts "name", "type", and "group" for the back
- curl -X 'POST'
'https://nutrition-pal.onrender.com/user'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "name": "Marc", "weight": 150, "height": 189 }' - { "id" : 11 } or some integer(can vary due to testing) BUT USE THIS VALUE FOR LATER CUSTOMER ID PARAMS
- curl -X 'POST'
'https://nutrition-pal.onrender.com/goals/11'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "goal": "get big", "type": "workout", "daily_calories": 2800 }' - "OK"
-
curl -X 'POST'
'https://nutrition-pal.onrender.com/workout/11'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "name": "deadlift", "sets": 3, "reps": 10, "length": 0 }' -
"OK"
-
curl -X 'POST'
'https://nutrition-pal.onrender.com/workout/11'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "name": "pull_up", "sets": 5, "reps": 5, "length": 0 }' -
"OK"
-
curl -X 'POST'
'https://nutrition-pal.onrender.com/workout/11'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "name": "leg_press", "sets": 1, "reps": 9, "length": 0 }' -
"OK"
- curl -X 'GET'
'https://nutrition-pal.onrender.com/workouts/11/day'
-H 'accept: application/json' - [ { "id": 15, "name": "deadlift", "type": "legs", "group": "glutes", "sets": 3, "reps": 10, "length": 0 }, { "id": 9, "name": "pull_up", "type": "back", "group": "lats", "sets": 5, "reps": 5, "length": 0 }, { "id": 22, "name": "leg_press", "type": "legs", "group": "quads", "sets": 1, "reps": 9, "length": 0 } ]
- curl -X 'GET'
'https://nutrition-pal.onrender.com/workouts/muscle_groups/back'
-H 'accept: application/json' - [ { "name": "lat_pulldown", "type": "back", "group": "lats" }, { "name": "cable_row", "type": "back", "group": "traps" }, { "name": "pull_up", "type": "back", "group": "lats" }, { "name": "bent_over_dumbell_row", "type": "back", "group": "lats" } ]
Andrew M. is jealous of his roommate’s incredible physique.
Andrew starts with a POST /goals passing “get huge, “workout”, 2800.
He posts a workout POST /workout “squat”, 20, 20, 0.
He wants to see what his workouts hit so he starts with GET /workout/day and gets a list of “id”, “name”, “sets”, “reps”, “length”, "type", and "group"
He wants to see what his squat hits so he does a GET /workout/{id}/muscle_groups passing an id in that was in the prior return.
This returns what muscles he's targeting
- curl -X 'POST'
'https://nutrition-pal.onrender.com/user'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "name": "Andrew M.", "weight": 90, "height": 189 }' - { "id": 12 }
- curl -X 'POST'
'https://nutrition-pal.onrender.com/goals/12'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "goal": "get huge", "type": "workout", "daily_calories": 5000 }' - "OK"
- curl -X 'POST'
'https://nutrition-pal.onrender.com/workout/12'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "name": "squat", "sets": 20, "reps": 20, "length": 0 }' - "OK"
- curl -X 'GET'
'https://nutrition-pal.onrender.com/workouts/12/day'
-H 'accept: application/json' - [ { "id": 20, "name": "squat", "type": "legs", "group": "quads", "sets": 20, "reps": 20, "length": 0 } ]
- curl -X 'GET'
'https://nutrition-pal.onrender.com/workout/20/muscle_groups'
-H 'accept: application/json' - [ { "name": "squat", "type": "legs", "group": "quads" } ]