Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
syuChen1 committed Apr 21, 2022
1 parent 36c3f63 commit 8fdb588
Show file tree
Hide file tree
Showing 32 changed files with 39,887 additions and 9,746 deletions.
41 changes: 16 additions & 25 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Server

> Web server and application server that will serve static content and dynamic content over HTTP. It is powered by [Node](https://nodejs.org/en/), [Strapi](https://strapi.io/documentation/v3.x/getting-started/introduction.html), and [PostgreSQL](https://www.postgresql.org/). The file structure is defined by Strapi and is documented [here](https://strapi.io/documentation/3.0.0-beta.x/concepts/file-structure.html#files-structure).
> Web server and application server that will serve static content and dynamic content over HTTP. It is powered by [Node](https://nodejs.org/en/), [Strapi](https://strapi.io/documentation/v3.x/getting-started/introduction.html), and [PostgreSQL](https://www.postgresql.org/). The file structure is defined by Strapi and is documented [here](https://docs-v3.strapi.io/developer-docs/latest/setup-deployment-guides/file-structure.html).
<br/>

Expand All @@ -19,7 +19,7 @@

## Static Assets

All assets in the **public** directory will be served. The specifics are defined [here](https://strapi.io/documentation/v3.x/concepts/public-assets.html).
All assets in the **public** directory will be served. The specifics are defined [here](https://docs-v3.strapi.io/developer-docs/latest/setup-deployment-guides/configurations.html#public-assets).

### Client

Expand All @@ -35,39 +35,22 @@ The [proxy](/server/middlewares/proxy/index.js) middleware handles serving **cli
### Documentation

The latest API documentation is available on [Postman](https://documenter.getpostman.com/view/3570478/SztBboUJ). You can view example request/responses and even save the collection to your local Postman workspace.
The latest API documentation is available on [Strapi Documentation](http://localhost:1337/documentation/v1.0.0) after you started your local development. You can view example request/responses and test it with your jwt token.

### Authentication

Mentors use the `local` provider routes, `/auth/local` and `/auth/local/register`, to login and register. Students login by joining a session with the route `/sessions/join/:code`. In both cases, a JWT will be issued on a successful response. Subsequent requests will need to send this JWT as a `Bearer` token. Read more about that [here](https://strapi.io/documentation/v3.x/plugins/users-permissions.html#authentication).
Mentors use the `local` provider routes, `/auth/local` and `/auth/local/register`, to login and register. Students login by joining a session with the route `/sessions/join/:code`. In both cases, a JWT will be issued on a successful response. Subsequent requests will need to send this JWT as a `Bearer` token. Read more about that [here](https://docs-v3.strapi.io/developer-docs/latest/development/plugins/users-permissions.html#concept).

> The [permissions](/cms/extensions/users-permissions/config/policies/permissions.js) policy is run as a middleware on all requests. It will pull the user and their role, which will be executed against the respective policy. Custom logic has been added to handle student JWTs as student auth is not apart of the `/auth` controller group.
> The [permissions](./extensions/users-permissions/config/policies/permissions.js) policy is run as a middleware on all requests. It will pull the user and their role, which will be executed against the respective policy. Custom logic has been added to handle student JWTs as student auth is not apart of the `/auth` controller group.
### Entity Relationships

![ER Digram](er_diagram.png)
![ER Digram](er_diagram.PNG)

### Endpoints

Each endpoint corresponds to an entity from the ER digram, a content type in the admin panel, a folder in the `./api` directory, and a database table.

| Endpoint |
| ------------------- |
| activities |
| blocks |
| blocks-categories |
| classrooms |
| complexities |
| difficulties |
| learning-categories |
| mentors |
| models |
| schools |
| sessions |
| students |
| topics |
| types |

Each and every endpoint can be interacted with by using the following method and path combinations.

| Method | Path | Description |
Expand All @@ -79,7 +62,15 @@ Each and every endpoint can be interacted with by using the following method and
| DELETE | /{endpoint}/:id | Delete an entry |
| PUT | /{endpoint}/:id | Update an entry |

Read the full [documentation](https://strapi.io/documentation/3.0.0-beta.x/content-api/api-endpoints.html#api-endpoints) on the api endpoints.
Read the full [documentation](https://docs-v3.strapi.io/developer-docs/latest/development/backend-customization.html#routing) on the api endpoints.

<br/>

## Strapi Plugins

We intergrated the Stapi [Email](https://docs-v3.strapi.io/developer-docs/latest/development/plugins/email.html#programmatic-usage) Plugin with [SendInBlue](https://www.sendinblue.com/) to send Bug report and forgot password emails.

We also uses Strapi [Documentation](https://docs-v3.strapi.io/developer-docs/latest/development/plugins/documentation.html) Plugin to document our backend api end point as well as testing it on the fly.

<br/>

Expand All @@ -89,5 +80,5 @@ Built with [React](https://reactjs.org/) and served by [Node](https://nodejs.org

> In some cases /admin may be blank, in this case `yarn build` needs to be run from the docker container
Read the full [documentation](https://strapi.io/documentation/v3.x/admin-panel/customization.html) on the admin panel.
Read the full [documentation](https://docs-v3.strapi.io/developer-docs/latest/development/admin-customization.html) on the admin panel.

Loading

0 comments on commit 8fdb588

Please sign in to comment.