-
Notifications
You must be signed in to change notification settings - Fork 1
API Documentation
These api routes can be found in server/index.js
/api/projects
: A call to this api queries every project's numerical ID, name, github url, categories it's getting scored for, table number, and wave from the projects table.
/api/apis
: A call to this api queries the name and type of every judging category from the apis table.
/api/project-tables-waves
: A call to this api queries the name, wave, and table name of every project from the projects table.
/api/judgenames
: A call to this api queries the numeric ID and name of every judge from the judges table.
/api/scored/judge/:judgeId
: A call to this api queries the numerical ID, name, the applicable categories, github url, table name, wave, and score(s) of every scored project a particular judge has to judge from the projects table joined with the scores table by the project ID. By calling DISTINCT ON (projects.projectID)
, it is guaranteed that only unique projects will be returned. The judge ID passed into the query filters for the projects assigned to the particular judge.
/api/unscored/judge/:judgeId
: A call to this api queries the numerical ID, name, the applicable categories, github url, table name, wave, and score(s) of every unscored project a particular judge has to judge from the projects table joined with the scores table by the project ID. By calling DISTINCT ON (projects.projectID)
, it is guaranteed that only unique projects will be returned. The judge ID passed into the query filters for the projects assigned to the particular judge.
/api/categories/judge/:judgeId/project/:projectId
: A call to this api queries the list of categories that a project is to be given a score for and the scores for each from the scores table specific to the judge and the project being scored.
/api/judgeinfo
: A call to this api queries every judge's numeric ID and name and the api or category the judge is responsible for scoring from the judges table.
/api/judgenames
: A call to this api queries the names of every judge from the judges table.
/api/scores
: A call to this api queries every score from the scores table, where each row specifies which judge gave what score for which project for which category using judge ID and project ID.
/api/winners
: A call to this api queries every unique category from the scores table ordered by category. It then filters through the data to select every entry from the scores table for each retrieved category which includes the judge ID, project ID, category, and scores and lists them in descending order. Then for every retrieved entry, it selects the name of the project from the projects table by the project ID, and the name of the judge from the judges table by the judge ID. It finally returns a list for each category containing entries with the project name, the judge name, and the score for that category in descending order of the scores.
/api/apis
: A call to this endpoint will insert into a row into the "apis" table for every api (or judging category) contained in the request body. Each row has an API's name and corresponding type (general or API).
/api/projects
: A call to this endpoint will insert a row into the "projects" table for every project contained in the request body. Each row has a project's name and its corresponding submission URL and category.
/api/judginfo
: A call to this endpoint will insert a row into the "judges" table for every judge contained in the request body. Each row has a judge's name and corresponding API that he/she is judging for. If a judge is judging multiple APIs, he/she will have multiple entries in the "judges" table, one corresponding to each of those APIs.
/api/assignjudges
: A call to this endpoint sorts through and finds all the judges, categories/apis, and projects in their respective tables. The helper function getApiMapping
takes in a list of 2 JSON objects (apis and judges) and creates a new JSON that maps each api to a list of judges that are responsible for judging that category/api. This mapping is then used to assign a judge to each category that a project is required to be judged for. For example, is a project is to be judged for 2 APIs, Google Vision and Amazon Web, and 2 general categories, Best App and Best Hack, then the project would be assigned 3 judges (one general category judge would be assigned to both general categories and one api judge to each api). This function assumes that for any project, each of it categories will only be assigned one judge. The function then posts a row for each judge to each project's categories in the scores table.
/api/deletejudge
: A call to this endpoint will delete a row from the "judges" table. The row deleted will be the one that matches the judge name and API contained in the request body.
/api/projects
: A call to this endpoint will update projects in the projects table with a new wave number, unique project ID, and a table number.
/api/scoreupdate/judge/:judgeId/project/:projectId/category/:category
: A call to this endpoint will update the score for a project with the given projectId
for a certain category designated by category
in the scores table.