# dosmoon/videocraft architecture

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

- Interactive diagram: https://gitdiagram.com/dosmoon/videocraft
- Repository: https://github.com/dosmoon/videocraft

## Overview

VideoCraft is a Windows desktop video-production app: users create a project, add a source video and subtitle/analysis material, then produce and render clips or a News Desk video. The README documents the end-to-end capabilities; the sampled code shows the Electron/Python sidecar boundary, RPC transport, TypeScript material and clip ownership, subtitle processing, AI routing, and model downloads. Some creation and rendering connections are documented but not shown in sampled implementation, so those edges cite the README rather than implying inspected call paths.

Main entry points: [`desktop/src/renderer/workbenches/index.tsx`](https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/workbenches/index.tsx) (Workbench UI), [`desktop/src/creations/clip/clientBackend.ts`](https://github.com/dosmoon/videocraft/blob/main/desktop/src/creations/clip/clientBackend.ts) (Clip backend), [`core_rpc/methods/project.py`](https://github.com/dosmoon/videocraft/blob/main/core_rpc/methods/project.py) (Project operations), [`src/core/ai/router.py`](https://github.com/dosmoon/videocraft/blob/main/src/core/ai/router.py) (AI provider router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_renderer["Workbench UI<br/>[index.tsx]"]
  node_electron["Electron main<br/>[main.ts]"]
  node_rpc_client["RPC client<br/>[client.ts]"]
end

subgraph group_project["Projects and materials"]
  node_project_ui["Project operations<br/>[project.py]"]
  node_project_state["Project schema<br/>[project_schema.py]"]
  node_material_ui["News Video material<br/>[clientBackend.ts]"]
  node_material_model["Material model<br/>[model.ts]"]
  node_source_acquire["Source acquisition<br/>[source_acquire.py]"]
  node_subtitle_ops["Subtitle workflow"]
end

subgraph group_ai["AI and models"]
  node_ai_console["AI settings<br/>[AiConsole.tsx]"]
  node_ai_config["AI configuration<br/>[config.py]"]
  node_ai_router["AI provider router<br/>[router.py]"]
  node_providers["AI providers"]
  node_model_ui["Model manager UI<br/>[ModelManager.tsx]"]
  node_model_downloads["Model downloads<br/>[manager.py]"]
end

subgraph group_creation["Creation and rendering"]
  node_clip_ui["Clip workbench<br/>[ClipWorkbench.tsx]"]
  node_clip_backend["Clip backend<br/>[clientBackend.ts]"]
  node_newsdesk["News Desk creation"]
  node_composition["Composition system<br/>[assemble.ts]"]
  node_render_engine["Video render engine<br/>[encode.ts]"]
end

subgraph group_backend["Sidecar services"]
  node_rpc_server["RPC server<br/>[server.py]"]
  node_rpc_dispatch["RPC dispatch<br/>[dispatch.py]"]
  node_session["Project session<br/>[session.py]"]
end

node_user(("Video editor"))

node_user -->|"creates and edits"| node_renderer
node_renderer -->|"requests operations"| node_rpc_client
node_rpc_client -->|"invokes bridge"| node_electron
node_electron -->|"forwards RPC"| node_rpc_server
node_rpc_server -->|"dispatches requests"| node_rpc_dispatch
node_rpc_dispatch -.->|"routes methods"| node_project_ui
node_project_ui -->|"uses project schema"| node_project_state
node_project_ui -.->|"owns open project"| node_session
node_renderer -->|"edits material"| node_material_ui
node_material_ui -->|"loads model"| node_material_model
node_material_model -.->|"uses acquired source"| node_source_acquire
node_user -->|"adds video"| node_source_acquire
node_user -->|"runs subtitle tasks"| node_subtitle_ops
node_subtitle_ops -->|"requests AI tasks"| node_ai_router
node_ai_console -.->|"configures providers"| node_ai_config
node_ai_router -->|"reads routing config"| node_ai_config
node_ai_router -->|"dispatches provider calls"| node_providers
node_model_ui -.->|"manages downloads"| node_model_downloads
node_renderer -->|"opens creation"| node_clip_ui
node_clip_ui -->|"loads clip data"| node_clip_backend
node_clip_backend -->|"resolves bound material"| node_material_model
node_user -->|"generates video"| node_newsdesk
node_user -->|"generates clips"| node_clip_backend
node_clip_backend -.->|"renders clips"| node_render_engine
node_newsdesk -.->|"assembles program"| node_composition
node_composition -.->|"encodes output"| node_render_engine

click node_renderer "https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/workbenches/index.tsx"
click node_electron "https://github.com/dosmoon/videocraft/blob/main/desktop/electron/main.ts"
click node_rpc_client "https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/ipc/client.ts"
click node_project_ui "https://github.com/dosmoon/videocraft/blob/main/core_rpc/methods/project.py"
click node_project_state "https://github.com/dosmoon/videocraft/blob/main/src/core/project_schema.py"
click node_material_ui "https://github.com/dosmoon/videocraft/blob/main/desktop/src/materials/news_video/clientBackend.ts"
click node_material_model "https://github.com/dosmoon/videocraft/blob/main/desktop/src/materials/news_video/model.ts"
click node_source_acquire "https://github.com/dosmoon/videocraft/blob/main/src/core/source_acquire.py"
click node_subtitle_ops "https://github.com/dosmoon/videocraft/blob/main/src/core/subtitle_pipeline.py"
click node_ai_console "https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/aiconsole/AiConsole.tsx"
click node_ai_config "https://github.com/dosmoon/videocraft/blob/main/src/core/ai/config.py"
click node_ai_router "https://github.com/dosmoon/videocraft/blob/main/src/core/ai/router.py"
click node_providers "https://github.com/dosmoon/videocraft/tree/main/src/core/ai/providers"
click node_model_ui "https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/models/ModelManager.tsx"
click node_model_downloads "https://github.com/dosmoon/videocraft/blob/main/src/core/models/manager.py"
click node_clip_ui "https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/workbenches/clip/ClipWorkbench.tsx"
click node_clip_backend "https://github.com/dosmoon/videocraft/blob/main/desktop/src/creations/clip/clientBackend.ts"
click node_newsdesk "https://github.com/dosmoon/videocraft/tree/main/desktop/src/creations/news_desk"
click node_composition "https://github.com/dosmoon/videocraft/blob/main/desktop/src/composition/assemble.ts"
click node_render_engine "https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/engine/export/encode.ts"
click node_rpc_server "https://github.com/dosmoon/videocraft/blob/main/core_rpc/server.py"
click node_rpc_dispatch "https://github.com/dosmoon/videocraft/blob/main/core_rpc/dispatch.py"
click node_session "https://github.com/dosmoon/videocraft/blob/main/core_rpc/session.py"

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_renderer,node_electron,node_rpc_client toneBlue
class node_project_ui,node_project_state,node_material_ui,node_material_model,node_source_acquire,node_subtitle_ops toneAmber
class node_ai_console,node_ai_config,node_ai_router,node_providers,node_model_ui,node_model_downloads toneMint
class node_clip_ui,node_clip_backend,node_newsdesk,node_composition,node_render_engine toneRose
class node_rpc_server,node_rpc_dispatch,node_session,node_user toneIndigo
```

## Components

### Desktop experience

- [Workbench UI](https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/workbenches/index.tsx): `desktop/src/renderer/workbenches/index.tsx`
- [Electron main](https://github.com/dosmoon/videocraft/blob/main/desktop/electron/main.ts): `desktop/electron/main.ts`
- [RPC client](https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/ipc/client.ts): `desktop/src/renderer/ipc/client.ts`

### Projects and materials

- [Project operations](https://github.com/dosmoon/videocraft/blob/main/core_rpc/methods/project.py): `core_rpc/methods/project.py`
- [Project schema](https://github.com/dosmoon/videocraft/blob/main/src/core/project_schema.py): `src/core/project_schema.py`
- [News Video material](https://github.com/dosmoon/videocraft/blob/main/desktop/src/materials/news_video/clientBackend.ts): `desktop/src/materials/news_video/clientBackend.ts`
- [Material model](https://github.com/dosmoon/videocraft/blob/main/desktop/src/materials/news_video/model.ts): `desktop/src/materials/news_video/model.ts`
- [Source acquisition](https://github.com/dosmoon/videocraft/blob/main/src/core/source_acquire.py): `src/core/source_acquire.py`
- [Subtitle workflow](https://github.com/dosmoon/videocraft/blob/main/src/core/subtitle_pipeline.py): `src/core/subtitle_pipeline.py`

### AI and models

- [AI settings](https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/aiconsole/AiConsole.tsx): `desktop/src/renderer/aiconsole/AiConsole.tsx`
- [AI configuration](https://github.com/dosmoon/videocraft/blob/main/src/core/ai/config.py): `src/core/ai/config.py`
- [AI provider router](https://github.com/dosmoon/videocraft/blob/main/src/core/ai/router.py): `src/core/ai/router.py`
- [AI providers](https://github.com/dosmoon/videocraft/tree/main/src/core/ai/providers): `src/core/ai/providers`
- [Model manager UI](https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/models/ModelManager.tsx): `desktop/src/renderer/models/ModelManager.tsx`
- [Model downloads](https://github.com/dosmoon/videocraft/blob/main/src/core/models/manager.py): `src/core/models/manager.py`

### Creation and rendering

- [Clip workbench](https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/workbenches/clip/ClipWorkbench.tsx): `desktop/src/renderer/workbenches/clip/ClipWorkbench.tsx`
- [Clip backend](https://github.com/dosmoon/videocraft/blob/main/desktop/src/creations/clip/clientBackend.ts): `desktop/src/creations/clip/clientBackend.ts`
- [News Desk creation](https://github.com/dosmoon/videocraft/tree/main/desktop/src/creations/news_desk): `desktop/src/creations/news_desk`
- [Composition system](https://github.com/dosmoon/videocraft/blob/main/desktop/src/composition/assemble.ts): `desktop/src/composition/assemble.ts`
- [Video render engine](https://github.com/dosmoon/videocraft/blob/main/desktop/src/renderer/engine/export/encode.ts): `desktop/src/renderer/engine/export/encode.ts`

### Sidecar services

- [RPC server](https://github.com/dosmoon/videocraft/blob/main/core_rpc/server.py): `core_rpc/server.py`
- [RPC dispatch](https://github.com/dosmoon/videocraft/blob/main/core_rpc/dispatch.py): `core_rpc/dispatch.py`
- [Project session](https://github.com/dosmoon/videocraft/blob/main/core_rpc/session.py): `core_rpc/session.py`

### Other components

- **Video editor**

## Connections

- Video editor → Workbench UI: creates and edits
- Workbench UI → RPC client: requests operations
- RPC client → Electron main: invokes bridge (evidence: `desktop/src/renderer/ipc/client.ts`)
- Electron main → RPC server: forwards RPC (evidence: `desktop/electron/main.ts`)
- RPC server → RPC dispatch: dispatches requests (evidence: `core_rpc/server.py`)
- RPC dispatch → Project operations: routes methods
- Project operations → Project schema: uses project schema (evidence: `core_rpc/methods/project.py`)
- Project operations → Project session: owns open project
- Workbench UI → News Video material: edits material
- News Video material → Material model: loads model (evidence: `desktop/src/materials/news_video/clientBackend.ts`)
- Material model → Source acquisition: uses acquired source
- Video editor → Source acquisition: adds video
- Video editor → Subtitle workflow: runs subtitle tasks
- Subtitle workflow → AI provider router: requests AI tasks (evidence: `src/core/subtitle_pipeline.py`)
- AI settings → AI configuration: configures providers
- AI provider router → AI configuration: reads routing config (evidence: `src/core/ai/router.py`)
- AI provider router → AI providers: dispatches provider calls (evidence: `src/core/ai/router.py`)
- Model manager UI → Model downloads: manages downloads
- Workbench UI → Clip workbench: opens creation
- Clip workbench → Clip backend: loads clip data (evidence: `desktop/src/creations/clip/clientBackend.ts`)
- Clip backend → Material model: resolves bound material (evidence: `desktop/src/creations/clip/clientBackend.ts`)
- Video editor → News Desk creation: generates video
- Video editor → Clip backend: generates clips
- Clip backend → Video render engine: renders clips
- News Desk creation → Composition system: assembles program
- Composition system → Video render engine: encodes output
