Skip to content

Backend server for the Knight Life suite

Notifications You must be signed in to change notification settings

Spud304/knightlife-api

 
 

Repository files navigation

Knight Life API

v2.0 Documentation

The following will provide as a brief description of all callable API routes, as well as their general purpose, required parameters, and response. A more in-depth guide will be available soon.

Schedule Routes

Schedule Template

Path: /schedule/template
Purpose: Returns the default BB&N schedule

Request:
Method: GET
Headers: None Required
Body: None Required
Params: None Required
Response:
Returns a list of Days, identified by IDs, and a list of blocks available on those days.

Schedule for Specific Date

Path: /schedule
Purpose: Returns the schedule for a given day.

Request:
Method: GET
Headers: None Required
Body: None Required
Params:
  - date (YYYY-MM-dd)
Response:
Returns a list of blocks occurring on the given `date`. Additionally provides a list of notices to display to the user.

Next Schoolday

Path: /schedule/next
Purpose: Fetches the next Date with blocks available.

Request:
Method: GET
Headers: None Required
Body: None Required
Params:
  - date (YYYY-MM-dd) (this will typically be today's date)
Response:
Returns the Date and Schedule for the next day of school after the given `date`.

Retrieve Special Schedules

Path: /schedule/special
Purpose: Retrieves all upcoming special schedules for the next month.

Request:
Method: GET
Headers: None Required
Body: None Required
Params:
  - date (YYYY-MM-dd) (this will typically be today's date)
Response:
Returns a list of schedules (and dates) across the next 28 days that have irregular block schedules or notices available for the user. This route is commonly accessed to display upcoming irregular schedule items.

Lunch Routes

Retrieve Date Lunch Menu

Path: /lunch
Purpose: Retrieves the Lunch menu for a given date.

Request:
Method: GET
Headers: None Required
Body: None Required
Params:
  - date (YYYY-MM-dd)
Response:
Returns a list of Foods, denoted by a name and nullable allergy, and a nullable menu title. This list of foods will be empty if there has been no menu inputted.

Event Routes

Retrieve Date Events

Path: /events
Purpose: Retrieves all events for a given date.

Request:
Method: GET
Headers: None Required
Body: None Required
Params:
  - date (YYYY-MM-dd)
Response:
Returns a list of Events occurring on the given `date`.

Misc. Routes

Upcoming Items

Path: /upcoming
Purpose: Retrieves all upcoming events, schedule changes, and notices.

Request:
Method: GET
Headers: None Required
Body: None Required
Params:
  - date (YYYY-MM-dd)
Response:
Returns a compiled list of all Upcoming Items, sorted by date. These are of three types: Event, Schedule Change, Notice. There can be multiple Items for a single date.

DEVELOPMENT ENVIRONMENT HOWTO

  1. Install Docker Desktop. https://www.docker.com/products/docker-desktop

  2. At the terminal, build the images, export the root certificate for installing into the iOS simulator, then launch the containers.

$ cd knightlife-api
$ docker-compose build
$ docker/genca/export_ca.sh
$ docker-compose up
  1. Open a Finder window, navigate to /Users/[you]/tempCA, and drag rootCA.cer to the Simulator window.

  2. The simulator will tell you to finish installing it in Settings. Navigate to Settings > About > Certificate Trust Settings and install.

About

Backend server for the Knight Life suite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.8%
  • Dockerfile 1.8%
  • Shell 0.4%