# creadorlanda/yo architecture

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

- Interactive diagram: https://gitdiagram.com/creadorlanda/yo
- Repository: https://github.com/creadorlanda/yo

## Overview

ZwoSocial is an alpha privacy-focused messenger: people authenticate in the mobile app, then use messaging, media, social, and calling features. The mobile client includes on-device encryption; the Go server exposes API and real-time services and stores encrypted message content. The map preserves documented product capabilities, while source-indexed controller and wiring evidence supports several backend relationships. Many mobile screens, API calls, and backend internals were not sampled, so their detailed runtime links are intentionally omitted.

Main entry points: [`server/internal/server/server.go`](https://github.com/creadorlanda/yo/blob/main/server/internal/server/server.go) (HTTP server wiring), [`mobile/app`](https://github.com/creadorlanda/yo/tree/main/mobile/app) (Expo app), [`mobile/data/api/client.ts`](https://github.com/creadorlanda/yo/blob/main/mobile/data/api/client.ts) (API client), [`mobile/data/crypto/session.ts`](https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/session.ts) (Message sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile experience"]
  node_app["Expo app"]
  node_chat_ui["Chats and search<br/>[&#91;id&#93;.tsx]"]
  node_media_ui["Media composer"]
  node_story_ui["Stories<br/>[story-composer.tsx]"]
  node_call_ui["Calls and lives<br/>[&#91;id&#93;.tsx]"]
  node_game_ui["Group games<br/>[game-room.tsx]"]
  node_theme_ui["Themes<br/>[index.tsx]"]
end

subgraph group_client_data["Client data and security"]
  node_client_api["API client<br/>[client.ts]"]
  node_local_db[("Encrypted local database")]
  node_session_crypto["Message sessions<br/>[session.ts]"]
  node_device_keys["Device keys<br/>[device-keys.ts]"]
  node_group_crypto["Group sessions<br/>[group-session.ts]"]
  node_crypto_primitives["Crypto primitives<br/>[primitives.ts]"]
  node_crypto_encoding["Key encoding<br/>[encoding.ts]"]
  node_crypto_prng["Random source<br/>[prng.ts]"]
end

subgraph group_social["Social features"]
  node_channels["Channels<br/>[controller.go]"]
  node_groups["Groups<br/>[controller.go]"]
  node_stories_posts["Stories and posts<br/>[controller.go]"]
end

subgraph group_backend["Backend services"]
  node_auth["Authentication<br/>[controller.go]"]
  node_messages["Messaging<br/>[controller.go]"]
  node_media["Media service<br/>[controller.go]"]
  node_calls_lives["Calls and live rooms"]
  node_bots["Bots<br/>[controller.go]"]
end

subgraph group_platform["Server platform"]
  node_server_entry["HTTP server wiring<br/>[server.go]"]
  node_api_process["API process<br/>[main.go]"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis")]
  node_livekit["LiveKit SFU"]
  node_push["Push delivery"]
end

node_person(("Messenger user"))

node_person -->|"uses"| node_app
node_app -->|"opens"| node_chat_ui
node_app -->|"composes"| node_media_ui
node_app -->|"creates"| node_story_ui
node_app -->|"starts"| node_call_ui
node_app -->|"plays"| node_game_ui
node_app -->|"customizes"| node_theme_ui
node_chat_ui -.->|"encrypts messages"| node_session_crypto
node_session_crypto -->|"loads keys"| node_device_keys
node_session_crypto -->|"encodes data"| node_crypto_encoding
node_session_crypto -->|"loads randomness"| node_crypto_prng
node_session_crypto -->|"uses primitives"| node_crypto_primitives
node_group_crypto -->|"uses encoding"| node_crypto_encoding
node_group_crypto -->|"uses randomness"| node_crypto_prng
node_group_crypto -->|"uses sessions"| node_session_crypto
node_app -.->|"requests services"| node_client_api
node_client_api -.->|"calls API"| node_auth
node_client_api -.->|"calls API"| node_messages
node_client_api -.->|"calls API"| node_channels
node_client_api -.->|"calls API"| node_groups
node_client_api -.->|"calls API"| node_media
node_client_api -.->|"calls API"| node_calls_lives
node_api_process -->|"starts"| node_server_entry
node_server_entry -->|"registers routes"| node_auth
node_server_entry -->|"registers routes"| node_messages
node_server_entry -->|"registers routes"| node_channels
node_server_entry -->|"registers routes"| node_groups
node_server_entry -->|"registers routes"| node_stories_posts
node_server_entry -->|"registers routes"| node_media
node_server_entry -->|"registers routes"| node_calls_lives
node_server_entry -->|"registers routes"| node_bots
node_messages -.->|"persists data"| node_postgres
node_calls_lives -.->|"controls rooms"| node_livekit
node_server_entry -->|"notifies users"| node_push
node_server_entry -.->|"uses platform store"| node_redis

click node_app "https://github.com/creadorlanda/yo/tree/main/mobile/app"
click node_chat_ui "https://github.com/creadorlanda/yo/blob/main/mobile/app/chat/%5Bid%5D.tsx"
click node_media_ui "https://github.com/creadorlanda/yo/blob/main/mobile/components/chat/attachment-composer.tsx"
click node_story_ui "https://github.com/creadorlanda/yo/blob/main/mobile/components/camera/story-composer.tsx"
click node_call_ui "https://github.com/creadorlanda/yo/blob/main/mobile/app/call/%5Bid%5D.tsx"
click node_game_ui "https://github.com/creadorlanda/yo/blob/main/mobile/components/game/game-room.tsx"
click node_theme_ui "https://github.com/creadorlanda/yo/blob/main/mobile/app/themes/index.tsx"
click node_client_api "https://github.com/creadorlanda/yo/blob/main/mobile/data/api/client.ts"
click node_local_db "https://github.com/creadorlanda/yo/tree/main/mobile/data/db"
click node_session_crypto "https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/session.ts"
click node_device_keys "https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/device-keys.ts"
click node_group_crypto "https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/group-session.ts"
click node_crypto_primitives "https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/primitives.ts"
click node_crypto_encoding "https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/encoding.ts"
click node_crypto_prng "https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/prng.ts"
click node_auth "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/auth/controller.go"
click node_messages "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/messages/controller.go"
click node_channels "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/channels/controller.go"
click node_groups "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/groups/controller.go"
click node_stories_posts "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/posts/controller.go"
click node_media "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/media/controller.go"
click node_calls_lives "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/lives/controller_tools.go"
click node_bots "https://github.com/creadorlanda/yo/blob/main/server/internal/modules/bots/controller.go"
click node_server_entry "https://github.com/creadorlanda/yo/blob/main/server/internal/server/server.go"
click node_api_process "https://github.com/creadorlanda/yo/blob/main/server/cmd/api/main.go"

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,node_chat_ui,node_media_ui,node_story_ui,node_call_ui,node_game_ui,node_theme_ui,node_person toneBlue
class node_client_api,node_local_db,node_session_crypto,node_device_keys,node_group_crypto,node_crypto_primitives,node_crypto_encoding,node_crypto_prng toneAmber
class node_channels,node_groups,node_stories_posts toneMint
class node_auth,node_messages,node_media,node_calls_lives,node_bots toneRose
class node_server_entry,node_api_process,node_postgres,node_redis,node_livekit,node_push toneIndigo
```

## Components

### Mobile experience

- [Expo app](https://github.com/creadorlanda/yo/tree/main/mobile/app): `mobile/app`
- [Chats and search](https://github.com/creadorlanda/yo/blob/main/mobile/app/chat/%5Bid%5D.tsx): `mobile/app/chat/[id].tsx`
- [Media composer](https://github.com/creadorlanda/yo/blob/main/mobile/components/chat/attachment-composer.tsx): `mobile/components/chat/attachment-composer.tsx`
- [Stories](https://github.com/creadorlanda/yo/blob/main/mobile/components/camera/story-composer.tsx): `mobile/components/camera/story-composer.tsx`
- [Calls and lives](https://github.com/creadorlanda/yo/blob/main/mobile/app/call/%5Bid%5D.tsx): `mobile/app/call/[id].tsx`
- [Group games](https://github.com/creadorlanda/yo/blob/main/mobile/components/game/game-room.tsx): `mobile/components/game/game-room.tsx`
- [Themes](https://github.com/creadorlanda/yo/blob/main/mobile/app/themes/index.tsx): `mobile/app/themes/index.tsx`

### Client data and security

- [API client](https://github.com/creadorlanda/yo/blob/main/mobile/data/api/client.ts): `mobile/data/api/client.ts`
- [Encrypted local database](https://github.com/creadorlanda/yo/tree/main/mobile/data/db): `mobile/data/db`
- [Message sessions](https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/session.ts): `mobile/data/crypto/session.ts`
- [Device keys](https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/device-keys.ts): `mobile/data/crypto/device-keys.ts`
- [Group sessions](https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/group-session.ts): `mobile/data/crypto/group-session.ts`
- [Crypto primitives](https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/primitives.ts): `mobile/data/crypto/primitives.ts`
- [Key encoding](https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/encoding.ts): `mobile/data/crypto/encoding.ts`
- [Random source](https://github.com/creadorlanda/yo/blob/main/mobile/data/crypto/prng.ts): `mobile/data/crypto/prng.ts`

### Social features

- [Channels](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/channels/controller.go): `server/internal/modules/channels/controller.go`
- [Groups](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/groups/controller.go): `server/internal/modules/groups/controller.go`
- [Stories and posts](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/posts/controller.go): `server/internal/modules/posts/controller.go`

### Backend services

- [Authentication](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/auth/controller.go): `server/internal/modules/auth/controller.go`
- [Messaging](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/messages/controller.go): `server/internal/modules/messages/controller.go`
- [Media service](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/media/controller.go): `server/internal/modules/media/controller.go`
- [Calls and live rooms](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/lives/controller_tools.go): `server/internal/modules/lives/controller_tools.go`
- [Bots](https://github.com/creadorlanda/yo/blob/main/server/internal/modules/bots/controller.go): `server/internal/modules/bots/controller.go`

### Server platform

- [HTTP server wiring](https://github.com/creadorlanda/yo/blob/main/server/internal/server/server.go): `server/internal/server/server.go`
- [API process](https://github.com/creadorlanda/yo/blob/main/server/cmd/api/main.go): `server/cmd/api/main.go`
- **PostgreSQL**
- **Redis**
- **LiveKit SFU**
- **Push delivery**

### Other components

- **Messenger user**

## Connections

- Messenger user → Expo app: uses (evidence: `README.md`)
- Expo app → Chats and search: opens (evidence: `README.md`)
- Expo app → Media composer: composes (evidence: `README.md`)
- Expo app → Stories: creates (evidence: `README.md`)
- Expo app → Calls and lives: starts (evidence: `README.md`)
- Expo app → Group games: plays (evidence: `README.md`)
- Expo app → Themes: customizes (evidence: `README.md`)
- Chats and search → Message sessions: encrypts messages
- Message sessions → Device keys: loads keys (evidence: `mobile/data/crypto/session.ts`)
- Message sessions → Key encoding: encodes data (evidence: `mobile/data/crypto/session.ts`)
- Message sessions → Random source: loads randomness (evidence: `mobile/data/crypto/session.ts`)
- Message sessions → Crypto primitives: uses primitives (evidence: `mobile/data/crypto/session.ts`)
- Group sessions → Key encoding: uses encoding (evidence: `mobile/data/crypto/group-session.ts`)
- Group sessions → Random source: uses randomness (evidence: `mobile/data/crypto/group-session.ts`)
- Group sessions → Message sessions: uses sessions (evidence: `mobile/data/crypto/group-session.ts`)
- Expo app → API client: requests services
- API client → Authentication: calls API
- API client → Messaging: calls API
- API client → Channels: calls API
- API client → Groups: calls API
- API client → Media service: calls API
- API client → Calls and live rooms: calls API
- API process → HTTP server wiring: starts (evidence: `server/cmd/api/main.go`)
- HTTP server wiring → Authentication: registers routes (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Messaging: registers routes (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Channels: registers routes (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Groups: registers routes (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Stories and posts: registers routes (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Media service: registers routes (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Calls and live rooms: registers routes (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Bots: registers routes (evidence: `server/internal/server/server.go`)
- Messaging → PostgreSQL: persists data
- Calls and live rooms → LiveKit SFU: controls rooms
- HTTP server wiring → Push delivery: notifies users (evidence: `server/internal/server/server.go`)
- HTTP server wiring → Redis: uses platform store
