Skip to content

UPE Database API Design Doc

Huy Tran edited this page Nov 16, 2022 · 7 revisions

Overview

  • Status: In Progress

The UPE Database API is intended to introduce the SQL Database offered by the OCF to various UPE projects. For the UPE website, this API will be used to get data for the new family tree.

Context

Goal

Experiment with integrating a database to a UPE project to avoid limitations with the Google Sheets API.

Problem

  1. Google Sheets API limits the number of requests that can be made in a certain period of time. If there are multiple people at trying to interact with a UPE project (e.g. SlackBot's Gacha Game) at the same time, there would be an error.
  2. Using a database reduces the number of random sheets that not too many people need access to.
  3. We are not currently making use of a valuable resource that is free to us.

Out of Scope

  1. Adding database support for every UPE project

Design

Database Design

Relevant Information

Engine: MySQL (MariaDB)

Max DB Size: 1 GB (requested by the OCF)

Table Size: 256 MB (general guideline)

Schema

CREATE TABLE upe (

email TEXT PRIMARY KEY NOT NULL;

name TEXT NOT NULL;

position TEXT;

committee TEXT;

);

Primary Key: email or CalNet ID (first part of email)

Positions will be enums: candidate, member, officer, internal-vp, external-vp, executive-vp, finance-vp, president, + more exec?

Committees will be enums: indrel, comrel, profdev, social, softdev, exec

API Documentation

Swagger UI Documentation found at: /docs

ReDoc Documentation found at: /redoc

GET /members

GET /members/{memberId}

PUT /members/{memberId}

POST /members

DELETE /members/{memberId}

POST /members/search

GET /candidates

GET /candidates/{candidateId}

PUT /candidates/{candidateId}

POST /candidates

DELETE /candidates/{candidateId}

POST /candidates/search

GET /members

GET /members/{memberId}

PUT /members/{memberId}

POST /members

DELETE /members/{memberId}

POST /members/search

GET /officers

GET /officers/{officerId}

PUT /officers/{officerId}

POST /officers

DELETE /officers/{officerId}

POST /officers/search

Clone this wiki locally