# hushhq/hush architecture

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

- Interactive diagram: https://gitdiagram.com/hushhq/hush
- Repository: https://github.com/hushhq/hush

## Overview

1. **What this repository is**
   - `hush` is not the runtime product codebase. It is the **public coordination and entry-point repo** for the Hush platform.
   - Its main responsibilities are: user triage, architectural documentation, self-hosting entry points, contributor bootstrap scripts, and issue routing.

2. **Where the real system lives**
   - The actual implementation is split across sibling repositories:
     - `hush-web` for the browser client
     - `hush-desktop` for the Electron desktop client
     - `hush-mobile` for the planned React Native client
     - `hush-server` for backend relay/storage/admin and media integration
     - `hush-crypto` for the MLS cryptography core
     - `hush-directory` for planned discovery/federation-adjacent work
   - This repo documents the boundaries between them rather than implementing them.

3. **Top-level product architecture**
   - The platform is built around **end-to-end encrypted messaging, voice, and video**.
   - Clients produce and consume **MLS ciphertext**; the server moves encrypted bytes and does not have decryption keys.
   - The architecture diagram in the README is the canonical cross-repo view: clients on top, `hush-server` in the middle, `hush-crypto` underneath as shared client-side state machinery, and `hush-directory` as a future discovery layer.

4. **Client boundary**
   - `hush-web` is the primary user-facing client and is the base bundle reused by `hush-desktop`.
   - The client boundary is where encryption happens, where MLS group state is maintained, and where the user experiences messaging and calls.
   - The repo notes that the same web bundle is wrapped by Electron for desktop, so the desktop app is not a separate backend architecture.

5. **Crypto boundary**
   - `hush-crypto` is the shared cryptography subsystem.
   - It owns **MLS group state** and is compiled from Rust to WASM for use in clients.
   - This is the trust boundary that protects message, voice, and video keys from server access.

6. **Server boundary**
   - `hush-server` is the backend relay and storage plane.
   - It provides the API, PostgreSQL, Redis, instance administration, and integration with LiveKit for media signaling and transport.
   - Its architectural role is infrastructure mediation: authentication/session handling, message relay, state persistence, and media coordination, not content inspection.

7. **Media flow**
   - Voice and video are handled through a LiveKit-based SFU path.
   - The README states that voice/video keys are derived from the channel’s MLS exporter secret, so the SFU only sees opaque encrypted media payloads.
   - This means the media stack is part of the transport plane, not the trust plane.

8. **Self-hosting path**
   - The production self-hosting entry point is **`hush-server`**, not this repo.
   - This repo links to the operational docs and explains that a self-hosted deployment includes the API, Postgres, Redis, LiveKit, Caddy, and storage where applicable.
   - The public web client is external by default, so self-hosting focuses on the backend/media plane rather than rebuilding the entire product stack.

9. **Local development workspace**
   - `scripts/bootstrap.sh` is the main contributor convenience script in this repo.
   - It clones the sibling component repos side by side and starts the development compose stack from `hush-server/docker-compose.yml`.
   - This is a local development orchestration aid, distinct from the production self-hosting flow.

10. **Documentation as architecture governance**
   - `docs/CORE-INVARIANTS.md` is the cross-repo product contract: it defines the invariants that must not break across auth, vault, device linking, MLS, messaging, voice, identity labels, desktop runtime, deploy, and release flows.
   - `docs/ARCHITECTURE-BOUNDARIES.md` defines ownership boundaries such as state ownership, query usage, runtime schemas, cross-device tests, and telemetry.
   - These docs function as architecture guardrails for all component repositories.

11. **Issue and security workflow**
   - User-facing bugs and feature requests are intentionally centralized here, while component repos are for implementation-level issues and pull requests.
   - `docs/TRIAGE.md` separates public issue handling from security disclosure; security reports are not handled through public GitHub issues.
   - This repo is therefore the front door for product feedback, not the code review home for the runtime components.

12. **CI and repository hygiene**
   - The GitHub workflow `validate.yml` and the `scripts/check-doc-links.mjs` script indicate a lightweight validation layer focused on documentation integrity.
   - The repo’s tooling is about keeping public docs, links, and routing accurate rather than building or deploying application code.

Main entry points: [`README.md`](https://github.com/hushhq/hush/blob/main/README.md) (README), [`docs/TRIAGE.md`](https://github.com/hushhq/hush/blob/main/docs/TRIAGE.md) (Triage), [`scripts/bootstrap.sh`](https://github.com/hushhq/hush/blob/main/scripts/bootstrap.sh) (Bootstrap), [`docs/REPOSITORY-OPERATIONS.md`](https://github.com/hushhq/hush/blob/main/docs/REPOSITORY-OPERATIONS.md) (Repo ops)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_docs["Docs & governance"]
  node_node_readme["README<br/>entry docs<br/>[README.md]"]
  node_node_triage["Triage<br/>issue routing<br/>[TRIAGE.md]"]
  node_node_core["Core invariants<br/>contract<br/>[CORE-INVARIANTS.md]"]
  node_node_boundaries["Boundaries<br/>ownership rules"]
  node_node_ops["Repo ops<br/>operating guide"]
  node_node_bug_reporting["Bug reporting<br/>reporting guide<br/>[BUG-REPORTING.md]"]
  node_node_security["Security<br/>disclosure policy<br/>[SECURITY.md]"]
end

subgraph group_group_ops["Bootstrap & validation"]
  node_node_bootstrap["Bootstrap<br/>dev setup<br/>[bootstrap.sh]"]
  node_node_links["Link check<br/>doc validator"]
  node_node_validate["Validate CI<br/>workflow<br/>[validate.yml]"]
end

node_node_web["Web client<br/>client repo"]
node_node_desktop["Desktop app<br/>electron wrapper"]
node_node_mobile["Mobile app<br/>planned client"]
node_node_server[("Server plane<br/>backend repo")]
node_node_crypto{{"Crypto core<br/>WASM MLS"}}
node_node_directory(("Directory<br/>future discovery"))

node_node_readme -->|"describes"| node_node_web
node_node_readme -->|"describes"| node_node_server
node_node_readme -->|"describes"| node_node_crypto
node_node_readme -->|"describes"| node_node_directory
node_node_web -->|"shared bundle"| node_node_desktop
node_node_web -->|"uses"| node_node_crypto
node_node_desktop -->|"uses"| node_node_crypto
node_node_mobile -.->|"planned use"| node_node_crypto
node_node_server -->|"opaque media"| node_node_crypto
node_node_server -->|"serves"| node_node_web
node_node_server -->|"serves"| node_node_desktop
node_node_server -.->|"future integration"| node_node_directory
node_node_bootstrap -->|"starts stack"| node_node_server
node_node_bootstrap -->|"clones"| node_node_web
node_node_validate -->|"runs"| node_node_links
node_node_validate -->|"guards"| node_node_core
node_node_triage -->|"routes away"| node_node_security
node_node_triage -->|"separates"| node_node_bug_reporting
node_node_core -->|"refined by"| node_node_boundaries
node_node_ops -->|"documents"| node_node_bootstrap
node_node_ops -->|"documents"| node_node_triage

click node_node_readme "https://github.com/hushhq/hush/blob/main/README.md"
click node_node_triage "https://github.com/hushhq/hush/blob/main/docs/TRIAGE.md"
click node_node_core "https://github.com/hushhq/hush/blob/main/docs/CORE-INVARIANTS.md"
click node_node_boundaries "https://github.com/hushhq/hush/blob/main/docs/ARCHITECTURE-BOUNDARIES.md"
click node_node_ops "https://github.com/hushhq/hush/blob/main/docs/REPOSITORY-OPERATIONS.md"
click node_node_bug_reporting "https://github.com/hushhq/hush/blob/main/docs/BUG-REPORTING.md"
click node_node_security "https://github.com/hushhq/hush/blob/main/SECURITY.md"
click node_node_bootstrap "https://github.com/hushhq/hush/blob/main/scripts/bootstrap.sh"
click node_node_links "https://github.com/hushhq/hush/blob/main/scripts/check-doc-links.mjs"
click node_node_validate "https://github.com/hushhq/hush/blob/main/.github/workflows/validate.yml"

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_node_readme,node_node_triage,node_node_core,node_node_boundaries,node_node_ops,node_node_bug_reporting,node_node_security toneBlue
class node_node_bootstrap,node_node_links,node_node_validate toneAmber
class node_node_web,node_node_desktop,node_node_mobile,node_node_server,node_node_crypto,node_node_directory toneNeutral
```

## Components

### Docs & governance

Cross-repo architecture rules, triage, and operating guidance

- [README](https://github.com/hushhq/hush/blob/main/README.md): entry docs · Canonical cross-repo overview of the Hush platform and this repo's coordination role · `README.md`
- [Triage](https://github.com/hushhq/hush/blob/main/docs/TRIAGE.md): issue routing · Public issue intake and routing rules for bugs, features, and security reports · `docs/TRIAGE.md`
- [Core invariants](https://github.com/hushhq/hush/blob/main/docs/CORE-INVARIANTS.md): contract · Cross-repo product contract covering auth, vault, device linking, MLS, messaging, calls, identity, desktop, deploy, and release flows · `docs/CORE-INVARIANTS.md`
- [Boundaries](https://github.com/hushhq/hush/blob/main/docs/ARCHITECTURE-BOUNDARIES.md): ownership rules · Defines subsystem ownership, state/query boundaries, schemas, tests, and telemetry rules across repos · `docs/ARCHITECTURE-BOUNDARIES.md`
- [Repo ops](https://github.com/hushhq/hush/blob/main/docs/REPOSITORY-OPERATIONS.md): operating guide · Repository workflows, contributor guidance, and public coordination practices · `docs/REPOSITORY-OPERATIONS.md`
- [Bug reporting](https://github.com/hushhq/hush/blob/main/docs/BUG-REPORTING.md): reporting guide · User-facing bug report workflow and intake guidance · `docs/BUG-REPORTING.md`
- [Security](https://github.com/hushhq/hush/blob/main/SECURITY.md): disclosure policy · Security disclosure guidance and private reporting path · `SECURITY.md`

### Bootstrap & validation

Local setup and lightweight repository checks

- [Bootstrap](https://github.com/hushhq/hush/blob/main/scripts/bootstrap.sh): dev setup · Clones sibling component repos and starts the local development stack · `scripts/bootstrap.sh`
- [Link check](https://github.com/hushhq/hush/blob/main/scripts/check-doc-links.mjs): doc validator · Checks documentation links and repository references for integrity · `scripts/check-doc-links.mjs`
- [Validate CI](https://github.com/hushhq/hush/blob/main/.github/workflows/validate.yml): workflow · Repository validation workflow focused on documentation and link hygiene · `.github/workflows/validate.yml`

### Other components

- **Web client**: client repo · Primary browser client where encrypted messaging and calls are experienced
- **Desktop app**: electron wrapper · Desktop runtime that wraps the shared web bundle
- **Mobile app**: planned client · Planned React Native client for the platform
- **Server plane**: backend repo · API, relay, storage, admin, and LiveKit integration for encrypted messaging and media transport
- **Crypto core**: WASM MLS · Shared Rust-to-WASM MLS state and key management used by clients
- **Directory**: future discovery · Planned discovery and federation-adjacent layer

## Connections

- README → Web client: describes · Canonical architecture view places the browser client at the top of the product stack
- README → Server plane: describes · Documents the backend relay/storage plane as the production self-hosting entry point
- README → Crypto core: describes · Explains MLS cryptography as the shared trust boundary below clients
- README → Directory: describes · Shows planned discovery/federation work as a future layer
- Web client → Desktop app: shared bundle · Desktop is an Electron wrapper around the same web client bundle
- Web client → Crypto core: uses · Client-side MLS state and encryption rely on the shared crypto core
- Desktop app → Crypto core: uses · Desktop client inherits the same crypto boundary through the shared bundle
- Mobile app → Crypto core: planned use · Planned mobile client is expected to reuse the shared cryptography core
- Server plane → Crypto core: opaque media · Server transports encrypted bytes but does not hold decryption keys
- Server plane → Web client: serves · Backend plane supports the browser client with API, relay, and persistence
- Server plane → Desktop app: serves · Backend plane supports the desktop wrapper through the same API and media path
- Server plane → Directory: future integration · Directory is positioned as an adjacent future service boundary
- Bootstrap → Server plane: starts stack · Local bootstrap launches the development compose stack from the server repo
- Bootstrap → Web client: clones · Contributor bootstrap pulls sibling repos side by side for local work
- Validate CI → Link check: runs · CI validation includes repository documentation link checking
- Validate CI → Core invariants: guards · Validation supports keeping architectural contracts and docs consistent
- Triage → Security: routes away · Security reports are kept out of public issue handling
- Triage → Bug reporting: separates · Public bug handling is distinct from security disclosure
- Core invariants → Boundaries: refined by · Architecture boundaries operationalize the core product invariants
- Repo ops → Bootstrap: documents · Repository operations guide the local contributor bootstrap path
- Repo ops → Triage: documents · Operating guidance covers public issue intake and routing
