# yelanq/tvehub architecture

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

- Interactive diagram: https://gitdiagram.com/yelanq/tvehub
- Repository: https://github.com/yelanq/tvehub

## Overview

TvE Hub is a visual 3D creation environment with a desktop home window and project-specific editor windows. The principal workflow is project selection, scene editing and preview, then web build/export; the editor and export share a runtime. Major adjacent capabilities include a graph window, an AI assistant backed by a knowledge brain, whiteboard, LAN sharing, and developer documentation. Source excerpts substantiate editor boot, engine/rendering, project loading, runtime APIs, and LAN routing; other product branches are included from README descriptions, with uncertain internal wiring omitted.

Main entry points: [`src/app/services/editorService.ts`](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/services/editorService.ts) (Project Bootstrap), [`src/framework/engine/EditorEngine.ts`](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/framework/engine/EditorEngine.ts) (Editor Engine), [`src/App.vue`](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/App.vue) (Editor Window), [`src-tauri/src/lanshare/server.rs`](https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/lanshare/server.rs) (LAN Sharing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace and Projects"]
  node_home["Home Workspace<br/>[home-main.ts]"]
  node_project["Project State<br/>[project.ts]"]
  node_editor["Editor Window<br/>[App.vue]"]
  node_editor_boot["Project Bootstrap<br/>[editorService.ts]"]
  node_assets["Asset Services<br/>[assetService.ts]"]
end

subgraph group_engine["Scene Editor and Runtime"]
  node_scene["Scene Model<br/>[Node.ts]"]
  node_engine_core["Editor Engine<br/>[EditorEngine.ts]"]
  node_renderer["Renderer<br/>[RendererManager.ts]"]
  node_animation["Animation Editing<br/>[useAnimPreview.ts]"]
  node_graph["Visual Logic Graph<br/>[GraphApp.vue]"]
  node_runtime_api["Script Runtime API<br/>[engine-api.ts]"]
  node_web_build["Web Build and Preview<br/>[build-export.ts]"]
end

subgraph group_assistant["Assistant"]
  node_assistant_ui["Assistant Workspace<br/>[AssistantApp.vue]"]
  node_assistant_agent["Assistant Agent<br/>[agent.ts]"]
  node_brain["Knowledge Brain<br/>[mod.rs]"]
  node_brain_index["Skill Ingestion<br/>[ingest.rs]"]
end

subgraph group_sharing["Sharing and Docs"]
  node_whiteboard["Whiteboard"]
  node_lan["LAN Sharing<br/>[server.rs]"]
  node_lan_routes["Share Routes<br/>[routes.rs]"]
  node_docs["User Documentation"]
end

subgraph group_backend["Desktop Services"]
  node_api["Desktop API<br/>[api.ts]"]
  node_disk[("Project Files")]
end

node_creator(("Creator"))
node_visitor(("LAN Visitor"))

node_creator -->|"manages projects"| node_home
node_home -->|"opens project window"| node_editor
node_editor -->|"hands off project"| node_editor_boot
node_editor_boot -->|"loads project"| node_project
node_editor_boot -->|"builds scene"| node_engine_core
node_project -->|"requests project data"| node_api
node_assets -->|"reads and writes assets"| node_api
node_editor_boot -->|"loads asset services"| node_assets
node_engine_core -->|"manages nodes"| node_scene
node_engine_core -->|"renders scene"| node_renderer
node_editor -->|"edits animation"| node_animation
node_animation -->|"previews node motion"| node_scene
node_creator -->|"creates visual logic"| node_graph
node_graph -.->|"configures scene logic"| node_scene
node_creator -->|"builds and exports"| node_web_build
node_web_build -->|"writes web output"| node_disk
node_creator -->|"requests task"| node_assistant_ui
node_assistant_ui -.->|"runs assistant plan"| node_assistant_agent
node_assistant_agent -.->|"retrieves knowledge"| node_brain
node_brain_index -->|"adds skill graph"| node_brain
node_creator -->|"collaborates visually"| node_whiteboard
node_creator -->|"publishes share"| node_lan
node_lan -->|"routes requests"| node_lan_routes
node_visitor -->|"opens shared site"| node_lan
node_creator -->|"consults guides"| node_docs
node_runtime_api -.->|"forwards host calls"| node_engine_core

click node_home "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/home-main.ts"
click node_project "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/stores/project.ts"
click node_editor "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/App.vue"
click node_editor_boot "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/services/editorService.ts"
click node_api "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/lib/api.ts"
click node_scene "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/framework/prototype/Node.ts"
click node_engine_core "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/framework/engine/EditorEngine.ts"
click node_renderer "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/framework/engine/modules/RendererManager.ts"
click node_assets "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/services/assetService.ts"
click node_animation "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/composables/anim-editor/useAnimPreview.ts"
click node_graph "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/graph-window/GraphApp.vue"
click node_runtime_api "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/runtime/core/tve/engine-api.ts"
click node_web_build "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/lib/build-export.ts"
click node_assistant_ui "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/assistant-window/AssistantApp.vue"
click node_assistant_agent "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/assistant-window/agent.ts"
click node_brain "https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/brain/graph/mod.rs"
click node_brain_index "https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/brain/skillsrc/ingest.rs"
click node_whiteboard "https://github.com/yelanq/tvehub/blob/forge-kp-4/src/whiteboard-window/components/WhiteboardStage.vue"
click node_lan "https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/lanshare/server.rs"
click node_lan_routes "https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/lanshare/routes.rs"
click node_docs "https://github.com/yelanq/tvehub/tree/forge-kp-4/public/docs"

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_home,node_project,node_editor,node_editor_boot,node_assets toneBlue
class node_scene,node_engine_core,node_renderer,node_animation,node_graph,node_runtime_api,node_web_build toneAmber
class node_assistant_ui,node_assistant_agent,node_brain,node_brain_index toneMint
class node_whiteboard,node_lan,node_lan_routes,node_docs toneRose
class node_api,node_disk,node_creator,node_visitor toneIndigo
```

## Components

### Workspace and Projects

- [Home Workspace](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/home-main.ts): `src/home-main.ts`
- [Project State](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/stores/project.ts): `src/app/stores/project.ts`
- [Editor Window](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/App.vue): `src/App.vue`
- [Project Bootstrap](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/services/editorService.ts): `src/app/services/editorService.ts`
- [Asset Services](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/services/assetService.ts): `src/app/services/assetService.ts`

### Scene Editor and Runtime

- [Scene Model](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/framework/prototype/Node.ts): `src/framework/prototype/Node.ts`
- [Editor Engine](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/framework/engine/EditorEngine.ts): `src/framework/engine/EditorEngine.ts`
- [Renderer](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/framework/engine/modules/RendererManager.ts): `src/framework/engine/modules/RendererManager.ts`
- [Animation Editing](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/composables/anim-editor/useAnimPreview.ts): `src/app/composables/anim-editor/useAnimPreview.ts`
- [Visual Logic Graph](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/graph-window/GraphApp.vue): `src/graph-window/GraphApp.vue`
- [Script Runtime API](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/runtime/core/tve/engine-api.ts): `src/runtime/core/tve/engine-api.ts`
- [Web Build and Preview](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/app/lib/build-export.ts): `src/app/lib/build-export.ts`

### Assistant

- [Assistant Workspace](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/assistant-window/AssistantApp.vue): `src/assistant-window/AssistantApp.vue`
- [Assistant Agent](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/assistant-window/agent.ts): `src/assistant-window/agent.ts`
- [Knowledge Brain](https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/brain/graph/mod.rs): `src-tauri/src/brain/graph/mod.rs`
- [Skill Ingestion](https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/brain/skillsrc/ingest.rs): `src-tauri/src/brain/skillsrc/ingest.rs`

### Sharing and Docs

- [Whiteboard](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/whiteboard-window/components/WhiteboardStage.vue): `src/whiteboard-window/components/WhiteboardStage.vue`
- [LAN Sharing](https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/lanshare/server.rs): `src-tauri/src/lanshare/server.rs`
- [Share Routes](https://github.com/yelanq/tvehub/blob/forge-kp-4/src-tauri/src/lanshare/routes.rs): `src-tauri/src/lanshare/routes.rs`
- [User Documentation](https://github.com/yelanq/tvehub/tree/forge-kp-4/public/docs): `public/docs`

### Desktop Services

- [Desktop API](https://github.com/yelanq/tvehub/blob/forge-kp-4/src/lib/api.ts): `src/lib/api.ts`
- **Project Files**

### Other components

- **Creator**
- **LAN Visitor**

## Connections

- Creator → Home Workspace: manages projects (evidence: `README.md`)
- Home Workspace → Editor Window: opens project window (evidence: `README.md`)
- Editor Window → Project Bootstrap: hands off project (evidence: `src/main.ts`)
- Project Bootstrap → Project State: loads project (evidence: `src/app/services/editorService.ts`)
- Project Bootstrap → Editor Engine: builds scene (evidence: `src/app/services/editorService.ts`)
- Project State → Desktop API: requests project data (evidence: `src/app/stores/project.ts`)
- Asset Services → Desktop API: reads and writes assets (evidence: `src/app/services/assetService.ts`)
- Project Bootstrap → Asset Services: loads asset services (evidence: `src/app/services/editorService.ts`)
- Editor Engine → Scene Model: manages nodes (evidence: `src/framework/engine/EditorEngine.ts`)
- Editor Engine → Renderer: renders scene (evidence: `src/framework/engine/EditorEngine.ts`)
- Editor Window → Animation Editing: edits animation (evidence: `src/App.vue`)
- Animation Editing → Scene Model: previews node motion (evidence: `src/app/composables/anim-editor/useAnimPreview.ts`)
- Creator → Visual Logic Graph: creates visual logic (evidence: `README.md`)
- Visual Logic Graph → Scene Model: configures scene logic
- Creator → Web Build and Preview: builds and exports (evidence: `README.md`)
- Web Build and Preview → Project Files: writes web output
- Creator → Assistant Workspace: requests task (evidence: `README.md`)
- Assistant Workspace → Assistant Agent: runs assistant plan
- Assistant Agent → Knowledge Brain: retrieves knowledge
- Skill Ingestion → Knowledge Brain: adds skill graph (evidence: `src-tauri/src/brain/skillsrc/ingest.rs`)
- Creator → Whiteboard: collaborates visually (evidence: `README.md`)
- Creator → LAN Sharing: publishes share (evidence: `README.md`)
- LAN Sharing → Share Routes: routes requests (evidence: `src-tauri/src/lanshare/server.rs`)
- LAN Visitor → LAN Sharing: opens shared site (evidence: `README.md`)
- Creator → User Documentation: consults guides (evidence: `README.md`)
- Script Runtime API → Editor Engine: forwards host calls
