diff --git a/README.md b/README.md index b294e1d..be4663a 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,20 @@ ## Frontend -### Development dependencies +### Development Workflow -- `prettier`: Formatter +- Format, lint and test with `npm run {format, lint, test}`. + +### Dependencies + +- React +- React helment async: manage changes to document head. +- Material UI +- Roboto font ## Backend -### Development workflow +### Development Workflow - Run `eval (pdm venv activate in-project)` (if you are using Fish shell) or `eval $(pdm venv activate in-project)` (if you are using bash/zsh) at the `backend` folder root to get into the backend python virtual environment. - Run tests, lints, formats with `pdm run {test, lint, format}`. @@ -38,29 +45,3 @@ #### Miscs Dev-deps - `djhtml`: Generate jinja templates html for emails. - -### Backend Technical Write-up - -#### 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`. -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. - 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. diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000..727926d --- /dev/null +++ b/backend/README.md @@ -0,0 +1,36 @@ +# Backend Technical Write-up + +## Steps + +- Initial infrastructure +- Rate Limiting +- JSON error handling +- Req/Res schema validation +- Setup database +- Database schema/models +- Usersessions +- CRUD routes functionalities + +## 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`. +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. + 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.