Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
slatinsky committed Aug 17, 2024
1 parent a35a14a commit 42e10ef
Show file tree
Hide file tree
Showing 8 changed files with 356 additions and 277 deletions.
484 changes: 347 additions & 137 deletions README.md

Large diffs are not rendered by default.

31 changes: 9 additions & 22 deletions docs/Architecture.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Architecture choices
# Architecture

The project is divided into two main parts: the server and the client.

## Used port numbers

- 21011 - nginx (reverse proxy)
- 21013 - http-server (static files)
- 27017 - mongodb (database)
- 58000 - fastapi (backend api)

Expand All @@ -25,7 +24,7 @@ Specifically, the process does the following:
- downloads ggsans font from discord cdn.


### mongodb
### Mongodb

Database used to store data. The database is divided into multiple collections:
- assets - precomputed assets with local paths and dimensions
Expand All @@ -36,23 +35,18 @@ Database used to store data. The database is divided into multiple collections:
- jsons - stores sha256 hashes of processed files. This way, the preprocessor can skip already processed files.
- messages - stores all messages, including authors, emojis, attachments, etc.

### fastapi
Collections are sharded by guilds.

Middleman between the client and the mongo database. Provides JSON api for the client (search, guild list, channel list, and messages).
### Fastapi

Search and channel endpoints return message ids. Those ids are then fetched by the client when needed.
Middleman between the client and the mongo database. Provides JSON api for the frontend client (search, guild list, channel list, and messages).

### http-server

http-server is used to server static files for the frontend. Nginx could be used instead, but sometimes paths exceed the maximum path length of 260 characters on Windows and nginx fails to serve the files.

http-server is used as a workaround for that bug in nginx. But it is also needed to apply registry patch to increase the maximum path length (use `change_260_character_path_limit_to_32767.reg`).

### windows runner (Windows only)
### Windows runner (Windows only)

Windows runner is the main entry point of the program on Windows. This script is compiled into `dcef.exe` in the release.

- writes logs from other services to `logs.txt` file for easier debugging.
- writes logs from other services to `logs/dcef.log` file for easier debugging.

- checks if all required ports are free on startup

Expand All @@ -62,17 +56,10 @@ Windows runner is the main entry point of the program on Windows. This script is

- cleans up all services on window close

### nginx

Nginx combines multiple services into one. See `nginx-prod.conf`.

1. First is server frontend files needed for the client to load (paths `/_app/`, `/css/`, `/js/`, `/fonts/`, `/`).

2. Then it proxies static files from http-server from port 21013 (path `/input/`).

3. Then it serves static files created by preprocess (path `/data/`) - now used only for ggsans font.
### Nginx

4. Finally, it proxies api requests from fastapi from port 58000 (path `/api/`).
Nginx combines fastapi backend and static frontend into one. See `nginx-prod.conf`.


## Client (Frontend)
Expand Down
23 changes: 0 additions & 23 deletions docs/Compile.md

This file was deleted.

42 changes: 0 additions & 42 deletions docs/Development-env.md

This file was deleted.

45 changes: 0 additions & 45 deletions docs/Server-hosting.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/Supporting-other-exporters.md

This file was deleted.

Binary file added docs/dce-show-threads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 42e10ef

Please sign in to comment.