Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 7497e3f

Browse files
doc: api decks
1 parent 1b8d4c5 commit 7497e3f

File tree

1 file changed

+58
-10
lines changed

1 file changed

+58
-10
lines changed

studio/docs/api.md

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## List of endpoints
44

5-
| Endpoint | Guard | Details | Frontend`*` | Backend`*` |
6-
|---|---|---|---|---|
7-
| login | X | [Link](#login) | | |
8-
| logout | X | [Link](#logout) | | |
9-
| decks | X | | | |
10-
| slides | X | | | |
11-
| publish | X | | | |
12-
| feed | | | | |
5+
| Endpoint | Guard | Details | Frontend`*` | Backend`*` | Notes |
6+
|---|---|---|---|---|---|
7+
| login | X | [Link](#login) | | | |
8+
| logout | X | [Link](#logout) | | | |
9+
| decks | X | [Link](#decks) | POST PUT | POST PUT | Meta still TODO |
10+
| slides | X | | | | |
11+
| publish | X | | | | |
12+
| feed | | | | | |
1313

1414
`*`: already implemented in
1515

@@ -19,8 +19,9 @@
1919
|-------------|-------------|
2020
| Title | Login |
2121
| Description | Verify Google ID Token, create or update user, convert anonymous data to "real" user |
22+
| URL | /login |
2223
| Reference | [https://firebase.google.com/docs/auth/admin/verify-id-tokens](https://firebase.google.com/docs/auth/admin/verify-id-tokens) |
23-
| Method | Post |
24+
| Method | POST |
2425
| Body | token (?) |
2526
| Success Response | `{backend_token: string}` |
2627

@@ -29,6 +30,8 @@
2930
```
3031
export interface User {
3132
token: string;
33+
34+
backend_token: string;
3235
3336
anonymous: boolean;
3437
@@ -42,6 +45,10 @@ export interface User {
4245
}
4346
```
4447

48+
* Questions:
49+
50+
- in the definition add `backend_user_id`?
51+
4552
* Notes
4653

4754
- If *verify-id-tokens* from Google doesn't return user data on the backend side, user data has to be provided as body of the request
@@ -54,10 +61,51 @@ export interface User {
5461
|-------------|-------------|
5562
| Title | Logout |
5663
| Description | Invalidate backend token |
57-
| Method | Post |
64+
| URL | /logout |
65+
| Method | POST |
5866
| Body | token (?) |
5967

6068
* Notes
6169

6270
- should we also add a status on the user data and therefore set the status to `inactive` or else on logout?
6371

72+
### Decks
73+
74+
| <!-- --> | <!-- --> |
75+
|-------------|-------------|
76+
| Title | Decks |
77+
| Description | The decks, the presentation entities |
78+
| URL | /decks |
79+
| Method | POST PUT DELETE |
80+
| Body | see sample |
81+
82+
* Sample
83+
84+
```
85+
export interface Meta {
86+
meta_id?: string;
87+
88+
description?: string;
89+
author?: string;
90+
91+
image_url?: string;
92+
93+
created_at: Date;
94+
updated_at: Date;
95+
96+
}
97+
98+
export interface Deck {
99+
deck_id?: string;
100+
deck_slides: string[];
101+
102+
meta: Meta;
103+
104+
created_at: Date;
105+
updated_at: Date;
106+
}
107+
```
108+
109+
Questions:
110+
111+
- do we want to duplicate the author name (= user name) in the meta data? for performance reason maybe?

0 commit comments

Comments
 (0)