# yuredazo/manifold architecture

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

- Interactive diagram: https://gitdiagram.com/yuredazo/manifold
- Repository: https://github.com/yuredazo/manifold

## Overview

Manifold is an Android live-feed SDK and hub, with optional encrypted sharing between hubs, including a Windows hub. The main local workflow is an app announcing a feed, another app subscribing with a Surface, and the hub mediating access before handing the Surface to the sender. The graph also preserves screen sharing, remote feeds, and Windows capture/encoding. Internal links are limited to relationships shown in the excerpts or SOURCE INDEX; broader product behavior is attributed to the README.

Main entry points: [`hub/src/main/kotlin/dev/mkzk/manifold/hub/network/Network.kt`](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/Network.kt) (Network transport), [`sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldSender.kt`](https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldSender.kt) (Sender API), [`sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldReceiver.kt`](https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldReceiver.kt) (Receiver API), [`sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldConnection.kt`](https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldConnection.kt) (Hub connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["Android SDK"]
  node_sender_api["Sender API<br/>[ManifoldSender.kt]"]
  node_receiver_api["Receiver API"]
  node_connection["Hub connection"]
  node_sdk_contract["SDK contract<br/>[Manifold.kt]"]
end

subgraph group_hub["Android Hub"]
  node_hub_activity["Hub app<br/>[HubActivity.kt]"]
  node_hub_service["Broker service<br/>[HubService.kt]"]
  node_registry["Feed registry<br/>[Registry.kt]"]
  node_access["Access decisions<br/>[AccessBook.kt]"]
  node_preview["Local previews<br/>[PreviewSession.kt]"]
  node_screen_share["Screen sharing"]
end

subgraph group_network["Device Networking"]
  node_network_service["Network lifecycle<br/>[NetworkService.kt]"]
  node_network_core["Network transport<br/>[Network.kt]"]
  node_protocol["Wire protocol<br/>[Session.kt]"]
  node_streaming["Stream handling"]
end

subgraph group_desktop["Windows Hub"]
  node_desktop_capture["Media capture<br/>[capture_host.cpp]"]
  node_desktop_audio["Audio capture"]
  node_desktop_encode["Media encoding<br/>[h264_encoder.cpp]"]
  node_desktop_window["Desktop host<br/>[window_host.cpp]"]
end

node_sending_app(("Sending app"))
node_receiving_app(("Receiving app"))
node_peer_hub(("Paired hub"))

node_sending_app -->|"announces feed"| node_sender_api
node_receiving_app -->|"subscribes by name"| node_receiver_api
node_sender_api -->|"binds to hub"| node_connection
node_receiver_api -->|"binds to hub"| node_connection
node_sender_api -->|"uses constants"| node_sdk_contract
node_receiver_api -->|"validates requests"| node_sdk_contract
node_connection -->|"binds remotely"| node_hub_service
node_hub_service -->|"registers feeds"| node_registry
node_registry -->|"checks access"| node_access
node_hub_activity -->|"restores networking"| node_network_service
node_hub_activity -->|"starts sharing"| node_screen_share
node_preview -->|"subscribes preview"| node_registry
node_network_service -->|"starts transport"| node_network_core
node_network_core -.->|"exchanges sessions"| node_protocol
node_network_core -.->|"handles media streams"| node_streaming
node_network_core -->|"sends encrypted feeds"| node_peer_hub
node_peer_hub -->|"returns remote feeds"| node_network_core
node_desktop_capture -.->|"supplies video"| node_desktop_encode
node_desktop_audio -.->|"supplies audio"| node_desktop_encode
node_desktop_window -.->|"hosts capture"| node_desktop_capture
node_desktop_window -->|"pairs over network"| node_peer_hub

click node_sender_api "https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldSender.kt"
click node_receiver_api "https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldReceiver.kt"
click node_connection "https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldConnection.kt"
click node_sdk_contract "https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/Manifold.kt"
click node_hub_activity "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/app/HubActivity.kt"
click node_hub_service "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/HubService.kt"
click node_registry "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/Registry.kt"
click node_access "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/AccessBook.kt"
click node_preview "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/ui/PreviewSession.kt"
click node_screen_share "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/screen/ScreenShareService.kt"
click node_network_service "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/NetworkService.kt"
click node_network_core "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/Network.kt"
click node_protocol "https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/protocol/Session.kt"
click node_streaming "https://github.com/yuredazo/manifold/tree/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/stream"
click node_desktop_capture "https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/capture/capture_host.cpp"
click node_desktop_audio "https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/audio/app_audio_capturer.cpp"
click node_desktop_encode "https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/encode/h264_encoder.cpp"
click node_desktop_window "https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/viewer/window_host.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_sender_api,node_receiver_api,node_connection,node_sdk_contract toneBlue
class node_hub_activity,node_hub_service,node_registry,node_access,node_preview,node_screen_share toneAmber
class node_network_service,node_network_core,node_protocol,node_streaming toneMint
class node_desktop_capture,node_desktop_audio,node_desktop_encode,node_desktop_window toneRose
class node_sending_app,node_receiving_app,node_peer_hub toneIndigo
```

## Components

### Android SDK

- [Sender API](https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldSender.kt): `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldSender.kt`
- [Receiver API](https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldReceiver.kt): `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldReceiver.kt`
- [Hub connection](https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldConnection.kt): `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldConnection.kt`
- [SDK contract](https://github.com/yuredazo/manifold/blob/main/sdk/src/main/kotlin/dev/mkzk/manifold/Manifold.kt): `sdk/src/main/kotlin/dev/mkzk/manifold/Manifold.kt`

### Android Hub

- [Hub app](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/app/HubActivity.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/app/HubActivity.kt`
- [Broker service](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/HubService.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/HubService.kt`
- [Feed registry](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/Registry.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/Registry.kt`
- [Access decisions](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/AccessBook.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/AccessBook.kt`
- [Local previews](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/ui/PreviewSession.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/ui/PreviewSession.kt`
- [Screen sharing](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/screen/ScreenShareService.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/screen/ScreenShareService.kt`

### Device Networking

- [Network lifecycle](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/NetworkService.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/network/NetworkService.kt`
- [Network transport](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/Network.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/network/Network.kt`
- [Wire protocol](https://github.com/yuredazo/manifold/blob/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/protocol/Session.kt): `hub/src/main/kotlin/dev/mkzk/manifold/hub/network/protocol/Session.kt`
- [Stream handling](https://github.com/yuredazo/manifold/tree/main/hub/src/main/kotlin/dev/mkzk/manifold/hub/network/stream): `hub/src/main/kotlin/dev/mkzk/manifold/hub/network/stream`

### Windows Hub

- [Media capture](https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/capture/capture_host.cpp): `desktop/windows/runner/capture/capture_host.cpp`
- [Audio capture](https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/audio/app_audio_capturer.cpp): `desktop/windows/runner/audio/app_audio_capturer.cpp`
- [Media encoding](https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/encode/h264_encoder.cpp): `desktop/windows/runner/encode/h264_encoder.cpp`
- [Desktop host](https://github.com/yuredazo/manifold/blob/main/desktop/windows/runner/viewer/window_host.cpp): `desktop/windows/runner/viewer/window_host.cpp`

### Other components

- **Sending app**
- **Receiving app**
- **Paired hub**

## Connections

- Sending app → Sender API: announces feed (evidence: `README.md`)
- Receiving app → Receiver API: subscribes by name (evidence: `README.md`)
- Sender API → Hub connection: binds to hub (evidence: `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldSender.kt`)
- Receiver API → Hub connection: binds to hub (evidence: `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldReceiver.kt`)
- Sender API → SDK contract: uses constants (evidence: `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldSender.kt`)
- Receiver API → SDK contract: validates requests (evidence: `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldReceiver.kt`)
- Hub connection → Broker service: binds remotely (evidence: `sdk/src/main/kotlin/dev/mkzk/manifold/ManifoldConnection.kt`)
- Broker service → Feed registry: registers feeds (evidence: `hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/HubService.kt`)
- Feed registry → Access decisions: checks access (evidence: `hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/Registry.kt`)
- Hub app → Network lifecycle: restores networking (evidence: `hub/src/main/kotlin/dev/mkzk/manifold/hub/app/HubActivity.kt`)
- Hub app → Screen sharing: starts sharing (evidence: `hub/src/main/kotlin/dev/mkzk/manifold/hub/app/HubActivity.kt`)
- Local previews → Feed registry: subscribes preview (evidence: `hub/src/main/kotlin/dev/mkzk/manifold/hub/broker/ui/PreviewSession.kt`)
- Network lifecycle → Network transport: starts transport (evidence: `hub/src/main/kotlin/dev/mkzk/manifold/hub/network/NetworkService.kt`)
- Network transport → Wire protocol: exchanges sessions
- Network transport → Stream handling: handles media streams
- Network transport → Paired hub: sends encrypted feeds (evidence: `README.md`)
- Paired hub → Network transport: returns remote feeds (evidence: `README.md`)
- Media capture → Media encoding: supplies video
- Audio capture → Media encoding: supplies audio
- Desktop host → Media capture: hosts capture
- Desktop host → Paired hub: pairs over network (evidence: `README.md`)
