/
API

API

clearly, we do all of this so we can talk to the people on the front-end, right? So, to do this, we have an API that is used to make our algorithms useful.

Note: for returners - there has been some slight turbulence here. As we approach our deployment, we will need to stop making breaking changes here. If a breaking change is made in the API, the back-end developer is responsible for fixing everything they break.

its split broadly into 3 sections:

  • planner

  • courses

  • programs

Planner

this is a route containing only a single function: ValidateTermPlanner. This route is used to check every course passed to us and simulate a user taking these courses, a term at a time. We generate warnings/errors to determine whether or not such a course should be able to be taken at that time.

This is seperated because it is both quite complex and doesnt fit neatly into either courses or programs

Courses

this has functions that are to do with courses. The most interesting of these are:
courses/getPathFrom/

this gives us what courses are able to be used to get to this course. This, in conjunction with courses/isBeneficial, are used to generate our graphical view.

courses/getAllUnlocked/

this takes a user and passes it through all the conditions objects to return the state of each one.

Programs

these are functions to do with specialties and programs

The most interesting of these is:

programs/getStructure/

this is to fetch the entire structure of a student, given their program code, and optionally their major and minor.

to do this, we explore the specialisations for their major and minor and add this, then add all the “containers“ that are relevant for their course.

We will eventually need to flush this out with an “abstract“ structure and “courses in structure“ type differentiation, but we will get to that later.

NOTE: containers is an important concept in the handbook. A container is an entity which contains many other entities, of which you need to complete some number of them. For example, a container can be “core courses.“ This contains all the courses that are core for a major. Another is “Discipline electives“ and so on.

Related content