- Route
/
: home page of the site. For non-logged in users it allows the display of the list of courses provided; for logged-in users, in addition to it, it allows the management of the study plan - Route
/login
: autentication page for a student, after this, the viewing and modification of study plans will be enabled. - Route
/* (404)
: page displayed when trying to reach an invalid route
- Login
- URL:
/api/login
- HTTP Method: POST
- Description: Authenticate the user
- Request body:
{
"username" : "s123456@polito.it",
"password" : "password"
}
- Response:
200 OK
(success) - Response body:
{
"ID": "123456",
"NAME": "Marco",
"SURNAME": "Chessa",
"EMAIL": "s123456.rossi@polito.it",
"TYPE": "1"
}
- Logout
- URL:
/api/logout
- HTTP Method: POST
- Description: Logout of logged user
- Request body: None
- Response:
200 OK
(success) or400 Bad Request
(not authenticated) - Response body: None
- Error response:
For 400 Bad Request status:
{
"message": "Not authenticated"
}
- Get all courses
- URL:
/api/courses
- HTTP Method: GET
- Description: Return the list of the courses provided of the university
- Request body: None
- Response:
200 OK
(success) or500 Internal Server Error
(generic error) - Response body:
[
{
"ID": "02GOLOV",
"NAME": "Architetture dei sistemi di elaborazione",
"CREDIT": 12,
"STUDENT": 1,
"MAXSTUDENT": 3,
"PREPARATORY": "01SQMOV",
"INCOMPATIBLE": ["01SQLOV", "02GRSOV"],
"SUCCESSIVE": ["03GRSOV", "01LPLOV"]
},
{
"..."
}
]
- Get a plan of a student
- URL:
/api/plan
- HTTP Method: GET
- Description: Return the study plan list of the logged student
- Request body: None
- Response:
200 OK
(success) or500 Internal Server Error
(generic error) or400 Bad Request
(not authenticated) - Response body:
[
{
"ID": "02GOLOV",
"NAME": "Architetture dei sistemi di elaborazione",
"CREDIT": 12,
"STUDENT": 1,
"MAXSTUDENT": 3,
"PREPARATORY": "01SQMOV",
"INCOMPATIBLE": ["01SQLOV", "02GRSOV"],
"SUCCESSIVE": ["03GRSOV", "01LPLOV"]
},
{
"..."
}
]
- Error response:
For 400 Bad Request status:
{
"message": "Not authenticated"
}
- Insert new plan
- URL:
/api/plan/
- HTTP Method: POST
- Description: Create a new study plan
- Request body:
{
"ID": "02GOLOV",
"NAME": "Architetture dei sistemi di elaborazione",
"CREDIT": 12,
"STUDENT": 1,
"MAXSTUDENT": 3,
"PREPARATORY": "01SQMOV",
"INCOMPATIBLE": ["01SQLOV", "02GRSOV"],
"SUCCESSIVE": ["03GRSOV", "01LPLOV"]
},
{
"..."
}
- Response:
201 OK
(success) or503 Internal Server Error
(generic error) or400 Bad Request
(not authenticated) or422 Unprocessable Entity
or404 Not Found
(one o more courses doesn't exist) - Response body: None
- Error response:
For 422 Unprocessable Entity:
{
"err": "Not enough slots in 02GOLOV"
}
- Modify a plan
- URL:
/api/plan/
- HTTP Method: PUT
- Description: Edit the study plan (insert new corses and/or delete courses) of the logged student
- Request body:
{
"ID": "02GOLOV",
"NAME": "Architetture dei sistemi di elaborazione",
"CREDIT": 12,
"STUDENT": 1,
"MAXSTUDENT": 3,
"PREPARATORY": "01SQMOV",
"INCOMPATIBLE": ["01SQLOV", "02GRSOV"],
"SUCCESSIVE": ["03GRSOV", "01LPLOV"]
},
{
"..."
}
- Response:
201 OK
(success) or503 Internal Server Error
(generic error) or400 Bad Request
(not authenticated) or422 Unprocessable Entity
or404 Not Found
(one o more courses doesn't exist) - Response body: None
- Error response:
For 422 Unprocessable Entity:
{
"err": "Not enough slots in 02GOLOV"
}
For 400 Bad Request status:
{
"message": "Not authenticated"
}
- Delete a plan
- URL:
/api/plan/
- HTTP Method: DELETE
- Description: Delete the study plan of the logged student
- Request body: None
- Response:
204 No Content
(success) or503 Internal Server Error
(generic error) or or404 Not found
(one o more courses doesn't exist) or400 Bad Request
(not authenticated) or422 Unprocessable Entity
- Response body: None
- Error response:
For 400 Bad Request status:
{
"message": "Not authenticated"
}
- Get career list
- URL:
/api/careers
- HTTP Method: GET
- Description: Return the career of the logged student
- Request body: None
- Response:
200 OK
(success) or500 Internal Server Error
(generic error) - Response body:
[
{
"ID": 1,
"NAME": "part-time",
"MINCREDIT": 20,
"MAXCREDIT": 40,
}
,
{
"ID": 2,
"NAME": "full-time",
"MINCREDIT": 60,
"MAXCREDIT": 80,
}
]
- Error response:
For 400 Bad Request status:
{
"message": "Not authenticated"
}
- Get career type of a student
- URL:
/api/career
- HTTP Method: GET
- Description: Return the career of the logged student
- Request body: None
- Response:
200 OK
(success) or500 Internal Server Error
(generic error) or400 Bad Request
(not authenticated) - Response body:
{
"TYPE": 2
}
- Error response:
For 400 Bad Request status:
{
"message": "Not authenticated"
}
- Table
STUDENT
- contains ID, NAME, SURNAME, EMAIL, SALT, HASH, TYPE- Contains the set of students enabled on the platform
- Table
PLAN
- contains IDSTUDENT, IDCOURSE- Contains the set of courses for each student, grouped at the abstract level as a study plan
- Table
COURSE
- contains ID, NAME, CREDIT, STUDENT, MAXSTUDENT, PREPARATORY- Contains the set of courses provided by the university with related information including preparatory courses
- Table
INCOMPATIBLE
- contains IDCOURSE, IDCOURSEINC- Contains the set of incompatible courses for each reference course
- Table
CAREER
- contains ID, NAME, MINCREDIT, MAXCREDIT
-
HomeLayout
(inApp.js
): it contains all the fundamental components which are displayed dynamically according to the user's and study plan's state. On each page you can expand the row to view additional details. -
NavigationBar
(inApp.js
): contains the app logo that allow to go back to the homepage from any situation, the student information and buttons to login/logout -
CourseTable
(inCourseTable.js
): contains the list of courses provided byCourseRow
-
CourseRow
(inCourseRow.js
): contains information about a particular course, via the info button will display the incompatible and preparatory courses by expanding the row. In case of incompatable courses or full slots the row will have a red background and therefore cannot be added, with the associated error message. Finally through the button you can proceed to both insert and remove the course from the study plan (the text of the inserted course will be green) -
AuthComponent
(inAuthComponent.js
): contains the form to allow login with appropriate controls and alert message -
StudyPlanForm
(inStudyPlanForm.js
): contains the enrollment form for a study plan, allows the choice between full and part time through buttons -
StudyPlanTable
(inStudyPlanTable.js
): contains the set ofStudyPlanRow
with a counter for the number of credits and the valid credit range for the chosen career type. It also contains the "Cancel" button to undo the changes made to the career and the "Save" button to store the study plan in the database (in case of errors an alert will be generated below). In the case of an existing study plan it contains the "Delete" button to delete the entire plan and reset the career to its initial state. -
StudyPlanRow
(inStudyPlanRow.js
): contains the information for a particular course andCourseAction
related to the removal of it or the related alert if it cannot be removed. -
Error
(inError.js
): shows information about a page not found and allow to retun to homepage
(only main components, minor ones may be skipped)
USER | PASSWORD |
---|---|
s123456@polito.it |
password |
s234567@polito.it |
password |
s345678@polito.it |
password |
s456789@polito.it |
password |