"id": "1", "personName": "Pete", "email": "[email protected]", "isOverEighteen": true, "password": abc123, "isInstructor": false
{ "id": "1", "className": "oldie but goodie", "classType": "jazzersize", "classDate": "Monday", "startTime": 9:00am, "duration": 1, "intensity": "high", "location": "anywhere", "numberOfStudents": 10, "maxClassSize": 10 }
https://amazing-fitness-app.herokuapp.com
Below are two dummy clients and two dummy instructor accounts
Instructor# 1
email: [email protected]
password: password
Instructor# 2
email: [email protected]
password: password
Client # 1
email: [email protected]
password: password
Client # 2
email: [email protected]
password: password
Action | Method | Route | Body |
---|---|---|---|
Register/Create | POST | /api/register | { name, email, password, is_instructor } |
Login | POST | /api/login | {email, password} |
{
name: 'string',
email: 'string',
password: 'string',
is_instructor: 'boolean'
}
{
email: 'string',
password: 'string',
}
{
"message": "welcome, Green Lantern",
"id": 4,
"email": "[email protected]",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0Ijo0LCJlbWFpbCI6ImdsQGRjLm9yZyIsImlzX2luc3RydWN0b3IiOmZhbHNlLCJpYXQiOjE2MjE3ODU5OTEsImV4cCI6MTYyMTg3MjM5MX0.Cjy0MedMrvLnIZ6PpOP5_co6BkRUau7eX-_oBtOiM8c",
"is_instructor": false
}
{
"message": "User successfully registered"
}
Action | Method | Route | Required |
---|---|---|---|
Fetch All Instructor Classes | GET | /api/classes | n/a |
Fetch All Classes by Instructor ID | GET | /api/classes/instID | append clientID to endpoint |
Add New Fitness Class | POST | /api/classes | see requirements below |
Deletes Fitness Class | DELETE | /api/classes/:id | append classID to endpoint |
Updates Fitness Class | PUT | /api/classes/:id | see requirements below + append classID to endpoint |
{
class_name: 'string'
class_type: 'string'
class_date: 'string'
start_time : 'string'
duration : 'number'
intensity: 'string'
location: 'string'
max_class_size: 'number'
instructor_id: 'number'
}
This will return an array of objects. Each object will contain the following information
{
"id": 4,
"class_name": "cardio-master",
"class_type": "cardio",
"class_date": "Friday",
"start_time": "11:00 am",
"duration": 45,
"intensity": "high",
"location": "living room",
"number_of_students": 1,
"max_class_size": 30,
"instructor_id": 2
},
{
"message": "You just added a bit of goodness to this world!"
}
{
"message": "class successfully updated!"
}
{
"message": "class successfully deleted!",
"deletedClass": {
"id": 5,
"class_name": "Never Again",
"class_type": "cardio",
"class_date": "Saturday",
"start_time": "4:00 am",
"duration": 60,
"intensity": "medium",
"location": "park",
"number_of_students": 1,
"max_class_size": 45,
"instructor_id": 1
}
}
Action | Method | Route | Required |
---|---|---|---|
Gets Fitness Classes By Client | GET | /api/clientclasses/:id | Append clientID to endpoint |
Sign Up for Classes | POST | /api/clientclasses | class_id is required |
Unenroll from Classes | DELETE | /api/clientclasses/:id | Append classID to the endpoint |
{
class_id: 'number'
}
{
"message": "You successfully signed up for Never again cardio alone"
}
{
"message": "You will no longer be participating in roomba-zoomba"
}