Backend Server for OwlCounselor
- Install dependencies
npm install
- Start server
npm run start
- Course
class Course {
id: String,
name: String,
sem: Number, // 0 - Fall, 1 - Spring, 2 - Both
prereq: [[String]], // List of Course.id
time: {
day: (startTime, endTime)
}
}
-
Description
-
URL
/api/courses
-
Method:
POST
-
URL Params
Required:
Name Type Description major String the major degree Number the type of degree 0 - BA, 1 - BS -
Success Response:
-
Code: 200
Content:{ "courses": [ { "id": "1001", "name": "COMP 140", }, { "id": "1002", "name": "COMP 182", }, { "id": "1003", "name": "COMP 215", }, ], }
Name Type Description id string CRN of the class name string name of the class
-
-
Error Response:
-
Sample Call:
-
Description
-
URL
/api/getstartpoint
-
Method:
POST
-
URL Params
Required:
Name Type Description major String the major degree Number the type of degree 0 - BA, 1 - BS sem Number the user's most recently semester 0 - 7 taken array an array of already taken classes Content
{ "major": "Computer Science", "degree": 1, "semester": 3, "taken": [ "COMP140", "COMP182", "COMP215", "COMP431" ] }
-
Success Response:
-
Code: 200
Content:{ "valid": "true/false", "message": "Success/Failure message", "courses": [ { "name": "COMP 140", "taken": 0, // -1 = not taken, 0 - 7 semester already taken "sems": [0, 1, 2], }, { "name": "COMP 182", "taken": -1, "sems": [1, 3], }, { "name": "COMP 215", "taken": -1, "sems": [2, 4], }, ], }
Name Type Description id string CRN of the class name string name of the class taken number the semester the class has been taken in. -1 if not yet taken sems number the valid semesters to take this class
-
-
Error Response:
-
Sample Call:
-
Description
TODO.
-
URL
/api/valid
-
Method:
POST
-
URL Params
Required:
Name Type Description major String the major degree Number the type of degree 0 - BA, 1 - BS sem Number the user's most recently semester 0 - 7 taken array an array of already taken classes Content
{ "major": "Computer Science", "degree": "BS", "sem": 4, "taken": [ { "id": "1003", "name": "COMP 140", "taken": 0, } ] }
-
Success Response:
Code: 200
Content:{ "courses": [ { "name": "COMP 140", "taken": 0, // -1 = not taken, 0 - 7 semester already taken "sems": [0, 1, 2], }, { "name": "COMP 182", "taken": -1, "sems": [1, 3], }, { "name": "COMP 215", "taken": -1, "sems": [2, 4], }, ], }
Name | Type | Description |
---|---|---|
valid | boolean | result of validation check |
-
Error Response:
-
Sample Call: