# surferxo3/trendclip-studio architecture

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

- Interactive diagram: https://gitdiagram.com/surferxo3/trendclip-studio
- Repository: https://github.com/surferxo3/trendclip-studio

## Overview

TrendClip Studio is a local-first video editorial tool: users discover current sources, analyze and rank moments, review recommended drafts, render and validate a selected clip, then download a review package for manual publishing. A separate original-production workflow creates graphical explainers. The README documents the end-to-end capabilities; sampled excerpts and the source index support only some internal call relationships, so other documented links are cited to the README rather than inferred from module names.

Main entry points: [`trendclip/dashboard.py`](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/dashboard.py) (Local dashboard API), [`trendclip/media_pipeline.py`](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/media_pipeline.py) (Media ingestion), [`trendclip/cli.py`](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/cli.py) (Command line), [`trendclip/media_worker.py`](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/media_worker.py) (Media worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Studio and control"]
  node_dashboard["Local dashboard API<br/>[dashboard.py]"]
  node_studio_ui["Studio interface<br/>[app.js]"]
  node_cli["Command line<br/>[cli.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_profiles["Source profiles<br/>[profiles.py]"]
  node_jobs["Job tracking<br/>[jobs.py]"]
end

subgraph group_source["Source analysis"]
  node_discovery["Source discovery<br/>[discovery.py]"]
  node_ingestion["Media ingestion<br/>[media_pipeline.py]"]
  node_rights["Rights records<br/>[rights.py]"]
  node_strategies["Moment analysis"]
  node_drafts["Draft recommendations<br/>[drafts.py]"]
end

subgraph group_editing["Rendering and review"]
  node_worker["Media worker<br/>[media_worker.py]"]
  node_render["Clip renderer<br/>[render.py]"]
  node_raster["Scene rasterizer<br/>[raster.py]"]
  node_validate["Clip validation<br/>[validate.py]"]
  node_package["Export package<br/>[export_package.py]"]
  node_codex["Optional Codex adapter<br/>[codex_adapter.py]"]
  node_benchmark["Quality benchmark<br/>[benchmark.py]"]
end

subgraph group_original["Original productions"]
  node_candidate["Briefing candidate<br/>[candidate.py]"]
  node_original["Original production"]
end

node_creator(("Creator"))
node_youtube["YouTube"]
node_reviewer(("Manual reviewer"))

node_creator -->|"uses"| node_studio_ui
node_studio_ui -->|"calls locally"| node_dashboard
node_creator -->|"runs commands"| node_cli
node_dashboard -->|"refreshes sources"| node_discovery
node_dashboard -->|"starts media work"| node_ingestion
node_dashboard -->|"uses profiles"| node_profiles
node_dashboard -->|"records rights"| node_rights
node_dashboard -->|"tracks work"| node_jobs
node_dashboard -.->|"requests assistance"| node_codex
node_cli -->|"runs discovery"| node_discovery
node_cli -->|"loads settings"| node_config
node_cli -->|"runs benchmark"| node_benchmark
node_discovery -->|"searches videos"| node_youtube
node_discovery -.->|"selects source"| node_ingestion
node_ingestion -->|"records authorization"| node_rights
node_ingestion -->|"analyzes moments"| node_strategies
node_ingestion -->|"assembles drafts"| node_drafts
node_ingestion -->|"checks output"| node_validate
node_ingestion -->|"updates status"| node_jobs
node_ingestion -->|"creates exports"| node_package
node_worker -->|"runs pipeline"| node_ingestion
node_worker -->|"uses recommendations"| node_drafts
node_worker -.->|"uses metadata aid"| node_codex
node_creator -->|"selects and reviews"| node_dashboard
node_dashboard -->|"dispatches jobs"| node_worker
node_worker -->|"renders selected range"| node_render
node_render -->|"rasterizes scenes"| node_raster
node_render -.->|"validates render"| node_validate
node_dashboard -->|"serves playback"| node_reviewer
node_reviewer -->|"downloads package"| node_package
node_cli -->|"builds briefing"| node_candidate
node_candidate -.->|"configures production"| node_original
node_cli -->|"runs production"| node_original
node_original -->|"validates video"| node_validate

click node_dashboard "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/dashboard.py"
click node_studio_ui "https://github.com/surferxo3/trendclip-studio/blob/main/dashboard/app.js"
click node_cli "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/cli.py"
click node_config "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/config.py"
click node_profiles "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/profiles.py"
click node_jobs "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/jobs.py"
click node_discovery "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/discovery.py"
click node_ingestion "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/media_pipeline.py"
click node_rights "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/rights.py"
click node_strategies "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/highlight_strategies.py"
click node_drafts "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/drafts.py"
click node_worker "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/media_worker.py"
click node_render "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/render.py"
click node_raster "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/raster.py"
click node_validate "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/validate.py"
click node_package "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/export_package.py"
click node_codex "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/codex_adapter.py"
click node_benchmark "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/benchmark.py"
click node_candidate "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/candidate.py"
click node_original "https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/original_production.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_dashboard,node_studio_ui,node_cli,node_config,node_profiles,node_jobs,node_reviewer toneBlue
class node_discovery,node_ingestion,node_rights,node_strategies,node_drafts toneAmber
class node_worker,node_render,node_raster,node_validate,node_package,node_codex,node_benchmark toneMint
class node_candidate,node_original toneRose
class node_creator,node_youtube toneIndigo
```

## Components

### Studio and control

- [Local dashboard API](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/dashboard.py): `trendclip/dashboard.py`
- [Studio interface](https://github.com/surferxo3/trendclip-studio/blob/main/dashboard/app.js): `dashboard/app.js`
- [Command line](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/cli.py): `trendclip/cli.py`
- [Configuration](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/config.py): `trendclip/config.py`
- [Source profiles](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/profiles.py): `trendclip/profiles.py`
- [Job tracking](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/jobs.py): `trendclip/jobs.py`

### Source analysis

- [Source discovery](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/discovery.py): `trendclip/discovery.py`
- [Media ingestion](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/media_pipeline.py): `trendclip/media_pipeline.py`
- [Rights records](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/rights.py): `trendclip/rights.py`
- [Moment analysis](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/highlight_strategies.py): `trendclip/highlight_strategies.py`
- [Draft recommendations](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/drafts.py): `trendclip/drafts.py`

### Rendering and review

- [Media worker](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/media_worker.py): `trendclip/media_worker.py`
- [Clip renderer](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/render.py): `trendclip/render.py`
- [Scene rasterizer](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/raster.py): `trendclip/raster.py`
- [Clip validation](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/validate.py): `trendclip/validate.py`
- [Export package](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/export_package.py): `trendclip/export_package.py`
- [Optional Codex adapter](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/codex_adapter.py): `trendclip/codex_adapter.py`
- [Quality benchmark](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/benchmark.py): `trendclip/benchmark.py`

### Original productions

- [Briefing candidate](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/candidate.py): `trendclip/candidate.py`
- [Original production](https://github.com/surferxo3/trendclip-studio/blob/main/trendclip/original_production.py): `trendclip/original_production.py`

### Other components

- **Creator**
- **YouTube**
- **Manual reviewer**

## Connections

- Creator → Studio interface: uses (evidence: `README.md`)
- Studio interface → Local dashboard API: calls locally (evidence: `README.md`)
- Creator → Command line: runs commands (evidence: `README.md`)
- Local dashboard API → Source discovery: refreshes sources (evidence: `trendclip/dashboard.py`)
- Local dashboard API → Media ingestion: starts media work (evidence: `trendclip/dashboard.py`)
- Local dashboard API → Source profiles: uses profiles (evidence: `trendclip/dashboard.py`)
- Local dashboard API → Rights records: records rights (evidence: `trendclip/dashboard.py`)
- Local dashboard API → Job tracking: tracks work (evidence: `trendclip/dashboard.py`)
- Local dashboard API → Optional Codex adapter: requests assistance (evidence: `trendclip/dashboard.py`)
- Command line → Source discovery: runs discovery (evidence: `trendclip/cli.py`)
- Command line → Configuration: loads settings (evidence: `trendclip/cli.py`)
- Command line → Quality benchmark: runs benchmark (evidence: `trendclip/cli.py`)
- Source discovery → YouTube: searches videos (evidence: `README.md`)
- Source discovery → Media ingestion: selects source
- Media ingestion → Rights records: records authorization (evidence: `trendclip/media_pipeline.py`)
- Media ingestion → Moment analysis: analyzes moments (evidence: `trendclip/media_pipeline.py`)
- Media ingestion → Draft recommendations: assembles drafts (evidence: `trendclip/media_pipeline.py`)
- Media ingestion → Clip validation: checks output (evidence: `trendclip/media_pipeline.py`)
- Media ingestion → Job tracking: updates status (evidence: `trendclip/media_pipeline.py`)
- Media ingestion → Export package: creates exports (evidence: `trendclip/media_pipeline.py`)
- Media worker → Media ingestion: runs pipeline (evidence: `trendclip/media_worker.py`)
- Media worker → Draft recommendations: uses recommendations (evidence: `trendclip/media_worker.py`)
- Media worker → Optional Codex adapter: uses metadata aid (evidence: `trendclip/media_worker.py`)
- Creator → Local dashboard API: selects and reviews (evidence: `README.md`)
- Local dashboard API → Media worker: dispatches jobs (evidence: `README.md`)
- Media worker → Clip renderer: renders selected range (evidence: `README.md`)
- Clip renderer → Scene rasterizer: rasterizes scenes (evidence: `trendclip/render.py`)
- Clip renderer → Clip validation: validates render
- Local dashboard API → Manual reviewer: serves playback (evidence: `README.md`)
- Manual reviewer → Export package: downloads package (evidence: `README.md`)
- Command line → Briefing candidate: builds briefing (evidence: `trendclip/cli.py`)
- Briefing candidate → Original production: configures production
- Command line → Original production: runs production (evidence: `trendclip/cli.py`)
- Original production → Clip validation: validates video (evidence: `trendclip/original_production.py`)
