- The base URL for the API is
http://localhost:3001
unless you configure it differently.
- the score is calculated as follows :
- we only consider tutors who teach the same subject for the same grade.
- if the tutor has slots avaiable in days that will be sufficent for the number of classes gets 10 points
- for each class if the tutor has sufficent slots for the duration and in the prefered time and prefered day gets 15 points
- for each class if the tutor has sufficent slots for the duration prefered day but not in the prefered time and gets 10 points
- They both work with the same algorithm the only diffrence is how each one gets the student prefrences.
- The AI mode uses openAI version 4 with the new function calling capbilties which is utilized here to create the studentPrefrences JSON with good acuracy.
- Subjects are enumed to maths,arabic,science .
- The start and end time refer to the start and end of the prefered time in 24h format.
- Endpoint:
POST /match
- Description: Matches tutors based on student preferences.
- Request Payload:
{ "subject": "maths", "grade": 10, "classes": [ { "duration": 1, "prefTime": [ { "day": "monday", "slots": [14, 15] }, { "day": "wednesday", "slots": [16, 17] } ] }, // Additional class preferences... ] }
- Response:
{ "matchedTutors": [ { "tutor": { "name": "John Doe", "subject": "maths", "grades": [10], "availability": [...] }, "fitScore": 75 }, // Additional matched tutors... ] }
- Endpoint:
POST /ai
- Description: Uses GPT to generate student preferences based on user input.
- Request Payload:
{ "message": "Generate student preferences for a math class." }
- Response:
{ "matchedTutors": [ { "tutor": { "name": "Jane Doe", "subject": "maths", "grades": [10], "availability": [...] }, "fitScore": 80 }, // Additional matched tutors... ] }
- Endpoint:
POST /addToFav
- Description: Adds a tutor to the student's favorites.
- Request Payload:
{ "studentName": "Alice", "tutorName": "John Doe", "fitScore": 75 }
- Response:
{ "studentName": "Alice", "tutorName": "John Doe", "fitScore": 75, "_id": "5f25d18aa08be327882bf84e", "__v": 0 }
- Represents information about a tutor.
{ "name": "John Doe", "subject": "maths", "grades": [10], "availability": [ { "day": "monday", "slots": [14, 15] }, { "day": "wednesday", "slots": [16, 17] } ] }
- Represents student preferences for matching tutors.
{ "subject": "maths", "grade": 10, "classes": [ { "duration": 1, "prefTime": [ { "day": "monday", "slots": [14, 15] }, { "day": "wednesday", "slots": [16, 17] } ] } ] }
- Represents a tutor added to a student's favorites.
{ "studentName": "Alice", "tutorName": "John Doe", "fitScore": 75 }
- If an error occurs, the API will respond with an appropriate status code and an error message.
- Make sure to replace the base URL with the actual URL where the API is hosted.
- Always check the API documentation for any updates or changes.