18 Diagrams
yun edited this page 2026-03-08 23:48:54 +01:00

Diagrams

Software architecture

flowchart LR
    Backend-- json/HTTP (login) ---Frontend
    Backend-- protobuf/WebSocket ---Frontend
    CDN-- octet-stream/HTTP ---Frontend
    DB-- SQL ---Backend
    DB-- SQL ---CDN

Notes:

  • The CDN uses the DB to allow only authorized people to access the right files

Flow

Authentication

Register (REST)

sequenceDiagram
    User->>Frontend: types a username
    User->>Frontend: (opt) types an email address
    Frontend->>Backend: Register
    Backend-->>Frontend: Session token

Login (REST)

sequenceDiagram
    User->>Frontend: Types their username
    User->>Frontend: Types their email address
    Frontend->>Backend: Login
    Backend->>DB: Does username exist?
    Backend->>DB: Does user has email address?
    Backend->>DB: Has user typed the right email address?
    alt conditions pass
        Backend->>Email: Auth token
        Backend-->>Frontend: Auth id
        Frontend->>Backend: Polls result...
    else conditions don't pass
        Backend-->>Frontend: Fail silently
    end

...

sequenceDiagram
    User->>Backend: Clicks link in email
    Backend->>DB: Marks auth as validated

...

sequenceDiagram
    Frontend->>Backend: ...Polls result
    Backend->>DB: Check if auth is validated
    alt validated
        Backend-->>Frontend: Session Token
        Backend->>DB: Clears auth attempt data
    else not validated
        Backend-->>Frontend: Fail
    end

Send message (WS)

sequenceDiagram
    Frontend->>Backend: text, medias, guild, channel
    Backend->>DB: message + timestamp + sender
    Backend-->>Frontend: send to guild members