Compare commits

6 Commits

Author SHA1 Message Date
0b36de6705 Fix(backend): Updated README.md 2023-11-01 23:57:43 -04:00
8f3973c961 Fix(backend): format files to satisfy github CI 2023-11-01 23:52:46 -04:00
4e6f6f5e10 Merge branch 'backend' 2023-11-01 23:49:21 -04:00
0688648d75 Merge pull request #14 from minhtrannhat/frontend
Feat(backend): update deps
2023-09-09 00:33:02 -04:00
c8ba1f2676 Merge pull request #13 from minhtrannhat/frontend
Frontend completed
2023-09-04 17:27:13 -04:00
7611c9c2fa Merge pull request #12 from minhtrannhat/backend
Feat(Backend): Added docs to openAPI
2023-07-26 16:52:09 -04:00
3 changed files with 2 additions and 34 deletions

View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
# Backend Technical Write-up
## Steps
@@ -16,16 +15,6 @@
`blueprint`: a collection of route handlers/API functionalities.
## API route trailing slashes
API paths should end with a slash i.e: `/sessions/` rather than `/session`.
This is because requests sent to `/sessions` will be redirected to `/sessions/` whereas `/sessions/` won't get redirected.
## Difference between database schema and database model
- A schema defines the structure of data within the database.
- A model is a class that can be represented as rows in the database, i.e ID row, age row as class member.
## Managing user's sessions (Authentication)
- Login should results in a cookie being set in the user's browser, which is being sent in every subsequent request.
@@ -35,11 +24,6 @@ This is because requests sent to `/sessions` will be redirected to `/sessions/`
## Idempotent routes
Idempotence is a property of a route where the final state is achieved no matter how many times the route is called, that is, calling the route once or 10 times has the same effect. This is a useful property as it means the route can be safely retried if the request fails. For RESTful and HTTP APIs, the routes using GET, PUT, and DELETE verbs are expected to be idempotent.
||||||| 3c78fe9
=======
# Backend Technical Write Up
## General Bits of Information
### SameSite setting
@@ -53,10 +37,6 @@ Pydantic is to validate the schema/the shape of our input/output (works with JSO
Class full of data. Meant to be used to serialize data into JSON objects.
### Quart specific terminologies
`blueprint`: a collection of route handlers/API functionalities.
### API route trailing slashes
API paths should end with a slash i.e: `/sessions/` rather than `/session`.
@@ -66,14 +46,3 @@ This is because requests sent to `/sessions` will be redirected to `/sessions/`
- A schema defines the structure of data within the database.
- A model is a class that can be represented as rows in the database, i.e ID row, age row as class member.
### Managing user's sessions (Authentication)
- Login should results in a cookie being set in the user's browser, which is being sent in every subsequent request.
The presence and value of this cookie are used to determine whether the member is logged in, and which member made the request.
- Logout results in the cookie being deleted.
### Idempotent routes
Idempotence is a property of a route where the final state is achieved no matter how many times the route is called, that is, calling the route once or 10 times has the same effect. This is a useful property as it means the route can be safely retried if the request fails. For RESTful and HTTP APIs, the routes using GET, PUT, and DELETE verbs are expected to be idempotent.
>>>>>>> master

View File

@@ -1,7 +1,6 @@
from quart import Blueprint, render_template, ResponseReturnValue
from quart import Blueprint, ResponseReturnValue, render_template
from quart_rate_limiter import rate_exempt
blueprint = Blueprint("serving", __name__)

View File

@@ -21,9 +21,9 @@ from quart_schema import QuartSchema, RequestSchemaValidationError
# Each blueprint is a logical collection of features in our web app
from backend.blueprints.control import blueprint as control_blueprint
from backend.blueprints.members import blueprint as members_blueprint
from backend.blueprints.serving import blueprint as serving_blueprint
from backend.blueprints.sessions import blueprint as sessions_blueprint
from backend.blueprints.todos import blueprint as todos_blueprint
from backend.blueprints.serving import blueprint as serving_blueprint
# For making sure error responses are in JSON format
from backend.lib.api_error import APIError