# vrongithub/rustcord architecture

> Architecture diagram of the GitHub repository vrongithub/rustcord, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vrongithub/rustcord
- Repository: https://github.com/vrongithub/rustcord

## Overview

RustCord is a native Discord client. The main workflow is launch and account login, then a background network backend receives Discord events and the application updates client state for the UI to render; user actions travel back through the backend. Distinct capabilities include chat and server navigation, media and voice, themes, and Rencord extensions. The graph uses README claims for major unsampled features; dashed edges mark relationships not verified in the excerpts or source index.

Main entry points: [`apps/rustcord/src/app.rs`](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/app.rs) (Application state), [`apps/rustcord/src/backend.rs`](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/backend.rs) (Network backend), [`apps/rustcord/src/main.rs`](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/main.rs) (App startup), [`apps/rustcord/src/ui/mod.rs`](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/ui/mod.rs) (Native UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client runtime"]
  node_launch["App startup<br/>[main.rs]"]
  node_application["Application state<br/>[app.rs]"]
  node_ui["Native UI<br/>[mod.rs]"]
  node_store["Client state<br/>[store.rs]"]
  node_cache[("Local cache<br/>[cache.rs]")]
  node_accounts["Accounts<br/>[accounts.rs]"]
  node_diagnostics["Local diagnostics<br/>[diagnostics.rs]"]
end

subgraph group_discord["Discord connectivity"]
  node_backend["Network backend<br/>[backend.rs]"]
  node_discord_gateway["Gateway events<br/>[gateway.rs]"]
  node_discord_http["Discord HTTP<br/>[http.rs]"]
end

subgraph group_experience["Client features"]
  node_chat["Chat and server UI<br/>[chat.rs]"]
  node_guilds["Guild navigation<br/>[guild_pages.rs]"]
  node_themes["Themes and styling<br/>[style.rs]"]
  node_emoji["Emoji search<br/>[emoji.rs]"]
  node_emoji_data[("Emoji catalog<br/>[emoji_data.rs]")]
  node_rencord["Rencord mods<br/>[lib.rs]"]
end

subgraph group_voice["Voice and media"]
  node_media["Media and Go Live<br/>[golive.rs]"]
  node_voice["Voice transport<br/>[transport.rs]"]
  node_video_receive["Video decoding<br/>[video_receive.rs]"]
end

node_user(("User"))

node_user -->|"starts"| node_launch
node_launch -->|"creates"| node_application
node_application -->|"sends commands"| node_backend
node_backend -->|"delivers events"| node_application
node_application -->|"updates state"| node_store
node_application -->|"renders"| node_ui
node_ui -->|"reads state"| node_store
node_launch -->|"initializes"| node_accounts
node_application -->|"loads session"| node_accounts
node_backend -->|"uses gateway"| node_discord_gateway
node_backend -->|"calls HTTP"| node_discord_http
node_application -->|"hosts chat"| node_chat
node_application -->|"hosts navigation"| node_guilds
node_ui -->|"uses styling"| node_themes
node_emoji -->|"searches catalog"| node_emoji_data
node_application -->|"dispatches messages"| node_rencord
node_user -.->|"uses media"| node_media
node_media -.->|"uses voice runtime"| node_voice
node_voice -->|"decodes video"| node_video_receive
node_launch -->|"initializes"| node_diagnostics
node_backend -->|"uses cache"| node_cache
node_user -.->|"uses chat"| node_chat

click node_launch "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/main.rs"
click node_application "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/app.rs"
click node_ui "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/ui/mod.rs"
click node_store "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/store.rs"
click node_cache "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/cache.rs"
click node_accounts "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/accounts.rs"
click node_backend "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/backend.rs"
click node_discord_gateway "https://github.com/vrongithub/rustcord/blob/main/crates/discord/src/gateway.rs"
click node_discord_http "https://github.com/vrongithub/rustcord/blob/main/crates/discord/src/http.rs"
click node_chat "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/ui/chat.rs"
click node_guilds "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/ui/guild_pages.rs"
click node_themes "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/style.rs"
click node_emoji "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/emoji.rs"
click node_emoji_data "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/emoji_data.rs"
click node_rencord "https://github.com/vrongithub/rustcord/blob/main/crates/rencord/src/lib.rs"
click node_media "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/golive.rs"
click node_voice "https://github.com/vrongithub/rustcord/blob/main/crates/voice/src/transport.rs"
click node_video_receive "https://github.com/vrongithub/rustcord/blob/main/crates/voice/src/video_receive.rs"
click node_diagnostics "https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/diagnostics.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launch,node_application,node_ui,node_store,node_cache,node_accounts,node_diagnostics,node_user toneBlue
class node_backend,node_discord_gateway,node_discord_http toneAmber
class node_chat,node_guilds,node_themes,node_emoji,node_emoji_data,node_rencord toneMint
class node_media,node_voice,node_video_receive toneRose
```

## Components

### Client runtime

- [App startup](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/main.rs): `apps/rustcord/src/main.rs`
- [Application state](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/app.rs): `apps/rustcord/src/app.rs`
- [Native UI](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/ui/mod.rs): `apps/rustcord/src/ui/mod.rs`
- [Client state](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/store.rs): `apps/rustcord/src/store.rs`
- [Local cache](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/cache.rs): `apps/rustcord/src/cache.rs`
- [Accounts](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/accounts.rs): `apps/rustcord/src/accounts.rs`
- [Local diagnostics](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/diagnostics.rs): `apps/rustcord/src/diagnostics.rs`

### Discord connectivity

- [Network backend](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/backend.rs): `apps/rustcord/src/backend.rs`
- [Gateway events](https://github.com/vrongithub/rustcord/blob/main/crates/discord/src/gateway.rs): `crates/discord/src/gateway.rs`
- [Discord HTTP](https://github.com/vrongithub/rustcord/blob/main/crates/discord/src/http.rs): `crates/discord/src/http.rs`

### Client features

- [Chat and server UI](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/ui/chat.rs): `apps/rustcord/src/ui/chat.rs`
- [Guild navigation](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/ui/guild_pages.rs): `apps/rustcord/src/ui/guild_pages.rs`
- [Themes and styling](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/style.rs): `apps/rustcord/src/style.rs`
- [Emoji search](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/emoji.rs): `apps/rustcord/src/emoji.rs`
- [Emoji catalog](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/emoji_data.rs): `apps/rustcord/src/emoji_data.rs`
- [Rencord mods](https://github.com/vrongithub/rustcord/blob/main/crates/rencord/src/lib.rs): `crates/rencord/src/lib.rs`

### Voice and media

- [Media and Go Live](https://github.com/vrongithub/rustcord/blob/main/apps/rustcord/src/golive.rs): `apps/rustcord/src/golive.rs`
- [Voice transport](https://github.com/vrongithub/rustcord/blob/main/crates/voice/src/transport.rs): `crates/voice/src/transport.rs`
- [Video decoding](https://github.com/vrongithub/rustcord/blob/main/crates/voice/src/video_receive.rs): `crates/voice/src/video_receive.rs`

### Other components

- **User**

## Connections

- User → App startup: starts (evidence: `apps/rustcord/src/main.rs`)
- App startup → Application state: creates (evidence: `apps/rustcord/src/main.rs`)
- Application state → Network backend: sends commands (evidence: `apps/rustcord/src/app.rs`)
- Network backend → Application state: delivers events (evidence: `apps/rustcord/src/backend.rs`)
- Application state → Client state: updates state (evidence: `apps/rustcord/src/app.rs`)
- Application state → Native UI: renders (evidence: `apps/rustcord/src/app.rs`)
- Native UI → Client state: reads state (evidence: `apps/rustcord/src/ui/mod.rs`)
- App startup → Accounts: initializes (evidence: `apps/rustcord/src/main.rs`)
- Application state → Accounts: loads session (evidence: `apps/rustcord/src/app.rs`)
- Network backend → Gateway events: uses gateway (evidence: `apps/rustcord/src/backend.rs`)
- Network backend → Discord HTTP: calls HTTP (evidence: `apps/rustcord/src/backend.rs`)
- Application state → Chat and server UI: hosts chat (evidence: `apps/rustcord/src/app.rs`)
- Application state → Guild navigation: hosts navigation (evidence: `apps/rustcord/src/app.rs`)
- Native UI → Themes and styling: uses styling (evidence: `apps/rustcord/src/ui/mod.rs`)
- Emoji search → Emoji catalog: searches catalog (evidence: `apps/rustcord/src/emoji.rs`)
- Application state → Rencord mods: dispatches messages (evidence: `apps/rustcord/src/app.rs`)
- User → Media and Go Live: uses media (evidence: `README.md`)
- Media and Go Live → Voice transport: uses voice runtime
- Voice transport → Video decoding: decodes video (evidence: `crates/voice/src/stream.rs`)
- App startup → Local diagnostics: initializes (evidence: `apps/rustcord/src/main.rs`)
- Network backend → Local cache: uses cache (evidence: `apps/rustcord/src/backend.rs`)
- User → Chat and server UI: uses chat (evidence: `README.md`)
