# pentest200/vibzo architecture

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

- Interactive diagram: https://gitdiagram.com/pentest200/vibzo
- Repository: https://github.com/pentest200/vibzo

## Overview

Commonroom is a web messaging and calling application. Its principal workflow is account authentication, finding or creating a conversation, sending durable messages and attachments, and keeping browser state synchronized; separate branches provide safety, avatars, calls, and background processing. The graph distinguishes API routing, domain services, browser state, and persistence. Several runtime modules are unsampled, so their internal call paths are omitted rather than inferred.

Main entry points: [`apps/api/src/app.ts`](https://github.com/pentest200/vibzo/blob/main/apps/api/src/app.ts) (HTTP API), [`packages/domain/src/messaging/service.ts`](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/messaging/service.ts) (Messaging service), [`packages/domain/src/mongo.ts`](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/mongo.ts) (Mongo persistence), [`packages/domain/src/sync/service.ts`](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/sync/service.ts) (Synchronization service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web["Chat interface"]
  node_authui["Authentication UI<br/>[auth-app.tsx]"]
  node_browserapi["API client<br/>[api.ts]"]
  node_syncui["Sync engine<br/>[sync-engine.ts]"]
  node_localdb[("Local sync store<br/>[sync-db.ts]")]
end

subgraph group_api["API and realtime"]
  node_apiapp["HTTP API<br/>[app.ts]"]
  node_authroute["Auth routes<br/>[auth.ts]"]
  node_convroutes["Conversation routes<br/>[conversations.ts]"]
  node_msgroutes["Message routes<br/>[messages.ts]"]
  node_syncroutes["Sync routes<br/>[sync.ts]"]
  node_gateway["Realtime gateway<br/>[app.ts]"]
end

subgraph group_domain["Messaging domain"]
  node_auth["Account service<br/>[service.ts]"]
  node_conversations["Conversation service<br/>[service.ts]"]
  node_messaging["Messaging service<br/>[service.ts]"]
  node_sync["Synchronization service<br/>[service.ts]"]
end

subgraph group_media["Media and safety"]
  node_attachments["Attachment service<br/>[service.ts]"]
  node_avatars["Avatar service<br/>[service.ts]"]
  node_safety["Safety service<br/>[service.ts]"]
  node_calls["Calling service<br/>[service.ts]"]
end

subgraph group_platform["Persistence and workers"]
  node_mongo[("Mongo persistence<br/>[mongo.ts]")]
  node_worker["Background worker<br/>[main.ts]"]
  node_processor["Media processor<br/>[server.mjs]"]
end

node_user(("Member"))

node_user -->|"uses chats"| node_web
node_user -->|"signs in"| node_authui
node_authui -->|"requests auth"| node_browserapi
node_authui -.->|"sets auth state"| node_web
node_web -.->|"calls API"| node_browserapi
node_syncui -->|"fetches updates"| node_browserapi
node_syncui -->|"persists pending state"| node_localdb
node_apiapp -->|"registers routes"| node_authroute
node_apiapp -->|"registers routes"| node_convroutes
node_apiapp -->|"registers routes"| node_msgroutes
node_apiapp -->|"registers routes"| node_syncroutes
node_browserapi -.->|"HTTP requests"| node_apiapp
node_authroute -->|"uses account domain"| node_auth
node_convroutes -->|"uses conversation domain"| node_conversations
node_msgroutes -->|"uses messaging domain"| node_messaging
node_syncroutes -->|"uses sync domain"| node_sync
node_messaging -->|"associates files"| node_attachments
node_messaging -->|"authorizes conversation"| node_conversations
node_sync -->|"reads delivery state"| node_messaging
node_attachments -.->|"stores metadata"| node_mongo
node_auth -->|"stores accounts"| node_mongo
node_conversations -.->|"stores memberships"| node_mongo
node_messaging -.->|"commits messages"| node_mongo
node_sync -.->|"stores sync state"| node_mongo
node_worker -.->|"processes attachment jobs"| node_attachments
node_worker -.->|"runs call jobs"| node_calls
node_attachments -.->|"requests scanning"| node_processor
node_apiapp -->|"routes safety actions"| node_safety
node_apiapp -->|"routes avatar actions"| node_avatars
node_apiapp -->|"routes call actions"| node_calls
node_gateway -->|"checks sync readiness"| node_sync

click node_web "https://github.com/pentest200/vibzo/blob/main/apps/web/src/conversation-app.tsx"
click node_authui "https://github.com/pentest200/vibzo/blob/main/apps/web/src/auth-app.tsx"
click node_browserapi "https://github.com/pentest200/vibzo/blob/main/apps/web/src/api.ts"
click node_syncui "https://github.com/pentest200/vibzo/blob/main/apps/web/src/sync-engine.ts"
click node_localdb "https://github.com/pentest200/vibzo/blob/main/apps/web/src/sync-db.ts"
click node_apiapp "https://github.com/pentest200/vibzo/blob/main/apps/api/src/app.ts"
click node_authroute "https://github.com/pentest200/vibzo/blob/main/apps/api/src/auth.ts"
click node_convroutes "https://github.com/pentest200/vibzo/blob/main/apps/api/src/conversations.ts"
click node_msgroutes "https://github.com/pentest200/vibzo/blob/main/apps/api/src/messages.ts"
click node_syncroutes "https://github.com/pentest200/vibzo/blob/main/apps/api/src/sync.ts"
click node_gateway "https://github.com/pentest200/vibzo/blob/main/apps/gateway/src/app.ts"
click node_auth "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/auth/service.ts"
click node_conversations "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/conversations/service.ts"
click node_messaging "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/messaging/service.ts"
click node_sync "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/sync/service.ts"
click node_attachments "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/attachments/service.ts"
click node_avatars "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/avatars/service.ts"
click node_safety "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/safety/service.ts"
click node_calls "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/calls/service.ts"
click node_mongo "https://github.com/pentest200/vibzo/blob/main/packages/domain/src/mongo.ts"
click node_worker "https://github.com/pentest200/vibzo/blob/main/apps/worker/src/main.ts"
click node_processor "https://github.com/pentest200/vibzo/blob/main/infra/processor/server.mjs"

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_web,node_authui,node_browserapi,node_syncui,node_localdb toneBlue
class node_apiapp,node_authroute,node_convroutes,node_msgroutes,node_syncroutes,node_gateway toneAmber
class node_auth,node_conversations,node_messaging,node_sync toneMint
class node_attachments,node_avatars,node_safety,node_calls toneRose
class node_mongo,node_worker,node_processor,node_user toneIndigo
```

## Components

### Web client

- [Chat interface](https://github.com/pentest200/vibzo/blob/main/apps/web/src/conversation-app.tsx): `apps/web/src/conversation-app.tsx`
- [Authentication UI](https://github.com/pentest200/vibzo/blob/main/apps/web/src/auth-app.tsx): `apps/web/src/auth-app.tsx`
- [API client](https://github.com/pentest200/vibzo/blob/main/apps/web/src/api.ts): `apps/web/src/api.ts`
- [Sync engine](https://github.com/pentest200/vibzo/blob/main/apps/web/src/sync-engine.ts): `apps/web/src/sync-engine.ts`
- [Local sync store](https://github.com/pentest200/vibzo/blob/main/apps/web/src/sync-db.ts): `apps/web/src/sync-db.ts`

### API and realtime

- [HTTP API](https://github.com/pentest200/vibzo/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Auth routes](https://github.com/pentest200/vibzo/blob/main/apps/api/src/auth.ts): `apps/api/src/auth.ts`
- [Conversation routes](https://github.com/pentest200/vibzo/blob/main/apps/api/src/conversations.ts): `apps/api/src/conversations.ts`
- [Message routes](https://github.com/pentest200/vibzo/blob/main/apps/api/src/messages.ts): `apps/api/src/messages.ts`
- [Sync routes](https://github.com/pentest200/vibzo/blob/main/apps/api/src/sync.ts): `apps/api/src/sync.ts`
- [Realtime gateway](https://github.com/pentest200/vibzo/blob/main/apps/gateway/src/app.ts): `apps/gateway/src/app.ts`

### Messaging domain

- [Account service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/auth/service.ts): `packages/domain/src/auth/service.ts`
- [Conversation service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/conversations/service.ts): `packages/domain/src/conversations/service.ts`
- [Messaging service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/messaging/service.ts): `packages/domain/src/messaging/service.ts`
- [Synchronization service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/sync/service.ts): `packages/domain/src/sync/service.ts`

### Media and safety

- [Attachment service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/attachments/service.ts): `packages/domain/src/attachments/service.ts`
- [Avatar service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/avatars/service.ts): `packages/domain/src/avatars/service.ts`
- [Safety service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/safety/service.ts): `packages/domain/src/safety/service.ts`
- [Calling service](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/calls/service.ts): `packages/domain/src/calls/service.ts`

### Persistence and workers

- [Mongo persistence](https://github.com/pentest200/vibzo/blob/main/packages/domain/src/mongo.ts): `packages/domain/src/mongo.ts`
- [Background worker](https://github.com/pentest200/vibzo/blob/main/apps/worker/src/main.ts): `apps/worker/src/main.ts`
- [Media processor](https://github.com/pentest200/vibzo/blob/main/infra/processor/server.mjs): `infra/processor/server.mjs`

### Other components

- **Member**

## Connections

- Member → Chat interface: uses chats
- Member → Authentication UI: signs in
- Authentication UI → API client: requests auth (evidence: `apps/web/src/auth-app.tsx`)
- Authentication UI → Chat interface: sets auth state
- Chat interface → API client: calls API
- Sync engine → API client: fetches updates (evidence: `apps/web/src/sync-engine.ts`)
- Sync engine → Local sync store: persists pending state (evidence: `apps/web/src/sync-engine.ts`)
- HTTP API → Auth routes: registers routes (evidence: `apps/api/src/app.ts`)
- HTTP API → Conversation routes: registers routes (evidence: `apps/api/src/app.ts`)
- HTTP API → Message routes: registers routes (evidence: `apps/api/src/app.ts`)
- HTTP API → Sync routes: registers routes (evidence: `apps/api/src/app.ts`)
- API client → HTTP API: HTTP requests
- Auth routes → Account service: uses account domain (evidence: `apps/api/src/auth.ts`)
- Conversation routes → Conversation service: uses conversation domain
- Message routes → Messaging service: uses messaging domain
- Sync routes → Synchronization service: uses sync domain
- Messaging service → Attachment service: associates files (evidence: `packages/domain/src/messaging/service.ts`)
- Messaging service → Conversation service: authorizes conversation (evidence: `packages/domain/src/messaging/service.ts`)
- Synchronization service → Messaging service: reads delivery state (evidence: `packages/domain/src/sync/service.ts`)
- Attachment service → Mongo persistence: stores metadata
- Account service → Mongo persistence: stores accounts (evidence: `packages/domain/src/auth/service.ts`)
- Conversation service → Mongo persistence: stores memberships
- Messaging service → Mongo persistence: commits messages
- Synchronization service → Mongo persistence: stores sync state
- Background worker → Attachment service: processes attachment jobs
- Background worker → Calling service: runs call jobs
- Attachment service → Media processor: requests scanning
- HTTP API → Safety service: routes safety actions (evidence: `apps/api/src/app.ts`)
- HTTP API → Avatar service: routes avatar actions (evidence: `apps/api/src/app.ts`)
- HTTP API → Calling service: routes call actions (evidence: `apps/api/src/app.ts`)
- Realtime gateway → Synchronization service: checks sync readiness (evidence: `apps/gateway/src/app.ts`)
