# cosscom/ui architecture

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

- Interactive diagram: https://gitdiagram.com/cosscom/ui
- Repository: https://github.com/cosscom/ui

## Overview

This monorepo combines the coss.com website, the coss UI component library and its documentation, shared UI components, and a legacy Origin UI catalog. The main developer workflow is to browse the coss UI documentation, inspect component demos, and copy components into an application; the README describes the library as accessible, composable, and copy-paste oriented. The website also presents coss stack API examples, while Origin remains a separately available legacy catalog. Some app relationships and unsampled features are documented but their runtime wiring was not inspected, so those links are dashed.

Main entry points: [`apps/www/app/page.tsx`](https://github.com/cosscom/ui/blob/main/apps/www/app/page.tsx) (Coss Website), [`apps/ui/app/page.tsx`](https://github.com/cosscom/ui/blob/main/apps/ui/app/page.tsx) (UI Library Docs), [`apps/origin/app/page.tsx`](https://github.com/cosscom/ui/blob/main/apps/origin/app/page.tsx) (Origin Catalog), [`apps/ui/registry/default/chat/chat-message-bubble.tsx`](https://github.com/cosscom/ui/blob/main/apps/ui/registry/default/chat/chat-message-bubble.tsx) (Chat Message Bubble)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Coss Website"]
  node_www["Coss Website<br/>[page.tsx]"]
  node_payments["Payments Guide<br/>[page.tsx]"]
  node_calendar["Calendar Guide<br/>[page.tsx]"]
  node_scheduling["Scheduling Guide<br/>[page.tsx]"]
  node_video["Video Guide<br/>[page.tsx]"]
end

subgraph group_docs["UI Catalogs"]
  node_uihome["UI Library Docs<br/>[page.tsx]"]
  node_particles["Particles Catalog<br/>[page.tsx]"]
  node_chatdemo["Chat Preview<br/>[chat-preview.tsx]"]
  node_rawroute["Raw Component Route<br/>[route.ts]"]
  node_registry[("Component Registry<br/>[__index__.tsx]")]
  node_chatreply["Chat Reply Preview"]
  node_chatmessage["Chat Message Bubble"]
end

subgraph group_shared["Shared UI Package"]
  node_sharedchatreply["Shared Chat Reply"]
  node_sharedchatmessage["Shared Chat Bubble"]
  node_contextmenu["Context Menu<br/>[context-menu.tsx]"]
  node_previewcard["Preview Card<br/>[preview-card.tsx]"]
end

subgraph group_legacy["Origin Legacy"]
  node_originhome["Origin Catalog<br/>[page.tsx]"]
  node_origincategory["Category Listing<br/>[page.tsx]"]
  node_originsearch["Component Search<br/>[page.tsx]"]
  node_origineasings["Easing Gallery<br/>[page.tsx]"]
  node_easingsview["Easing Demo<br/>[easings.tsx]"]
  node_origincatalog[("Origin Components<br/>[components.ts]")]
end

node_developer(("Developer"))

node_developer -.->|"browses docs"| node_uihome
node_uihome -.->|"presents components"| node_registry
node_uihome -->|"shows preview"| node_chatdemo
node_chatreply -->|"renders"| node_chatmessage
node_chatmessage -->|"uses bubble"| node_sharedchatmessage
node_rawroute -.->|"serves raw source"| node_registry
node_developer -.->|"visits site"| node_www
node_www -.->|"links guide"| node_payments
node_www -.->|"links guide"| node_calendar
node_www -.->|"links guide"| node_scheduling
node_www -.->|"links guide"| node_video
node_developer -.->|"browses catalog"| node_particles
node_developer -.->|"browses legacy"| node_originhome
node_originhome -.->|"opens category"| node_origincategory
node_originhome -.->|"offers search"| node_originsearch
node_developer -->|"copies easing"| node_origineasings
node_origineasings -->|"renders demo"| node_easingsview
node_origincategory -.->|"uses catalog"| node_origincatalog
node_originsearch -.->|"searches catalog"| node_origincatalog
node_sharedchatreply -->|"renders"| node_sharedchatmessage

click node_www "https://github.com/cosscom/ui/blob/main/apps/www/app/page.tsx"
click node_payments "https://github.com/cosscom/ui/blob/main/apps/www/app/payments/page.tsx"
click node_calendar "https://github.com/cosscom/ui/blob/main/apps/www/app/calendar/page.tsx"
click node_scheduling "https://github.com/cosscom/ui/blob/main/apps/www/app/scheduling/page.tsx"
click node_video "https://github.com/cosscom/ui/blob/main/apps/www/app/video/page.tsx"
click node_uihome "https://github.com/cosscom/ui/blob/main/apps/ui/app/page.tsx"
click node_particles "https://github.com/cosscom/ui/blob/main/apps/ui/app/particles/page.tsx"
click node_chatdemo "https://github.com/cosscom/ui/blob/main/apps/ui/app/chat/chat-preview.tsx"
click node_rawroute "https://github.com/cosscom/ui/blob/main/apps/ui/app/api/raw/%5B...slug%5D/route.ts"
click node_registry "https://github.com/cosscom/ui/blob/main/apps/ui/registry/__index__.tsx"
click node_chatreply "https://github.com/cosscom/ui/blob/main/apps/ui/registry/default/chat/chat-reply-preview.tsx"
click node_chatmessage "https://github.com/cosscom/ui/blob/main/apps/ui/registry/default/chat/chat-message-bubble.tsx"
click node_sharedchatreply "https://github.com/cosscom/ui/blob/main/packages/ui/src/chat/chat-reply-preview.tsx"
click node_sharedchatmessage "https://github.com/cosscom/ui/blob/main/packages/ui/src/chat/chat-message-bubble.tsx"
click node_contextmenu "https://github.com/cosscom/ui/blob/main/packages/ui/src/components/context-menu.tsx"
click node_previewcard "https://github.com/cosscom/ui/blob/main/packages/ui/src/components/preview-card.tsx"
click node_originhome "https://github.com/cosscom/ui/blob/main/apps/origin/app/page.tsx"
click node_origincategory "https://github.com/cosscom/ui/blob/main/apps/origin/app/%5Bcategory%5D/page.tsx"
click node_originsearch "https://github.com/cosscom/ui/blob/main/apps/origin/app/search/page.tsx"
click node_origineasings "https://github.com/cosscom/ui/blob/main/apps/origin/app/easings/page.tsx"
click node_easingsview "https://github.com/cosscom/ui/blob/main/apps/origin/app/easings/easings.tsx"
click node_origincatalog "https://github.com/cosscom/ui/blob/main/apps/origin/config/components.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_www,node_payments,node_calendar,node_scheduling,node_video toneBlue
class node_uihome,node_particles,node_chatdemo,node_rawroute,node_registry,node_chatreply,node_chatmessage toneAmber
class node_sharedchatreply,node_sharedchatmessage,node_contextmenu,node_previewcard toneMint
class node_originhome,node_origincategory,node_originsearch,node_origineasings,node_easingsview,node_origincatalog toneRose
class node_developer toneIndigo
```

## Components

### Coss Website

- [Coss Website](https://github.com/cosscom/ui/blob/main/apps/www/app/page.tsx): `apps/www/app/page.tsx`
- [Payments Guide](https://github.com/cosscom/ui/blob/main/apps/www/app/payments/page.tsx): `apps/www/app/payments/page.tsx`
- [Calendar Guide](https://github.com/cosscom/ui/blob/main/apps/www/app/calendar/page.tsx): `apps/www/app/calendar/page.tsx`
- [Scheduling Guide](https://github.com/cosscom/ui/blob/main/apps/www/app/scheduling/page.tsx): `apps/www/app/scheduling/page.tsx`
- [Video Guide](https://github.com/cosscom/ui/blob/main/apps/www/app/video/page.tsx): `apps/www/app/video/page.tsx`

### UI Catalogs

- [UI Library Docs](https://github.com/cosscom/ui/blob/main/apps/ui/app/page.tsx): `apps/ui/app/page.tsx`
- [Particles Catalog](https://github.com/cosscom/ui/blob/main/apps/ui/app/particles/page.tsx): `apps/ui/app/particles/page.tsx`
- [Chat Preview](https://github.com/cosscom/ui/blob/main/apps/ui/app/chat/chat-preview.tsx): `apps/ui/app/chat/chat-preview.tsx`
- [Raw Component Route](https://github.com/cosscom/ui/blob/main/apps/ui/app/api/raw/%5B...slug%5D/route.ts): `apps/ui/app/api/raw/[...slug]/route.ts`
- [Component Registry](https://github.com/cosscom/ui/blob/main/apps/ui/registry/__index__.tsx): `apps/ui/registry/__index__.tsx`
- [Chat Reply Preview](https://github.com/cosscom/ui/blob/main/apps/ui/registry/default/chat/chat-reply-preview.tsx): `apps/ui/registry/default/chat/chat-reply-preview.tsx`
- [Chat Message Bubble](https://github.com/cosscom/ui/blob/main/apps/ui/registry/default/chat/chat-message-bubble.tsx): `apps/ui/registry/default/chat/chat-message-bubble.tsx`

### Shared UI Package

- [Shared Chat Reply](https://github.com/cosscom/ui/blob/main/packages/ui/src/chat/chat-reply-preview.tsx): `packages/ui/src/chat/chat-reply-preview.tsx`
- [Shared Chat Bubble](https://github.com/cosscom/ui/blob/main/packages/ui/src/chat/chat-message-bubble.tsx): `packages/ui/src/chat/chat-message-bubble.tsx`
- [Context Menu](https://github.com/cosscom/ui/blob/main/packages/ui/src/components/context-menu.tsx): `packages/ui/src/components/context-menu.tsx`
- [Preview Card](https://github.com/cosscom/ui/blob/main/packages/ui/src/components/preview-card.tsx): `packages/ui/src/components/preview-card.tsx`

### Origin Legacy

- [Origin Catalog](https://github.com/cosscom/ui/blob/main/apps/origin/app/page.tsx): `apps/origin/app/page.tsx`
- [Category Listing](https://github.com/cosscom/ui/blob/main/apps/origin/app/%5Bcategory%5D/page.tsx): `apps/origin/app/[category]/page.tsx`
- [Component Search](https://github.com/cosscom/ui/blob/main/apps/origin/app/search/page.tsx): `apps/origin/app/search/page.tsx`
- [Easing Gallery](https://github.com/cosscom/ui/blob/main/apps/origin/app/easings/page.tsx): `apps/origin/app/easings/page.tsx`
- [Easing Demo](https://github.com/cosscom/ui/blob/main/apps/origin/app/easings/easings.tsx): `apps/origin/app/easings/easings.tsx`
- [Origin Components](https://github.com/cosscom/ui/blob/main/apps/origin/config/components.ts): `apps/origin/config/components.ts`

### Other components

- **Developer**

## Connections

- Developer → UI Library Docs: browses docs (evidence: `README.md`)
- UI Library Docs → Component Registry: presents components (evidence: `README.md`)
- UI Library Docs → Chat Preview: shows preview (evidence: `apps/ui/app/chat/chat-preview.tsx`)
- Chat Reply Preview → Chat Message Bubble: renders (evidence: `apps/ui/registry/default/chat/chat-reply-preview.tsx`)
- Chat Message Bubble → Shared Chat Bubble: uses bubble (evidence: `apps/ui/registry/default/chat/chat-message-bubble.tsx`)
- Raw Component Route → Component Registry: serves raw source
- Developer → Coss Website: visits site (evidence: `README.md`)
- Coss Website → Payments Guide: links guide
- Coss Website → Calendar Guide: links guide
- Coss Website → Scheduling Guide: links guide
- Coss Website → Video Guide: links guide
- Developer → Particles Catalog: browses catalog (evidence: `README.md`)
- Developer → Origin Catalog: browses legacy (evidence: `README.md`)
- Origin Catalog → Category Listing: opens category
- Origin Catalog → Component Search: offers search
- Developer → Easing Gallery: copies easing (evidence: `apps/origin/app/easings/page.tsx`)
- Easing Gallery → Easing Demo: renders demo (evidence: `apps/origin/app/easings/page.tsx`)
- Category Listing → Origin Components: uses catalog
- Component Search → Origin Components: searches catalog
- Shared Chat Reply → Shared Chat Bubble: renders (evidence: `packages/ui/src/chat/chat-reply-preview.tsx`)
