# itsmattguenther/linger architecture

> Architecture diagram of the GitHub repository itsmattguenther/linger, 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/itsmattguenther/linger
- Repository: https://github.com/itsmattguenther/linger

## Overview

Linger is a self-hosted social hangout: members connect to a host’s server, find people and rooms, then chat, share media, join voice, or watch screen shares. The React/Tauri client presents the buddy list and separate chat, settings, search, and media windows; shared client state and typed HTTP/WebSocket interfaces connect it to the Rust server. The server handles accounts, persistence, messaging, and voice/screen signaling, with a separate SFU and optional push relay. The README establishes the product workflow and capabilities; some backend and feature wiring is unsampled, so uncertain links are omitted.

Main entry points: [`client/src/next/app/App.tsx`](https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/App.tsx) (App windows), [`crates/linger-server/src/routes`](https://github.com/itsmattguenther/linger/tree/main/crates/linger-server/src/routes) (HTTP routes), [`client/src/lib/gateway.ts`](https://github.com/itsmattguenther/linger/blob/main/client/src/lib/gateway.ts) (Gateway state), [`client/src/next/app/chat/ChatView.tsx`](https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/chat/ChatView.tsx) (Chat and sharing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app_windows["App windows<br/>[App.tsx]"]
  node_buddy_list["Buddy list"]
  node_chat["Chat and sharing<br/>[ChatView.tsx]"]
  node_search_media["Search and media"]
  node_settings["Settings"]
  node_screen_ui["Screen sharing UI<br/>[usePaneScreen.ts]"]
end

subgraph group_client_runtime["Client runtime"]
  node_client_entry["Client entry<br/>[main.tsx]"]
  node_gateway_state["Gateway state<br/>[gateway.ts]"]
  node_http_api["Typed HTTP API<br/>[api.ts]"]
  node_native_bridge["Native bridge<br/>[ipc.ts]"]
end

subgraph group_server["Server services"]
  node_server_app["Server application<br/>[main.rs]"]
  node_authentication["Authentication<br/>[auth.rs]"]
  node_server_routes["HTTP routes"]
  node_database[("SQLite database<br/>[db.rs]")]
  node_repository["Data repositories"]
end

subgraph group_realtime["Realtime media"]
  node_voice_client["Voice runtime<br/>[voice.ts]"]
  node_sfu["Voice SFU<br/>[lib.rs]"]
end

subgraph group_mobile_push["Mobile notifications"]
  node_push_relay["Push relay<br/>[index.ts]"]
  node_phone_push["Phone notifications"]
end

node_member(("Member"))
node_host[("Self-hosted server")]

node_member -->|"uses"| node_app_windows
node_client_entry -->|"renders"| node_app_windows
node_app_windows -->|"routes to"| node_buddy_list
node_app_windows -->|"routes to"| node_chat
node_app_windows -->|"routes to"| node_settings
node_app_windows -->|"routes to"| node_search_media
node_chat -->|"loads messages"| node_gateway_state
node_chat -->|"sends requests"| node_http_api
node_screen_ui -->|"joins voice"| node_gateway_state
node_gateway_state -->|"invokes voice"| node_native_bridge
node_http_api -->|"sends HTTP"| node_host
node_gateway_state -->|"connects gateway"| node_host
node_host -->|"runs"| node_server_app
node_server_app -->|"serves routes"| node_server_routes
node_server_routes -->|"authenticates"| node_authentication
node_server_routes -->|"queries"| node_database
node_server_routes -->|"reads attachments"| node_repository
node_voice_client -->|"sends voice"| node_sfu
node_server_app -.->|"forwards voice"| node_sfu
node_push_relay -->|"delivers encrypted push"| node_phone_push
node_member -->|"shares screen"| node_screen_ui
node_buddy_list -.->|"gets server data"| node_http_api

click node_app_windows "https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/App.tsx"
click node_buddy_list "https://github.com/itsmattguenther/linger/tree/main/client/src/next/app/list"
click node_chat "https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/chat/ChatView.tsx"
click node_search_media "https://github.com/itsmattguenther/linger/tree/main/client/src/next/app/tools"
click node_settings "https://github.com/itsmattguenther/linger/tree/main/client/src/next/app/settings"
click node_screen_ui "https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/screen/usePaneScreen.ts"
click node_client_entry "https://github.com/itsmattguenther/linger/blob/main/client/src/next/main.tsx"
click node_gateway_state "https://github.com/itsmattguenther/linger/blob/main/client/src/lib/gateway.ts"
click node_http_api "https://github.com/itsmattguenther/linger/blob/main/client/src/lib/api.ts"
click node_native_bridge "https://github.com/itsmattguenther/linger/blob/main/client/src/lib/ipc.ts"
click node_server_app "https://github.com/itsmattguenther/linger/blob/main/crates/linger-server/src/main.rs"
click node_authentication "https://github.com/itsmattguenther/linger/blob/main/crates/linger-server/src/auth.rs"
click node_server_routes "https://github.com/itsmattguenther/linger/tree/main/crates/linger-server/src/routes"
click node_database "https://github.com/itsmattguenther/linger/blob/main/crates/linger-server/src/db.rs"
click node_repository "https://github.com/itsmattguenther/linger/tree/main/crates/linger-server/src/repo"
click node_voice_client "https://github.com/itsmattguenther/linger/blob/main/client/src/lib/voice.ts"
click node_sfu "https://github.com/itsmattguenther/linger/blob/main/crates/linger-sfu/src/lib.rs"
click node_push_relay "https://github.com/itsmattguenther/linger/blob/main/push-relay/src/index.ts"
click node_phone_push "https://github.com/itsmattguenther/linger/blob/main/client/src-tauri/gen/android/app/src/main/java/io/github/itsmattguenther/linger/LingerMessagingService.kt"

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_app_windows,node_buddy_list,node_chat,node_search_media,node_settings,node_screen_ui toneBlue
class node_client_entry,node_gateway_state,node_http_api,node_native_bridge,node_host toneAmber
class node_server_app,node_authentication,node_server_routes,node_database,node_repository toneMint
class node_voice_client,node_sfu toneRose
class node_push_relay,node_phone_push,node_member toneIndigo
```

## Components

### Client experience

- [App windows](https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/App.tsx): `client/src/next/app/App.tsx`
- [Buddy list](https://github.com/itsmattguenther/linger/tree/main/client/src/next/app/list): `client/src/next/app/list`
- [Chat and sharing](https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/chat/ChatView.tsx): `client/src/next/app/chat/ChatView.tsx`
- [Search and media](https://github.com/itsmattguenther/linger/tree/main/client/src/next/app/tools): `client/src/next/app/tools`
- [Settings](https://github.com/itsmattguenther/linger/tree/main/client/src/next/app/settings): `client/src/next/app/settings`
- [Screen sharing UI](https://github.com/itsmattguenther/linger/blob/main/client/src/next/app/screen/usePaneScreen.ts): `client/src/next/app/screen/usePaneScreen.ts`

### Client runtime

- [Client entry](https://github.com/itsmattguenther/linger/blob/main/client/src/next/main.tsx): `client/src/next/main.tsx`
- [Gateway state](https://github.com/itsmattguenther/linger/blob/main/client/src/lib/gateway.ts): `client/src/lib/gateway.ts`
- [Typed HTTP API](https://github.com/itsmattguenther/linger/blob/main/client/src/lib/api.ts): `client/src/lib/api.ts`
- [Native bridge](https://github.com/itsmattguenther/linger/blob/main/client/src/lib/ipc.ts): `client/src/lib/ipc.ts`

### Server services

- [Server application](https://github.com/itsmattguenther/linger/blob/main/crates/linger-server/src/main.rs): `crates/linger-server/src/main.rs`
- [Authentication](https://github.com/itsmattguenther/linger/blob/main/crates/linger-server/src/auth.rs): `crates/linger-server/src/auth.rs`
- [HTTP routes](https://github.com/itsmattguenther/linger/tree/main/crates/linger-server/src/routes): `crates/linger-server/src/routes`
- [SQLite database](https://github.com/itsmattguenther/linger/blob/main/crates/linger-server/src/db.rs): `crates/linger-server/src/db.rs`
- [Data repositories](https://github.com/itsmattguenther/linger/tree/main/crates/linger-server/src/repo): `crates/linger-server/src/repo`

### Realtime media

- [Voice runtime](https://github.com/itsmattguenther/linger/blob/main/client/src/lib/voice.ts): `client/src/lib/voice.ts`
- [Voice SFU](https://github.com/itsmattguenther/linger/blob/main/crates/linger-sfu/src/lib.rs): `crates/linger-sfu/src/lib.rs`

### Mobile notifications

- [Push relay](https://github.com/itsmattguenther/linger/blob/main/push-relay/src/index.ts): `push-relay/src/index.ts`
- [Phone notifications](https://github.com/itsmattguenther/linger/blob/main/client/src-tauri/gen/android/app/src/main/java/io/github/itsmattguenther/linger/LingerMessagingService.kt): `client/src-tauri/gen/android/app/src/main/java/io/github/itsmattguenther/linger/LingerMessagingService.kt`

### Other components

- **Member**
- **Self-hosted server**

## Connections

- Member → App windows: uses (evidence: `README.md`)
- Client entry → App windows: renders (evidence: `client/src/next/main.tsx`)
- App windows → Buddy list: routes to (evidence: `client/src/next/app/App.tsx`)
- App windows → Chat and sharing: routes to (evidence: `client/src/next/app/App.tsx`)
- App windows → Settings: routes to (evidence: `client/src/next/app/App.tsx`)
- App windows → Search and media: routes to (evidence: `client/src/next/app/App.tsx`)
- Chat and sharing → Gateway state: loads messages (evidence: `client/src/next/app/chat/useConversationPane.tsx`)
- Chat and sharing → Typed HTTP API: sends requests (evidence: `client/src/next/app/chat/useConversationPane.tsx`)
- Screen sharing UI → Gateway state: joins voice (evidence: `client/src/next/app/screen/usePaneScreen.ts`)
- Gateway state → Native bridge: invokes voice (evidence: `client/src/lib/gateway.ts`)
- Typed HTTP API → Self-hosted server: sends HTTP (evidence: `client/src/lib/api.ts`)
- Gateway state → Self-hosted server: connects gateway (evidence: `README.md`)
- Self-hosted server → Server application: runs (evidence: `README.md`)
- Server application → HTTP routes: serves routes (evidence: `crates/linger-server/src/main.rs`)
- HTTP routes → Authentication: authenticates (evidence: `crates/linger-server/src/routes/server.rs`)
- HTTP routes → SQLite database: queries (evidence: `crates/linger-server/src/routes/server.rs`)
- HTTP routes → Data repositories: reads attachments (evidence: `crates/linger-server/src/routes/server.rs`)
- Voice runtime → Voice SFU: sends voice (evidence: `README.md`)
- Server application → Voice SFU: forwards voice
- Push relay → Phone notifications: delivers encrypted push (evidence: `client/src-tauri/gen/android/app/src/main/java/io/github/itsmattguenther/linger/LingerMessagingService.kt`)
- Member → Screen sharing UI: shares screen (evidence: `README.md`)
- Buddy list → Typed HTTP API: gets server data (evidence: `client/src/next/app/list/useShareWindow.ts`)
