# nyllon-software/ember-cloudflare architecture

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

- Interactive diagram: https://gitdiagram.com/nyllon-software/ember-cloudflare
- Repository: https://github.com/nyllon-software/ember-cloudflare

## Overview

Ember is a Cloudflare-hosted team chat app. A member opens the web app, which loads workspace state and presents rooms, threads, and direct messages; the Worker handles workspace and room interactions, with persistent conversation state and supporting services for search, files, notifications, bots, assistants, and huddles. The README documents the product capabilities, while the sampled source and index expose only some wiring, so undocumented runtime links are omitted rather than inferred.

Main entry points: [`apps/web/src/App.tsx`](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/web/src/App.tsx) (Web app shell), [`apps/worker/src/workspace.ts`](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/workspace.ts) (Workspace service), [`apps/worker/src/index.ts`](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/index.ts) (Request router), [`apps/worker/src/workspace-store.ts`](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/workspace-store.ts) (Workspace state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Web app shell<br/>[App.tsx]"]
  node_chatui["Chat interface<br/>[room-view.tsx]"]
  node_membershipui["Membership settings<br/>[settings-page.tsx]"]
end

subgraph group_worker["Worker services"]
  node_worker["Request router<br/>[index.ts]"]
  node_workspace["Workspace service<br/>[workspace.ts]"]
  node_room["Room service<br/>[chat-room.ts]"]
  node_workspace_store[("Workspace state<br/>[workspace-store.ts]")]
  node_db[("Database access<br/>[db.ts]")]
  node_search_api["Search service<br/>[searches.ts]"]
  node_search_index[("Search index<br/>[search-index.ts]")]
  node_files["File handling<br/>[uploads.ts]"]
  node_previews["File previews<br/>[previews.ts]"]
  node_bots["Bot webhooks<br/>[webhooks.ts]"]
  node_assistant["AI assistant<br/>[gateway.ts]"]
  node_huddles["Huddle sessions<br/>[room.ts]"]
  node_huddle_sfu["Media forwarding<br/>[sfu.ts]"]
  node_push["Push delivery<br/>[delivery.ts]"]
end

subgraph group_shared["Shared packages"]
  node_protocol["Wire protocol<br/>[index.ts]"]
  node_richtext["Rich text<br/>[render.ts]"]
end

subgraph group_cloudflare["Cloudflare platform"]
  node_cloudflare[("Cloudflare storage and runtime")]
end

node_member(("Team member"))
node_external_services["External services"]

node_member -->|"uses"| node_webapp
node_webapp -.->|"loads workspace"| node_worker
node_webapp -.->|"shows chat"| node_chatui
node_webapp -.->|"shows settings"| node_membershipui
node_webapp -->|"imports types"| node_protocol
node_worker -.->|"routes requests"| node_workspace
node_workspace -->|"uses state"| node_workspace_store
node_workspace -->|"invokes gateway"| node_assistant
node_workspace -->|"uses media"| node_huddle_sfu
node_search_api -->|"queries index"| node_search_index
node_search_index -->|"stores index"| node_cloudflare
node_room -->|"stores messages"| node_cloudflare
node_files -->|"stores files"| node_cloudflare
node_previews -->|"stores previews"| node_cloudflare
node_bots -->|"accepts webhooks"| node_external_services
node_assistant -->|"uses AI models"| node_external_services
node_huddles -->|"uses forwarding"| node_huddle_sfu
node_push -->|"sends notifications"| node_member
node_workspace_store -.->|"uses persistence"| node_db
node_richtext -.->|"renders messages"| node_chatui
node_protocol -->|"defines API frames"| node_worker

click node_webapp "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/web/src/App.tsx"
click node_chatui "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/web/src/components/workspace/room-view.tsx"
click node_membershipui "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/web/src/components/workspace/settings-page.tsx"
click node_worker "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/index.ts"
click node_workspace "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/workspace.ts"
click node_room "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/chat-room.ts"
click node_workspace_store "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/workspace-store.ts"
click node_db "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/db.ts"
click node_search_api "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/searches.ts"
click node_search_index "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/search-index.ts"
click node_files "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/files/uploads.ts"
click node_previews "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/files/previews.ts"
click node_bots "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/bots/webhooks.ts"
click node_assistant "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/assistant/gateway.ts"
click node_huddles "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/huddles/room.ts"
click node_huddle_sfu "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/huddles/sfu.ts"
click node_push "https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/push/delivery.ts"
click node_protocol "https://github.com/nyllon-software/ember-cloudflare/blob/main/packages/protocol/src/index.ts"
click node_richtext "https://github.com/nyllon-software/ember-cloudflare/blob/main/packages/richtext/src/render.ts"

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_webapp,node_chatui,node_membershipui toneBlue
class node_worker,node_workspace,node_room,node_workspace_store,node_db,node_search_api,node_search_index,node_files,node_previews,node_bots,node_assistant,node_huddles,node_huddle_sfu,node_push toneAmber
class node_protocol,node_richtext toneMint
class node_cloudflare toneRose
class node_member,node_external_services toneIndigo
```

## Components

### Web application

- [Web app shell](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Chat interface](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/web/src/components/workspace/room-view.tsx): `apps/web/src/components/workspace/room-view.tsx`
- [Membership settings](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/web/src/components/workspace/settings-page.tsx): `apps/web/src/components/workspace/settings-page.tsx`

### Worker services

- [Request router](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/index.ts): `apps/worker/src/index.ts`
- [Workspace service](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/workspace.ts): `apps/worker/src/workspace.ts`
- [Room service](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/chat-room.ts): `apps/worker/src/chat-room.ts`
- [Workspace state](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/workspace-store.ts): `apps/worker/src/workspace-store.ts`
- [Database access](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/db.ts): `apps/worker/src/db.ts`
- [Search service](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/searches.ts): `apps/worker/src/searches.ts`
- [Search index](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/search-index.ts): `apps/worker/src/search-index.ts`
- [File handling](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/files/uploads.ts): `apps/worker/src/files/uploads.ts`
- [File previews](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/files/previews.ts): `apps/worker/src/files/previews.ts`
- [Bot webhooks](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/bots/webhooks.ts): `apps/worker/src/bots/webhooks.ts`
- [AI assistant](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/assistant/gateway.ts): `apps/worker/src/assistant/gateway.ts`
- [Huddle sessions](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/huddles/room.ts): `apps/worker/src/huddles/room.ts`
- [Media forwarding](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/huddles/sfu.ts): `apps/worker/src/huddles/sfu.ts`
- [Push delivery](https://github.com/nyllon-software/ember-cloudflare/blob/main/apps/worker/src/push/delivery.ts): `apps/worker/src/push/delivery.ts`

### Shared packages

- [Wire protocol](https://github.com/nyllon-software/ember-cloudflare/blob/main/packages/protocol/src/index.ts): `packages/protocol/src/index.ts`
- [Rich text](https://github.com/nyllon-software/ember-cloudflare/blob/main/packages/richtext/src/render.ts): `packages/richtext/src/render.ts`

### Cloudflare platform

- **Cloudflare storage and runtime**

### Other components

- **Team member**
- **External services**

## Connections

- Team member → Web app shell: uses (evidence: `README.md`)
- Web app shell → Request router: loads workspace
- Web app shell → Chat interface: shows chat
- Web app shell → Membership settings: shows settings
- Web app shell → Wire protocol: imports types (evidence: `apps/web/src/App.tsx`)
- Request router → Workspace service: routes requests
- Workspace service → Workspace state: uses state (evidence: `apps/worker/src/workspace.ts`)
- Workspace service → AI assistant: invokes gateway (evidence: `apps/worker/src/workspace.ts`)
- Workspace service → Media forwarding: uses media (evidence: `apps/worker/src/workspace.ts`)
- Search service → Search index: queries index (evidence: `apps/worker/src/searches.ts`)
- Search index → Cloudflare storage and runtime: stores index (evidence: `apps/worker/src/search-index.ts`)
- Room service → Cloudflare storage and runtime: stores messages (evidence: `README.md`)
- File handling → Cloudflare storage and runtime: stores files (evidence: `README.md`)
- File previews → Cloudflare storage and runtime: stores previews (evidence: `apps/worker/src/files/previews.ts`)
- Bot webhooks → External services: accepts webhooks (evidence: `README.md`)
- AI assistant → External services: uses AI models (evidence: `README.md`)
- Huddle sessions → Media forwarding: uses forwarding (evidence: `apps/worker/src/huddles/room.ts`)
- Push delivery → Team member: sends notifications (evidence: `README.md`)
- Workspace state → Database access: uses persistence
- Rich text → Chat interface: renders messages
- Wire protocol → Request router: defines API frames (evidence: `packages/protocol/src/index.ts`)
