# tensaikunyt/videohub architecture

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

- Interactive diagram: https://gitdiagram.com/tensaikunyt/videohub
- Repository: https://github.com/tensaikunyt/videohub

## Overview

VideoHub is a local studio for reviewing code-authored films and rendering them. The main workflow is to open a watched project, preview or inspect its video, annotate issues, send notes to an agent, and render or selectively re-render the result. The graph includes project discovery, render protection and queueing, cleanup, sound/timeline review, and Thumbnail Studio. Server wiring is partly supported by the SOURCE INDEX and README; unsampled routes and integrations are not expanded into asserted call chains.

Main entry points: [`server/hub.js`](https://github.com/tensaikunyt/videohub/blob/main/server/hub.js) (HTTP / MCP Hub), [`ui/review.js`](https://github.com/tensaikunyt/videohub/blob/main/ui/review.js) (Review Workspace), [`server/jobs.js`](https://github.com/tensaikunyt/videohub/blob/main/server/jobs.js) (Render Queue), [`ui/app.js`](https://github.com/tensaikunyt/videohub/blob/main/ui/app.js) (Studio UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Review Studio"]
  node_ui["Studio UI<br/>[app.js]"]
  node_review["Review Workspace<br/>[review.js]"]
  node_timeline["Timeline<br/>[timeline.js]"]
  node_sound["Sound Mixer<br/>[mixer.js]"]
  node_edit2d["2D Editing<br/>[edit2d.js]"]
  node_sceneedit["Scene Editing<br/>[sceneedit.js]"]
end

subgraph group_server["Local Server"]
  node_hub["HTTP / MCP Hub<br/>[hub.js]"]
  node_config["Settings<br/>[config.js]"]
  node_scan["Project Discovery<br/>[scan.js]"]
  node_live["Live Preview<br/>[live.js]"]
  node_notes["Review Notes<br/>[notes.js]"]
  node_revision["Source Revisions<br/>[source-revision.js]"]
  node_janitor["Disk Cleanup<br/>[janitor.js]"]
  node_platform["OS Services<br/>[platform.js]"]
end

subgraph group_render["Render Operations"]
  node_jobs["Render Queue<br/>[jobs.js]"]
  node_guard["Render Protection<br/>[guard.js]"]
  node_encoders["Encoder Selection<br/>[encoders.js]"]
  node_outputs["Render Outputs<br/>[outputs.js]"]
end

subgraph group_thumb["Thumbnail Studio"]
  node_thumbui["Thumbnail Editor<br/>[editor.js]"]
  node_thumbscene["Scene Renderer<br/>[scene.js]"]
  node_thumbstore[("Thumbnail Store<br/>[store.js]")]
end

node_user(("Reviewer"))
node_agent(("Claude / OpenCode"))

node_user -->|"uses"| node_ui
node_ui -->|"opens review"| node_review
node_review -->|"requests preview"| node_live
node_review -->|"shows timeline"| node_timeline
node_review -->|"offers mixing"| node_sound
node_review -->|"offers editing"| node_edit2d
node_review -->|"offers editing"| node_sceneedit
node_ui -.->|"calls API"| node_hub
node_agent -->|"uses MCP tools"| node_hub
node_hub -->|"uses settings"| node_config
node_hub -->|"uses discovery"| node_scan
node_hub -->|"uses cleanup"| node_janitor
node_hub -->|"uses protection"| node_guard
node_hub -->|"uses queue"| node_jobs
node_hub -->|"uses preview"| node_live
node_hub -->|"uses notes"| node_notes
node_hub -->|"uses revisions"| node_revision
node_hub -->|"uses encoders"| node_encoders
node_hub -->|"uses outputs"| node_outputs
node_jobs -->|"tracks processes"| node_guard
node_jobs -->|"selects encoders"| node_encoders
node_jobs -->|"spawns renders"| node_platform
node_janitor -->|"uses OS services"| node_platform
node_thumbui -->|"renders scene"| node_thumbscene
node_thumbui -->|"loads and saves"| node_thumbstore
node_hub -.->|"uses thumbnail store"| node_thumbstore

click node_ui "https://github.com/tensaikunyt/videohub/blob/main/ui/app.js"
click node_review "https://github.com/tensaikunyt/videohub/blob/main/ui/review.js"
click node_timeline "https://github.com/tensaikunyt/videohub/blob/main/ui/review/timeline.js"
click node_sound "https://github.com/tensaikunyt/videohub/blob/main/ui/review/mixer.js"
click node_edit2d "https://github.com/tensaikunyt/videohub/blob/main/ui/review/edit2d.js"
click node_sceneedit "https://github.com/tensaikunyt/videohub/blob/main/ui/review/sceneedit.js"
click node_hub "https://github.com/tensaikunyt/videohub/blob/main/server/hub.js"
click node_config "https://github.com/tensaikunyt/videohub/blob/main/server/config.js"
click node_scan "https://github.com/tensaikunyt/videohub/blob/main/server/scan.js"
click node_live "https://github.com/tensaikunyt/videohub/blob/main/server/live.js"
click node_notes "https://github.com/tensaikunyt/videohub/blob/main/server/notes.js"
click node_revision "https://github.com/tensaikunyt/videohub/blob/main/server/source-revision.js"
click node_jobs "https://github.com/tensaikunyt/videohub/blob/main/server/jobs.js"
click node_guard "https://github.com/tensaikunyt/videohub/blob/main/server/guard.js"
click node_encoders "https://github.com/tensaikunyt/videohub/blob/main/server/encoders.js"
click node_janitor "https://github.com/tensaikunyt/videohub/blob/main/server/janitor.js"
click node_outputs "https://github.com/tensaikunyt/videohub/blob/main/server/outputs.js"
click node_thumbui "https://github.com/tensaikunyt/videohub/blob/main/ui/thumbstudio/editor.js"
click node_thumbscene "https://github.com/tensaikunyt/videohub/blob/main/ui/thumbstudio/scene.js"
click node_thumbstore "https://github.com/tensaikunyt/videohub/blob/main/server/thumbstudio/store.js"
click node_platform "https://github.com/tensaikunyt/videohub/blob/main/server/platform.js"

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_ui,node_review,node_timeline,node_sound,node_edit2d,node_sceneedit,node_user toneBlue
class node_hub,node_config,node_scan,node_live,node_notes,node_revision,node_janitor,node_platform toneAmber
class node_jobs,node_guard,node_encoders,node_outputs toneMint
class node_thumbui,node_thumbscene,node_thumbstore toneRose
class node_agent toneIndigo
```

## Components

### Review Studio

- [Studio UI](https://github.com/tensaikunyt/videohub/blob/main/ui/app.js): `ui/app.js`
- [Review Workspace](https://github.com/tensaikunyt/videohub/blob/main/ui/review.js): `ui/review.js`
- [Timeline](https://github.com/tensaikunyt/videohub/blob/main/ui/review/timeline.js): `ui/review/timeline.js`
- [Sound Mixer](https://github.com/tensaikunyt/videohub/blob/main/ui/review/mixer.js): `ui/review/mixer.js`
- [2D Editing](https://github.com/tensaikunyt/videohub/blob/main/ui/review/edit2d.js): `ui/review/edit2d.js`
- [Scene Editing](https://github.com/tensaikunyt/videohub/blob/main/ui/review/sceneedit.js): `ui/review/sceneedit.js`

### Local Server

- [HTTP / MCP Hub](https://github.com/tensaikunyt/videohub/blob/main/server/hub.js): `server/hub.js`
- [Settings](https://github.com/tensaikunyt/videohub/blob/main/server/config.js): `server/config.js`
- [Project Discovery](https://github.com/tensaikunyt/videohub/blob/main/server/scan.js): `server/scan.js`
- [Live Preview](https://github.com/tensaikunyt/videohub/blob/main/server/live.js): `server/live.js`
- [Review Notes](https://github.com/tensaikunyt/videohub/blob/main/server/notes.js): `server/notes.js`
- [Source Revisions](https://github.com/tensaikunyt/videohub/blob/main/server/source-revision.js): `server/source-revision.js`
- [Disk Cleanup](https://github.com/tensaikunyt/videohub/blob/main/server/janitor.js): `server/janitor.js`
- [OS Services](https://github.com/tensaikunyt/videohub/blob/main/server/platform.js): `server/platform.js`

### Render Operations

- [Render Queue](https://github.com/tensaikunyt/videohub/blob/main/server/jobs.js): `server/jobs.js`
- [Render Protection](https://github.com/tensaikunyt/videohub/blob/main/server/guard.js): `server/guard.js`
- [Encoder Selection](https://github.com/tensaikunyt/videohub/blob/main/server/encoders.js): `server/encoders.js`
- [Render Outputs](https://github.com/tensaikunyt/videohub/blob/main/server/outputs.js): `server/outputs.js`

### Thumbnail Studio

- [Thumbnail Editor](https://github.com/tensaikunyt/videohub/blob/main/ui/thumbstudio/editor.js): `ui/thumbstudio/editor.js`
- [Scene Renderer](https://github.com/tensaikunyt/videohub/blob/main/ui/thumbstudio/scene.js): `ui/thumbstudio/scene.js`
- [Thumbnail Store](https://github.com/tensaikunyt/videohub/blob/main/server/thumbstudio/store.js): `server/thumbstudio/store.js`

### Other components

- **Reviewer**
- **Claude / OpenCode**

## Connections

- Reviewer → Studio UI: uses (evidence: `README.md`)
- Studio UI → Review Workspace: opens review (evidence: `ui/app.js`)
- Review Workspace → Live Preview: requests preview (evidence: `ui/review.js`)
- Review Workspace → Timeline: shows timeline (evidence: `ui/review/timeline.js`)
- Review Workspace → Sound Mixer: offers mixing (evidence: `ui/review.js`)
- Review Workspace → 2D Editing: offers editing (evidence: `ui/review.js`)
- Review Workspace → Scene Editing: offers editing (evidence: `ui/review.js`)
- Studio UI → HTTP / MCP Hub: calls API
- Claude / OpenCode → HTTP / MCP Hub: uses MCP tools (evidence: `README.md`)
- HTTP / MCP Hub → Settings: uses settings (evidence: `server/hub.js`)
- HTTP / MCP Hub → Project Discovery: uses discovery (evidence: `server/hub.js`)
- HTTP / MCP Hub → Disk Cleanup: uses cleanup (evidence: `server/hub.js`)
- HTTP / MCP Hub → Render Protection: uses protection (evidence: `server/hub.js`)
- HTTP / MCP Hub → Render Queue: uses queue (evidence: `server/hub.js`)
- HTTP / MCP Hub → Live Preview: uses preview (evidence: `server/hub.js`)
- HTTP / MCP Hub → Review Notes: uses notes (evidence: `server/hub.js`)
- HTTP / MCP Hub → Source Revisions: uses revisions (evidence: `server/hub.js`)
- HTTP / MCP Hub → Encoder Selection: uses encoders (evidence: `server/hub.js`)
- HTTP / MCP Hub → Render Outputs: uses outputs (evidence: `server/hub.js`)
- Render Queue → Render Protection: tracks processes (evidence: `server/jobs.js`)
- Render Queue → Encoder Selection: selects encoders (evidence: `server/jobs.js`)
- Render Queue → OS Services: spawns renders (evidence: `server/jobs.js`)
- Disk Cleanup → OS Services: uses OS services (evidence: `server/janitor.js`)
- Thumbnail Editor → Scene Renderer: renders scene (evidence: `ui/thumbstudio/scene.js`)
- Thumbnail Editor → Thumbnail Store: loads and saves (evidence: `README.md`)
- HTTP / MCP Hub → Thumbnail Store: uses thumbnail store (evidence: `server/hub.js`)
