Skip to content

Latest commit

 

History

History
104 lines (89 loc) · 4.85 KB

FeatureSpec.md

File metadata and controls

104 lines (89 loc) · 4.85 KB

Feature Specification

Feature Information

Key Value
Feature Name Plan-At Server
Area Backend
Related Features REST API
Document Location https://github.com/Plan-At/PlanAt-Server-FastAPI
Spec Status Finished

Contact Information

Role Name
Manager Chad Magendanz
Developer

Revision Summary

Author Date Version Comment
- 04/19/2022 Initial Draft Created this page
- 05/11/2022 Update to add more major points
- 05/20/2022 Add description for new module
- 06/17/2022 Finish most of them

Functional Specification

backend server for Plan-At. Developed with the idea of "API First" to allow multiple variation of frontend/client

Scenario Description

Feature Description

Sections of the project:

  1. Framework Selection: For the framework, we wanted a framework that's easy to use and shorten development cycle; Python can produce some results with the fewest lines of code; the FastAPI was created with the idea of "Asynchronous Server Gateway Interface", and as its name, it has relative better performance than other Python based web framework, and we don't really need this server to render actual HTML page. As a result, the dev solely decide to choose FastAPI and set up an environment and repo to began development.
  2. Project Breakdown: Our next step was to break down our project into multiple packages, and the priority is to provide some mock data for the frontend team.
  3. Iteration: After developed several feature sets, we will teach the frontend how to use it, collect feedback and feature request to make the backend easier to use
  4. After period of development, while we're getting more functionality, the code are getting messier, so we rewrite most of the code

Modules

User Profile:

Having the following information:

  • Profile Picture
  • Contact Information
  • Brief Description And account deletion that could easily erase everything created this this user

Calendar Event:

The core of this project, contains:

  • Name and description
  • Starting time and ending time, stored as timestamp, with field for timezone attribute
  • Access Control List (ACL), that set permission for multiple user and each user can have different permission

Login method:

While static password is the first and default method, after registration user can opt in other methods

  • Time-Based OPT (Authenticator)

API Documentation:

The framework FastAPI we're using come with native support of OpenAPI, which including interactive interface with minial amount of explanation about how to use the API like Swagger UI and Redoc and try-out these endpoints without worrying about CORS image

System Design

Network Structure

To safeguard our infrastructure, we implemented multiple relay and firewall, this design will slightly increase in response delay but likely unnoticeable

Security Measurement

Since all of our operation are REST API based, each time interact will require send token, if the token expired or being revoked, it's not going to work anymore.

V2 Endpoint

After period of development, while we're getting more functionality, the code are getting messier, so it's time to rewrite some of these code

  • Break code into smaller file by utilize the Router API
  • New URL scheme that describe the action of this endpoint at the end; combined public and private endpoint, authenticate based on the token passed-in; if the request modify any existing data then its POST request, GET is read-only
  • Performance is the priority now; using direct native connection to the database achieved resulted the lowest API latency to enjoy the benefit of within same cloud-region, optimized query to reduce overhead

Boneyard

Delayed Features

Tagging

Might not a significant feature

Schedule Comparison

Since we're still struggling with calendar for just single user

Permanently Death

SQL Database

Somewhat complicated to make SQL query for the data-structure I already made but seamlessly works with Document-Base NotOnlySQL database, plus can immune common SQL-Injection attack