Skip to content

Commit 1c3eacd

Browse files
committed
docs(update): update documentation to latest data
1 parent 24fab4d commit 1c3eacd

File tree

5 files changed

+120
-118
lines changed

5 files changed

+120
-118
lines changed

docs/development/api_documentation.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/development/database.md

Lines changed: 98 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -14,130 +14,124 @@ There is also a mermaid schema for the database:
1414
```mermaid
1515
erDiagram
1616
User {
17-
string id PK "Unique identifier"
18-
string email "Unique email"
19-
string username "Unique username"
20-
string password "User password"
21-
datetime createdAt "Creation date"
22-
datetime updatedAt "Last update date"
23-
bytes avatar "User avatar (optional)"
24-
bytes banner "User banner (optional)"
25-
string bannerColor "Banner color (optional)"
26-
string bio "User biography (optional)"
27-
string channelId "Channel ID (optional)"
28-
UserRoles[] roles "User roles"
17+
String id PK
18+
String email
19+
String username
20+
String password
21+
DateTime createdAt
22+
DateTime updatedAt
23+
Bytes avatar
24+
Bytes banner
25+
String bannerColor
26+
String bio
27+
UserRoles[] roles
28+
}
29+
ChannelRecipient {
30+
String id PK
31+
String channelId
32+
String userId
2933
}
30-
3134
Friend {
32-
string id PK "Unique identifier"
33-
string userId "User ID"
34-
string friendId "Friend ID"
35+
String id PK
36+
String userId
37+
String friendId
3538
}
36-
3739
ServerMember {
38-
string id PK "Unique identifier"
39-
string serverId "Server ID"
40-
string userId "User ID"
41-
UserRoles[] roles "Member roles"
40+
String id PK
41+
String serverId
42+
String userId
43+
UserRoles[] roles
4244
}
43-
4445
Message {
45-
string id PK "Unique identifier"
46-
datetime createdAt "Creation date"
47-
datetime updatedAt "Last update date"
48-
string authorId "Author ID"
49-
string content "Message content"
50-
string channelId "Channel ID"
46+
String id PK
47+
DateTime createdAt
48+
DateTime updatedAt
49+
String authorId
50+
String content
51+
String channelId
5152
}
52-
5353
PermissionOverwrite {
54-
string id PK "Unique identifier"
55-
int type "Overwrite type"
56-
string allow "Allowed permissions"
57-
string deny "Denied permissions"
58-
string channelId "Channel ID"
54+
String id PK
55+
Int type
56+
String allow
57+
String deny
58+
String channelId
5959
}
60-
6160
Channel {
62-
string id PK "Unique identifier"
63-
string name "Channel name"
64-
ChannelType type "Channel type"
65-
string topic "Topic (optional)"
66-
boolean nsfw "Is NSFW"
67-
int bitrate "Bitrate (optional)"
68-
int userLimit "User limit (optional)"
69-
int rateLimitPerUser "Rate limit per user (optional)"
70-
datetime createdAt "Creation date"
71-
datetime updatedAt "Last update date"
72-
string lastMessageId "Last message ID (optional)"
73-
string serverId "Server ID (optional)"
74-
string description "Description (optional)"
75-
int position "Position (optional)"
61+
String id PK
62+
String name
63+
ChannelType type
64+
String topic
65+
Boolean nsfw
66+
Int bitrate
67+
Int userLimit
68+
Int rateLimitPerUser
69+
DateTime createdAt
70+
DateTime updatedAt
71+
String lastMessageId
72+
String serverId
73+
String description
74+
Int position
75+
String ownerId
7676
}
77-
7877
Roles {
79-
string id PK "Unique identifier"
80-
datetime createdAt "Creation date"
81-
datetime updatedAt "Last update date"
82-
string name "Role name"
83-
string[] permissions "Permissions"
84-
string color "Role color"
85-
boolean hoist "Hoist"
86-
boolean mentionable "Mentionable"
87-
string serverId "Server ID"
78+
String id PK
79+
DateTime createdAt
80+
DateTime updatedAt
81+
String name
82+
String[] permissions
83+
String color
84+
Boolean hoist
85+
Boolean mentionable
86+
String serverId
8887
}
89-
9088
Log {
91-
string id PK "Unique identifier"
92-
datetime createdAt "Creation date"
93-
datetime updatedAt "Last update date"
94-
string type "Log type"
95-
string message "Log message"
96-
string serverId "Server ID"
97-
string authorId "Author ID (optional)"
89+
String id PK
90+
DateTime createdAt
91+
DateTime updatedAt
92+
String type
93+
String message
94+
String serverId
95+
String authorId
9896
}
99-
10097
Server {
101-
string id PK "Unique identifier"
102-
datetime createdAt "Creation date"
103-
datetime updatedAt "Last update date"
104-
string name "Server name"
105-
string ownerId "Owner ID"
106-
bytes icon "Server icon (optional)"
107-
bytes banner "Server banner (optional)"
108-
string bannerColor "Banner color (optional)"
109-
string description "Description (optional)"
98+
String id PK
99+
DateTime createdAt
100+
DateTime updatedAt
101+
String name
102+
String ownerId FK
103+
String memberId
104+
Bytes icon
105+
Bytes banner
106+
String bannerColor
107+
String description
110108
}
111109
110+
User ||--o{ Message : "writes"
112111
User ||--o{ Friend : "has friends"
113-
User ||--o{ ServerMember : "is member of"
114-
User ||--o{ Message : "authors"
115-
User ||--o{ Log : "logs"
116-
User ||--|| Channel : "has channel"
117-
User ||--|| Server : "owns"
118-
119-
Friend ||--|| User : "friends with"
120-
121-
ServerMember }|--|| Server : "belongs to"
122-
ServerMember }|--|| User : "is user"
123-
124-
Message }|--|| User : "authored by"
125-
Message }|--|| Channel : "belongs to"
126-
127-
PermissionOverwrite }|--|| Channel : "overwrites permissions for"
128-
129-
Channel }|--o{ Message : "contains"
130-
Channel }|--|| PermissionOverwrite : "has permission overwrites"
131-
Channel ||--|| Server : "belongs to"
132-
Channel }|--o{ User : "has recipients"
133-
134-
Roles }|--|| Server : "belongs to"
135-
136-
Log }|--|| Server : "logs for"
137-
Log }|--o{ User : "authored by"
138-
112+
User ||--o{ ServerMember : "is a member of"
113+
User ||--o{ ChannelRecipient : "is recipient of"
114+
User ||--o{ Channel : "owns channels"
115+
User ||--o{ Log : "author of logs"
116+
Server ||--o{ User : "owned by"
139117
Server ||--o{ ServerMember : "has members"
140-
Server ||--o{ Channel : "contains channels"
118+
Server ||--o{ Channel : "has channels"
141119
Server ||--o{ Roles : "has roles"
142120
Server ||--o{ Log : "has logs"
121+
ServerMember ||--o{ User : "has user"
122+
ServerMember ||--o{ Server : "belongs to server"
123+
ChannelRecipient ||--o{ User : "has user"
124+
ChannelRecipient ||--o{ Channel : "has channel"
125+
Friend ||--o{ User : "has user"
126+
Friend ||--o{ User : "is friend of"
127+
Message ||--o{ User : "written by"
128+
Message ||--o{ Channel : "in channel"
129+
PermissionOverwrite ||--o{ Channel : "belongs to"
130+
Channel ||--o{ Server : "belongs to server"
131+
Channel ||--o{ PermissionOverwrite : "has permissions"
132+
Channel ||--o{ Message : "has messages"
133+
Channel ||--o{ User : "owned by"
134+
Roles ||--o{ Server : "belongs to"
135+
Log ||--o{ Server : "belongs to"
136+
Log ||--o{ User : "written by"
143137
```

docs/development/tests.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ npm install
1010
npm run test:e2e
1111
```
1212

13+
You can even run some coverage reports using `npm run test:e2e:cov`.
14+
1315
:::note
14-
At the moment, there is only e2e tests. They should cover the major part of the application.
16+
More tests will be added in the future.
17+
Objective 100% coverage 😎
1518
:::

docs/installation/docker.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ sidebar_position: 2
44
---
55

66
```bash
7-
docker-compose up -d
7+
git clone [email protected]:outer-chat/outer-chat.git --recurse-submodules
8+
cd outer-chat
9+
docker compose up -d
810
```
911

1012
This snippet only up the database. So you need to start the server with :
@@ -19,18 +21,18 @@ You can now access the server !
1921

2022
---
2123

22-
But, if you want to up the whole stack, you can use the `docker-compose.prod.yml` file at the root of the project.
24+
But, if you want to up the whole stack, you can use the `compose.prod.yml` file at the root of the project.
2325

2426
```bash
25-
docker-compose -f docker-compose.prod.yml up -d
27+
docker compose -f compose.prod.yml up -d
2628
```
2729

2830
As you may, you can edit the env variables in your `.env` file.
2931
And edit the Caddyfile to match your domain.
3032

3133
:::note
3234

33-
The `docker-compose.prod.yml` also launch the clientapp. If not already done, I invite you to pull the submodule located in : `./outer-chat.client`.
35+
The `compose.prod.yml` also launch the clientapp. If not already done, I invite you to pull the submodule located in : `./client` (From the outer-chat repository).
3436

3537
```bash
3638
git submodule init

docs/installation/from_source.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ sidebar_position: 3
66
```bash
77
git clone [email protected]:outer-chat/outer-chat.git --recurse-submodules
88
cd outer-chat
9-
npm install
9+
npm ci
1010
```
1111

12+
:::note
13+
`npm ci` is used to install the dependencies from the `package-lock.json` file. Instead of the `npm install` command, it is faster and more reliable.
14+
:::
15+
1216
Now edit the `.env` file to match your configuration. (you can use the [`.env.example`](.env.example) file as an example)
17+
18+
:::note
19+
In the future, there will be a configuration file for the server and the client.
20+
At the moment everything all user defined configuration will be fetched from the `.env` file.
21+
:::
22+
1323
Now you can start the server in developpement mode with :
1424

1525
```bash
@@ -24,5 +34,5 @@ npm run start:prod
2434
```
2535

2636
:::note
27-
If you do not want to setup a database, you can use the `docker-compose.yml` file at the root of the project. It will launch a mongodb database. You can edit the env variables in the `docker-compose.yml` file.
37+
If you do not want to setup a database, you can use the `compose.yml` file at the root of the project. It will launch a mongodb database. You can edit the env variables in the `compose.yml` file.
2838
:::

0 commit comments

Comments
 (0)