# mmattbtw/disquisition architecture

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

- Interactive diagram: https://gitdiagram.com/mmattbtw/disquisition
- Repository: https://github.com/mmattbtw/disquisition

## Overview

Disquisition is a C++ desktop community-chat application with an optional byte-tunneling relay. The main workflow is to launch the desktop client, create or join a community, then exchange live chat and collaborate through voice or screen sharing; chat history can be saved locally. Community metadata, identity, and admission are client-side, while the relay pairs peers and forwards encrypted traffic. The README establishes the product capabilities; the sampled sources show the desktop entry point, community model and peer runtime, relay routing, GIF search, and drawing-session interfaces. Several subsystem links remain unverified because their implementation excerpts were not provided.

Main entry points: [`src/desktop/community_panel.cpp`](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/community_panel.cpp) (Community UI), [`src/community/node.cpp`](https://github.com/mmattbtw/disquisition/blob/main/src/community/node.cpp) (Peer runtime), [`src/relay/community_router.cpp`](https://github.com/mmattbtw/disquisition/blob/main/src/relay/community_router.cpp) (Community router), [`src/community/model.cpp`](https://github.com/mmattbtw/disquisition/blob/main/src/community/model.cpp) (Community model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop client"]
  node_desktop_entry["Desktop entry<br/>[main.cpp]"]
  node_community_panel["Community UI"]
  node_gif_search["GIF search<br/>[gif_search.cpp]"]
  node_recent_messages[("Local history")]
end

subgraph group_community["Community runtime"]
  node_identity["Peer identity<br/>[identity.cpp]"]
  node_community_model["Community model<br/>[model.cpp]"]
  node_community_store[("Community store<br/>[store.cpp]")]
  node_peer_node["Peer runtime<br/>[node.cpp]"]
  node_invite_qr["Invite QR<br/>[qr.cpp]"]
end

subgraph group_media["Live collaboration"]
  node_drawing_protocol["Drawing protocol"]
  node_drawing_session["Drawing session"]
  node_screen_drawing["Screen drawing<br/>[screen_drawing.cpp]"]
  node_screen_capture["Screen capture<br/>[screen_capture.cpp]"]
  node_screen_stage["Screen stage<br/>[screen_stage.cpp]"]
  node_screen_audio["Screen audio<br/>[screen_audio.cpp]"]
end

subgraph group_relay["Relay routing"]
  node_relay_app["Relay listener<br/>[relay.cpp]"]
  node_community_router["Community router"]
  node_relay_entry["Relay entry<br/>[main.cpp]"]
end

node_user(("Desktop user"))
node_gif_providers(("GIF providers"))

node_user -->|"launches"| node_desktop_entry
node_desktop_entry -.->|"opens window"| node_community_panel
node_community_panel -->|"uses peer runtime"| node_peer_node
node_community_panel -.->|"loads history"| node_recent_messages
node_community_panel -.->|"offers GIF search"| node_gif_search
node_gif_search -.->|"searches providers"| node_gif_providers
node_peer_node -.->|"manages communities"| node_community_model
node_peer_node -->|"uses store"| node_community_store
node_community_store -->|"persists model"| node_community_model
node_community_model -->|"signs operations"| node_identity
node_community_panel -.->|"presents invites"| node_invite_qr
node_peer_node -.->|"tunnels peer traffic"| node_relay_app
node_relay_entry -->|"starts relay"| node_relay_app
node_relay_app -->|"routes connections"| node_community_router
node_community_router -->|"verifies peer"| node_identity
node_community_router -->|"forwards peer bytes"| node_peer_node
node_community_panel -.->|"manages drawing"| node_drawing_session
node_drawing_session -->|"updates drawing"| node_screen_drawing
node_screen_drawing -->|"encodes messages"| node_drawing_protocol
node_community_panel -.->|"starts sharing"| node_screen_capture
node_community_panel -.->|"shows shared stream"| node_screen_stage
node_community_panel -.->|"plays share audio"| node_screen_audio
node_peer_node -.->|"transports collaboration"| node_screen_drawing

click node_desktop_entry "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/main.cpp"
click node_community_panel "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/community_panel.cpp"
click node_gif_search "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/gif_search.cpp"
click node_recent_messages "https://github.com/mmattbtw/disquisition/blob/main/src/common/recent_messages.cpp"
click node_identity "https://github.com/mmattbtw/disquisition/blob/main/src/community/identity.cpp"
click node_community_model "https://github.com/mmattbtw/disquisition/blob/main/src/community/model.cpp"
click node_community_store "https://github.com/mmattbtw/disquisition/blob/main/src/community/store.cpp"
click node_peer_node "https://github.com/mmattbtw/disquisition/blob/main/src/community/node.cpp"
click node_invite_qr "https://github.com/mmattbtw/disquisition/blob/main/src/community/qr.cpp"
click node_drawing_protocol "https://github.com/mmattbtw/disquisition/blob/main/src/common/drawing_protocol.cpp"
click node_drawing_session "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_drawing_session.cpp"
click node_screen_drawing "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_drawing.cpp"
click node_screen_capture "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_capture.cpp"
click node_screen_stage "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_stage.cpp"
click node_screen_audio "https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_audio.cpp"
click node_relay_app "https://github.com/mmattbtw/disquisition/blob/main/src/relay/relay.cpp"
click node_community_router "https://github.com/mmattbtw/disquisition/blob/main/src/relay/community_router.cpp"
click node_relay_entry "https://github.com/mmattbtw/disquisition/blob/main/src/relay/main.cpp"

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_desktop_entry,node_community_panel,node_gif_search,node_recent_messages,node_user toneBlue
class node_identity,node_community_model,node_community_store,node_peer_node,node_invite_qr toneAmber
class node_drawing_protocol,node_drawing_session,node_screen_drawing,node_screen_capture,node_screen_stage,node_screen_audio toneMint
class node_relay_app,node_community_router,node_relay_entry toneRose
class node_gif_providers toneIndigo
```

## Components

### Desktop client

- [Desktop entry](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/main.cpp): `src/desktop/main.cpp`
- [Community UI](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/community_panel.cpp): `src/desktop/community_panel.cpp`
- [GIF search](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/gif_search.cpp): `src/desktop/gif_search.cpp`
- [Local history](https://github.com/mmattbtw/disquisition/blob/main/src/common/recent_messages.cpp): `src/common/recent_messages.cpp`

### Community runtime

- [Peer identity](https://github.com/mmattbtw/disquisition/blob/main/src/community/identity.cpp): `src/community/identity.cpp`
- [Community model](https://github.com/mmattbtw/disquisition/blob/main/src/community/model.cpp): `src/community/model.cpp`
- [Community store](https://github.com/mmattbtw/disquisition/blob/main/src/community/store.cpp): `src/community/store.cpp`
- [Peer runtime](https://github.com/mmattbtw/disquisition/blob/main/src/community/node.cpp): `src/community/node.cpp`
- [Invite QR](https://github.com/mmattbtw/disquisition/blob/main/src/community/qr.cpp): `src/community/qr.cpp`

### Live collaboration

- [Drawing protocol](https://github.com/mmattbtw/disquisition/blob/main/src/common/drawing_protocol.cpp): `src/common/drawing_protocol.cpp`
- [Drawing session](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_drawing_session.cpp): `src/desktop/screen_drawing_session.cpp`
- [Screen drawing](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_drawing.cpp): `src/desktop/screen_drawing.cpp`
- [Screen capture](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_capture.cpp): `src/desktop/screen_capture.cpp`
- [Screen stage](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_stage.cpp): `src/desktop/screen_stage.cpp`
- [Screen audio](https://github.com/mmattbtw/disquisition/blob/main/src/desktop/screen_audio.cpp): `src/desktop/screen_audio.cpp`

### Relay routing

- [Relay listener](https://github.com/mmattbtw/disquisition/blob/main/src/relay/relay.cpp): `src/relay/relay.cpp`
- [Community router](https://github.com/mmattbtw/disquisition/blob/main/src/relay/community_router.cpp): `src/relay/community_router.cpp`
- [Relay entry](https://github.com/mmattbtw/disquisition/blob/main/src/relay/main.cpp): `src/relay/main.cpp`

### Other components

- **Desktop user**
- **GIF providers**

## Connections

- Desktop user → Desktop entry: launches (evidence: `README.md`)
- Desktop entry → Community UI: opens window
- Community UI → Peer runtime: uses peer runtime
- Community UI → Local history: loads history
- Community UI → GIF search: offers GIF search
- GIF search → GIF providers: searches providers
- Peer runtime → Community model: manages communities
- Peer runtime → Community store: uses store
- Community store → Community model: persists model
- Community model → Peer identity: signs operations
- Community UI → Invite QR: presents invites
- Peer runtime → Relay listener: tunnels peer traffic (evidence: `README.md`)
- Relay entry → Relay listener: starts relay (evidence: `src/relay/main.cpp`)
- Relay listener → Community router: routes connections
- Community router → Peer identity: verifies peer (evidence: `src/relay/community_router.cpp`)
- Community router → Peer runtime: forwards peer bytes (evidence: `README.md`)
- Community UI → Drawing session: manages drawing
- Drawing session → Screen drawing: updates drawing
- Screen drawing → Drawing protocol: encodes messages
- Community UI → Screen capture: starts sharing
- Community UI → Screen stage: shows shared stream
- Community UI → Screen audio: plays share audio
- Peer runtime → Screen drawing: transports collaboration
