# caiomcg/zoia architecture

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

- Interactive diagram: https://gitdiagram.com/caiomcg/zoia
- Repository: https://github.com/caiomcg/zoia

## Overview

Zoia is a self-hosted social screen-sharing and voice platform, with desktop and Android clients and a Node server. The main workflow is: sign in and join a channel, publish screen/window/camera media (optionally with application audio), and let channel members choose broadcasts to watch. Separate product branches cover voice, chats and direct messages, scheduled events, soundboards, and server-managed addons. The graph combines sampled client/server code with README-documented capabilities; some server routing and integrations are not shown in the excerpts, so those links are omitted or marked unverified.

Main entry points: [`desktop/src/renderer/App.tsx`](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/App.tsx) (Desktop app), [`server/src/app.js`](https://github.com/caiomcg/zoia/blob/main/server/src/app.js) (Server application), [`android/app/src/main/kotlin/im/zoia/MainActivity.kt`](https://github.com/caiomcg/zoia/blob/main/android/app/src/main/kotlin/im/zoia/MainActivity.kt) (Android client), [`desktop/src/renderer/chat/useChat.ts`](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/chat/useChat.ts) (Chat client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop client"]
  node_desktop_app["Desktop app<br/>[App.tsx]"]
  node_desktop_ipc["Desktop IPC<br/>[ipc.ts]"]
  node_android_app["Android client<br/>[MainActivity.kt]"]
  node_android_api["Android API client<br/>[ZoiaApiClient.kt]"]
end

subgraph group_media["Live media"]
  node_room_client["Room publishing<br/>[useRoom.ts]"]
  node_voice_pipeline["Voice processing<br/>[pipeline.ts]"]
  node_livekit{{"LiveKit SFU"}}
end

subgraph group_social["Social features"]
  node_chat_client["Chat client<br/>[useChat.ts]"]
  node_chat_ui["Chat presentation<br/>[ChatView.tsx]"]
  node_schedule_client["Events and birthdays<br/>[useSchedule.ts]"]
  node_sound_cues["Sound cues<br/>[useSoundCues.ts]"]
  node_android_chat["Android chat manager<br/>[ChatManager.kt]"]
end

subgraph group_server["Server services"]
  node_server_app["Server application<br/>[app.js]"]
  node_accounts["Accounts and approval<br/>[accounts.js]"]
  node_chat_routes["Chat API<br/>[chat-routes.js]"]
  node_messages["Message service<br/>[messages.js]"]
  node_store[("Persistent store<br/>[store.js]")]
end

subgraph group_addons["Addon system"]
  node_addon_routes["Addon API<br/>[addon-routes.js]"]
  node_addons["Addon registry<br/>[addons.js]"]
  node_addon_host["Addon host<br/>[host.js]"]
  node_addon_container{{"Addon containers"}}
end

node_person(("Participant"))

node_person -->|"uses"| node_desktop_app
node_person -->|"uses"| node_android_app
node_desktop_app -->|"starts sharing"| node_room_client
node_room_client -->|"publishes and watches"| node_livekit
node_desktop_app -->|"processes microphone"| node_voice_pipeline
node_voice_pipeline -->|"provides audio track"| node_room_client
node_desktop_app -->|"uses shared contracts"| node_desktop_ipc
node_desktop_app -->|"loads chat state"| node_chat_client
node_chat_client -.->|"feeds chat view"| node_chat_ui
node_chat_client -.->|"requests chats"| node_server_app
node_desktop_app -->|"loads events"| node_schedule_client
node_schedule_client -.->|"requests schedules"| node_server_app
node_desktop_app -->|"plays cues"| node_sound_cues
node_android_app -.->|"makes API calls"| node_android_api
node_android_app -.->|"uses chat manager"| node_android_chat
node_android_chat -->|"sends chat requests"| node_android_api
node_android_api -.->|"calls server"| node_server_app
node_server_app -.->|"routes account requests"| node_accounts
node_accounts -->|"reads and writes"| node_store
node_chat_routes -->|"reads messages"| node_messages
node_chat_routes -.->|"reads chat list"| node_store
node_server_app -->|"mounts chat API"| node_chat_routes
node_addon_routes -->|"authenticates addons"| node_addons
node_server_app -.->|"routes addon requests"| node_addon_routes
node_addon_host -->|"manages containers"| node_addon_container

click node_desktop_app "https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/App.tsx"
click node_desktop_ipc "https://github.com/caiomcg/zoia/blob/main/desktop/src/shared/ipc.ts"
click node_android_app "https://github.com/caiomcg/zoia/blob/main/android/app/src/main/kotlin/im/zoia/MainActivity.kt"
click node_android_api "https://github.com/caiomcg/zoia/blob/main/android/app/src/main/kotlin/im/zoia/api/ZoiaApiClient.kt"
click node_room_client "https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/livekit/useRoom.ts"
click node_voice_pipeline "https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/voice/pipeline.ts"
click node_chat_client "https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/chat/useChat.ts"
click node_chat_ui "https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/components/ChatView.tsx"
click node_schedule_client "https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/schedule/useSchedule.ts"
click node_sound_cues "https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/sounds/useSoundCues.ts"
click node_android_chat "https://github.com/caiomcg/zoia/blob/main/android/app/src/main/kotlin/im/zoia/chat/ChatManager.kt"
click node_server_app "https://github.com/caiomcg/zoia/blob/main/server/src/app.js"
click node_accounts "https://github.com/caiomcg/zoia/blob/main/server/src/accounts.js"
click node_chat_routes "https://github.com/caiomcg/zoia/blob/main/server/src/chat-routes.js"
click node_messages "https://github.com/caiomcg/zoia/blob/main/server/src/messages.js"
click node_store "https://github.com/caiomcg/zoia/blob/main/server/src/store.js"
click node_addon_routes "https://github.com/caiomcg/zoia/blob/main/server/src/addon-routes.js"
click node_addons "https://github.com/caiomcg/zoia/blob/main/server/src/addons.js"
click node_addon_host "https://github.com/caiomcg/zoia/blob/main/addon-host/src/host.js"

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_app,node_desktop_ipc,node_android_app,node_android_api toneBlue
class node_room_client,node_voice_pipeline,node_livekit toneAmber
class node_chat_client,node_chat_ui,node_schedule_client,node_sound_cues,node_android_chat toneMint
class node_server_app,node_accounts,node_chat_routes,node_messages,node_store toneRose
class node_addon_routes,node_addons,node_addon_host,node_addon_container,node_person toneIndigo
```

## Components

### Desktop client

- [Desktop app](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/App.tsx): `desktop/src/renderer/App.tsx`
- [Desktop IPC](https://github.com/caiomcg/zoia/blob/main/desktop/src/shared/ipc.ts): `desktop/src/shared/ipc.ts`
- [Android client](https://github.com/caiomcg/zoia/blob/main/android/app/src/main/kotlin/im/zoia/MainActivity.kt): `android/app/src/main/kotlin/im/zoia/MainActivity.kt`
- [Android API client](https://github.com/caiomcg/zoia/blob/main/android/app/src/main/kotlin/im/zoia/api/ZoiaApiClient.kt): `android/app/src/main/kotlin/im/zoia/api/ZoiaApiClient.kt`

### Live media

- [Room publishing](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/livekit/useRoom.ts): `desktop/src/renderer/livekit/useRoom.ts`
- [Voice processing](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/voice/pipeline.ts): `desktop/src/renderer/voice/pipeline.ts`
- **LiveKit SFU**

### Social features

- [Chat client](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/chat/useChat.ts): `desktop/src/renderer/chat/useChat.ts`
- [Chat presentation](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/components/ChatView.tsx): `desktop/src/renderer/components/ChatView.tsx`
- [Events and birthdays](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/schedule/useSchedule.ts): `desktop/src/renderer/schedule/useSchedule.ts`
- [Sound cues](https://github.com/caiomcg/zoia/blob/main/desktop/src/renderer/sounds/useSoundCues.ts): `desktop/src/renderer/sounds/useSoundCues.ts`
- [Android chat manager](https://github.com/caiomcg/zoia/blob/main/android/app/src/main/kotlin/im/zoia/chat/ChatManager.kt): `android/app/src/main/kotlin/im/zoia/chat/ChatManager.kt`

### Server services

- [Server application](https://github.com/caiomcg/zoia/blob/main/server/src/app.js): `server/src/app.js`
- [Accounts and approval](https://github.com/caiomcg/zoia/blob/main/server/src/accounts.js): `server/src/accounts.js`
- [Chat API](https://github.com/caiomcg/zoia/blob/main/server/src/chat-routes.js): `server/src/chat-routes.js`
- [Message service](https://github.com/caiomcg/zoia/blob/main/server/src/messages.js): `server/src/messages.js`
- [Persistent store](https://github.com/caiomcg/zoia/blob/main/server/src/store.js): `server/src/store.js`

### Addon system

- [Addon API](https://github.com/caiomcg/zoia/blob/main/server/src/addon-routes.js): `server/src/addon-routes.js`
- [Addon registry](https://github.com/caiomcg/zoia/blob/main/server/src/addons.js): `server/src/addons.js`
- [Addon host](https://github.com/caiomcg/zoia/blob/main/addon-host/src/host.js): `addon-host/src/host.js`
- **Addon containers**

### Other components

- **Participant**

## Connections

- Participant → Desktop app: uses (evidence: `README.md`)
- Participant → Android client: uses (evidence: `README.md`)
- Desktop app → Room publishing: starts sharing (evidence: `desktop/src/renderer/App.tsx`)
- Room publishing → LiveKit SFU: publishes and watches (evidence: `README.md`)
- Desktop app → Voice processing: processes microphone (evidence: `desktop/src/renderer/App.tsx`)
- Voice processing → Room publishing: provides audio track (evidence: `desktop/src/renderer/voice/pipeline.ts`)
- Desktop app → Desktop IPC: uses shared contracts (evidence: `desktop/src/renderer/App.tsx`)
- Desktop app → Chat client: loads chat state (evidence: `desktop/src/renderer/App.tsx`)
- Chat client → Chat presentation: feeds chat view
- Chat client → Server application: requests chats
- Desktop app → Events and birthdays: loads events (evidence: `desktop/src/renderer/App.tsx`)
- Events and birthdays → Server application: requests schedules
- Desktop app → Sound cues: plays cues (evidence: `desktop/src/renderer/App.tsx`)
- Android client → Android API client: makes API calls
- Android client → Android chat manager: uses chat manager
- Android chat manager → Android API client: sends chat requests (evidence: `android/app/src/main/kotlin/im/zoia/chat/ChatManager.kt`)
- Android API client → Server application: calls server
- Server application → Accounts and approval: routes account requests
- Accounts and approval → Persistent store: reads and writes (evidence: `server/src/accounts.js`)
- Chat API → Message service: reads messages (evidence: `server/src/chat-routes.js`)
- Chat API → Persistent store: reads chat list
- Server application → Chat API: mounts chat API (evidence: `server/src/chat-routes.js`)
- Addon API → Addon registry: authenticates addons (evidence: `server/src/addon-routes.js`)
- Server application → Addon API: routes addon requests
- Addon host → Addon containers: manages containers (evidence: `addon-host/src/host.js`)
