# crowpus/zelyq architecture

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

- Interactive diagram: https://gitdiagram.com/crowpus/zelyq
- Repository: https://github.com/crowpus/zelyq

## Overview

Zelyq is an AI-assisted application-building workspace: users describe a project, the agent plans and edits it through tools, runs a project preview, and verifies the result. The web app also exposes image/video generation, account and team settings, and integrations. The graph combines the documented product workflow with relationships visible in the excerpts and source index; several server route-to-service and storage links are not shown in the sampled code, so those are omitted rather than inferred.

Main entry points: [`apps/server/src/app.ts`](https://github.com/crowpus/zelyq/blob/main/apps/server/src/app.ts) (HTTP platform), [`apps/web/src/App.tsx`](https://github.com/crowpus/zelyq/blob/main/apps/web/src/App.tsx) (Web application), [`apps/agent/src/session.ts`](https://github.com/crowpus/zelyq/blob/main/apps/agent/src/session.ts) (Agent turn loop), [`apps/web/src/pages/ProjectEditorPage.tsx`](https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/ProjectEditorPage.tsx) (Project editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Workspace"]
  node_webapp["Web application<br/>[App.tsx]"]
  node_sessionhook["Session state<br/>[useSession.ts]"]
  node_editor["Project editor"]
  node_previewpanel["Live preview<br/>[PreviewPanel.tsx]"]
  node_projectlist["Project list"]
  node_settingspage["Account settings<br/>[SettingsPage.tsx]"]
  node_imagestudio["Image Studio"]
  node_videostudio["Video Studio"]
end

subgraph group_agent["Agent workflow"]
  node_agentserver["Agent API<br/>[server.ts]"]
  node_session["Agent turn loop<br/>[session.ts]"]
  node_prompt["Prompt and modes<br/>[prompt.ts]"]
  node_tooling["Agent tools<br/>[orchestrate.ts]"]
  node_modelproviders["Model providers<br/>[index.ts]"]
end

subgraph group_server["Platform services"]
  node_serverapp["HTTP platform<br/>[app.ts]"]
  node_agentclient["Agent client<br/>[agent-client.ts]"]
  node_projectservice["Project services<br/>[projects.ts]"]
  node_previewroutes["Preview routes<br/>[preview.ts]"]
  node_imagesservice["Image generation"]
  node_videoservice["Video generation"]
end

subgraph group_runtime["Project execution"]
  node_runtime["Project runtime<br/>[container.ts]"]
end

subgraph group_data["Persistence"]
  node_database[("Application database<br/>[client.ts]")]
end

node_user(("Builder"))

node_user -->|"uses"| node_webapp
node_webapp -->|"reads session"| node_sessionhook
node_webapp -->|"routes to"| node_editor
node_webapp -->|"routes to"| node_projectlist
node_webapp -->|"routes to"| node_settingspage
node_webapp -->|"routes to"| node_imagestudio
node_webapp -->|"routes to"| node_videostudio
node_editor -.->|"shows preview"| node_previewpanel
node_sessionhook -.->|"requests session"| node_serverapp
node_editor -.->|"sends project work"| node_serverapp
node_imagestudio -.->|"requests generation"| node_serverapp
node_videostudio -.->|"requests generation"| node_serverapp
node_serverapp -->|"registers"| node_previewroutes
node_previewroutes -->|"starts preview"| node_runtime
node_previewroutes -->|"checks access"| node_projectservice
node_serverapp -->|"configures"| node_imagesservice
node_serverapp -->|"configures"| node_videoservice
node_serverapp -.->|"connects agent"| node_agentclient
node_agentclient -->|"calls agent API"| node_agentserver
node_agentserver -->|"runs turns"| node_session
node_session -->|"builds prompts"| node_prompt
node_session -->|"executes tools"| node_tooling
node_session -.->|"requests model output"| node_modelproviders
node_session -.->|"operates project"| node_runtime
node_projectservice -.->|"stores project data"| node_database

click node_webapp "https://github.com/crowpus/zelyq/blob/main/apps/web/src/App.tsx"
click node_sessionhook "https://github.com/crowpus/zelyq/blob/main/apps/web/src/hooks/useSession.ts"
click node_editor "https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/ProjectEditorPage.tsx"
click node_previewpanel "https://github.com/crowpus/zelyq/blob/main/apps/web/src/components/PreviewPanel.tsx"
click node_projectlist "https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/ProjectListPage.tsx"
click node_settingspage "https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/SettingsPage.tsx"
click node_imagestudio "https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/ImageStudioPage.tsx"
click node_videostudio "https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/VideoStudioPage.tsx"
click node_agentserver "https://github.com/crowpus/zelyq/blob/main/apps/agent/src/server.ts"
click node_session "https://github.com/crowpus/zelyq/blob/main/apps/agent/src/session.ts"
click node_prompt "https://github.com/crowpus/zelyq/blob/main/apps/agent/src/prompt.ts"
click node_tooling "https://github.com/crowpus/zelyq/blob/main/packages/tools/src/orchestrate.ts"
click node_modelproviders "https://github.com/crowpus/zelyq/blob/main/apps/agent/src/providers/index.ts"
click node_serverapp "https://github.com/crowpus/zelyq/blob/main/apps/server/src/app.ts"
click node_agentclient "https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/agent-client.ts"
click node_projectservice "https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/projects.ts"
click node_previewroutes "https://github.com/crowpus/zelyq/blob/main/apps/server/src/routes/preview.ts"
click node_imagesservice "https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/image-generation.ts"
click node_videoservice "https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/video-generation.ts"
click node_runtime "https://github.com/crowpus/zelyq/blob/main/packages/runtime/src/container.ts"
click node_database "https://github.com/crowpus/zelyq/blob/main/packages/db/src/client.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_sessionhook,node_editor,node_previewpanel,node_projectlist,node_settingspage,node_imagestudio,node_videostudio toneBlue
class node_agentserver,node_session,node_prompt,node_tooling,node_modelproviders toneAmber
class node_serverapp,node_agentclient,node_projectservice,node_previewroutes,node_imagesservice,node_videoservice toneMint
class node_runtime toneRose
class node_database,node_user toneIndigo
```

## Components

### Workspace

- [Web application](https://github.com/crowpus/zelyq/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Session state](https://github.com/crowpus/zelyq/blob/main/apps/web/src/hooks/useSession.ts): `apps/web/src/hooks/useSession.ts`
- [Project editor](https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/ProjectEditorPage.tsx): `apps/web/src/pages/ProjectEditorPage.tsx`
- [Live preview](https://github.com/crowpus/zelyq/blob/main/apps/web/src/components/PreviewPanel.tsx): `apps/web/src/components/PreviewPanel.tsx`
- [Project list](https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/ProjectListPage.tsx): `apps/web/src/pages/ProjectListPage.tsx`
- [Account settings](https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/SettingsPage.tsx): `apps/web/src/pages/SettingsPage.tsx`
- [Image Studio](https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/ImageStudioPage.tsx): `apps/web/src/pages/ImageStudioPage.tsx`
- [Video Studio](https://github.com/crowpus/zelyq/blob/main/apps/web/src/pages/VideoStudioPage.tsx): `apps/web/src/pages/VideoStudioPage.tsx`

### Agent workflow

- [Agent API](https://github.com/crowpus/zelyq/blob/main/apps/agent/src/server.ts): `apps/agent/src/server.ts`
- [Agent turn loop](https://github.com/crowpus/zelyq/blob/main/apps/agent/src/session.ts): `apps/agent/src/session.ts`
- [Prompt and modes](https://github.com/crowpus/zelyq/blob/main/apps/agent/src/prompt.ts): `apps/agent/src/prompt.ts`
- [Agent tools](https://github.com/crowpus/zelyq/blob/main/packages/tools/src/orchestrate.ts): `packages/tools/src/orchestrate.ts`
- [Model providers](https://github.com/crowpus/zelyq/blob/main/apps/agent/src/providers/index.ts): `apps/agent/src/providers/index.ts`

### Platform services

- [HTTP platform](https://github.com/crowpus/zelyq/blob/main/apps/server/src/app.ts): `apps/server/src/app.ts`
- [Agent client](https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/agent-client.ts): `apps/server/src/services/agent-client.ts`
- [Project services](https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/projects.ts): `apps/server/src/services/projects.ts`
- [Preview routes](https://github.com/crowpus/zelyq/blob/main/apps/server/src/routes/preview.ts): `apps/server/src/routes/preview.ts`
- [Image generation](https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/image-generation.ts): `apps/server/src/services/image-generation.ts`
- [Video generation](https://github.com/crowpus/zelyq/blob/main/apps/server/src/services/video-generation.ts): `apps/server/src/services/video-generation.ts`

### Project execution

- [Project runtime](https://github.com/crowpus/zelyq/blob/main/packages/runtime/src/container.ts): `packages/runtime/src/container.ts`

### Persistence

- [Application database](https://github.com/crowpus/zelyq/blob/main/packages/db/src/client.ts): `packages/db/src/client.ts`

### Other components

- **Builder**

## Connections

- Builder → Web application: uses (evidence: `README.md`)
- Web application → Session state: reads session (evidence: `apps/web/src/App.tsx`)
- Web application → Project editor: routes to (evidence: `apps/web/src/App.tsx`)
- Web application → Project list: routes to (evidence: `apps/web/src/App.tsx`)
- Web application → Account settings: routes to (evidence: `apps/web/src/App.tsx`)
- Web application → Image Studio: routes to (evidence: `apps/web/src/App.tsx`)
- Web application → Video Studio: routes to (evidence: `apps/web/src/App.tsx`)
- Project editor → Live preview: shows preview
- Session state → HTTP platform: requests session
- Project editor → HTTP platform: sends project work
- Image Studio → HTTP platform: requests generation
- Video Studio → HTTP platform: requests generation
- HTTP platform → Preview routes: registers (evidence: `apps/server/src/app.ts`)
- Preview routes → Project runtime: starts preview (evidence: `apps/server/src/routes/preview.ts`)
- Preview routes → Project services: checks access (evidence: `apps/server/src/routes/preview.ts`)
- HTTP platform → Image generation: configures (evidence: `apps/server/src/app.ts`)
- HTTP platform → Video generation: configures (evidence: `apps/server/src/app.ts`)
- HTTP platform → Agent client: connects agent (evidence: `apps/server/src/app.ts`)
- Agent client → Agent API: calls agent API (evidence: `apps/server/src/services/agent-client.ts`)
- Agent API → Agent turn loop: runs turns (evidence: `apps/agent/src/server.ts`)
- Agent turn loop → Prompt and modes: builds prompts (evidence: `apps/agent/src/session.ts`)
- Agent turn loop → Agent tools: executes tools (evidence: `apps/agent/src/session.ts`)
- Agent turn loop → Model providers: requests model output (evidence: `apps/agent/src/session.ts`)
- Agent turn loop → Project runtime: operates project
- Project services → Application database: stores project data
