# fearless-27/youtube_shorts_agent architecture

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

- Interactive diagram: https://gitdiagram.com/fearless-27/youtube_shorts_agent
- Repository: https://github.com/fearless-27/youtube_shorts_agent

## Overview

GhostPipe is an autonomous YouTube Shorts production system with a React operator dashboard, a Node.js API, and Python automation. Its principal workflow runs from trend discovery and source acquisition through analysis, video generation, scoring, approval or auto-queue, scheduled publishing, and performance learning. The README documents these stages and the dashboard/API relationship; sampled source excerpts confirm selected API, client-state, safety, audio, and rendering responsibilities. Several pipeline links below reflect documented capabilities rather than inspected call sites.

Main entry points: [`pipeline/ghostpipe_v5_1_pipeline.py`](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py) (Pipeline runner), [`src/pages/Dashboard.tsx`](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/Dashboard.tsx) (Dashboard shell), [`src/lib/api.ts`](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/lib/api.ts) (Authenticated API client), [`pipeline/telegram_tamil_shorts_pipeline.py`](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/telegram_tamil_shorts_pipeline.py) (Telegram Shorts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Shorts pipeline"]
  node_pipeline_runner["Pipeline runner"]
  node_trend_discovery["Trend discovery"]
  node_source_download["Source download"]
  node_virality_scoring["Virality scoring"]
  node_copyright_safety["Copyright checks"]
  node_scheduling["Upload scheduling"]
  node_learning[("Performance learning")]
  node_telegram_pipeline["Telegram Shorts"]
end

subgraph group_media["Media intelligence"]
  node_content_analysis["Content analysis"]
  node_audio_tools["Audio tools"]
  node_clip_generation["Short generation"]
  node_video_adapter["Video adapter"]
  node_render_engine["Video rendering<br/>[render.py]"]
end

subgraph group_dashboard["Operator dashboard"]
  node_approval["Review and approval<br/>[ContentStudio.tsx]"]
  node_dashboard_shell["Dashboard shell<br/>[Dashboard.tsx]"]
  node_overview["Overview analytics<br/>[Overview.tsx]"]
  node_command_center["Command center<br/>[CommandCenter.tsx]"]
  node_content_studio["Content studio<br/>[ContentStudio.tsx]"]
  node_smart_editor["Smart editor<br/>[SmartEditor.tsx]"]
  node_upload_center["Upload center<br/>[UploadCenter.tsx]"]
  node_settings["Settings<br/>[SettingsPage.tsx]"]
  node_dashboard_context["Dashboard state"]
  node_store["Dashboard data client<br/>[store.ts]"]
end

subgraph group_backend["API and integrations"]
  node_api_integrations["Platform integrations"]
  node_api_client["Authenticated API client<br/>[api.ts]"]
  node_api_server["Node API server<br/>[server.mjs]"]
end

node_sources(("Trend sources"))
node_youtube(("YouTube"))

node_sources -->|"provides trends"| node_trend_discovery
node_pipeline_runner -->|"scans trends"| node_trend_discovery
node_pipeline_runner -->|"downloads media"| node_source_download
node_pipeline_runner -->|"analyzes content"| node_content_analysis
node_content_analysis -.->|"uses audio analysis"| node_audio_tools
node_pipeline_runner -->|"generates Shorts"| node_clip_generation
node_clip_generation -.->|"adapts video"| node_video_adapter
node_video_adapter -->|"delegates rendering"| node_render_engine
node_pipeline_runner -->|"scores candidates"| node_virality_scoring
node_pipeline_runner -->|"checks copyright"| node_copyright_safety
node_pipeline_runner -->|"routes for review"| node_approval
node_approval -->|"approves uploads"| node_scheduling
node_pipeline_runner -->|"schedules uploads"| node_scheduling
node_scheduling -->|"publishes videos"| node_youtube
node_youtube -->|"returns performance"| node_learning
node_learning -->|"informs predictions"| node_pipeline_runner
node_pipeline_runner -.->|"offers Telegram workflow"| node_telegram_pipeline
node_telegram_pipeline -->|"uploads safe videos"| node_youtube
node_dashboard_shell -->|"routes views"| node_overview
node_dashboard_shell -->|"routes views"| node_command_center
node_dashboard_shell -->|"routes views"| node_content_studio
node_dashboard_shell -->|"routes views"| node_smart_editor
node_dashboard_shell -->|"routes views"| node_upload_center
node_dashboard_shell -->|"routes views"| node_settings
node_dashboard_shell -->|"provides state"| node_dashboard_context
node_dashboard_context -->|"fetches overview"| node_api_client
node_store -->|"calls API"| node_api_client
node_api_client -->|"sends requests"| node_api_server
node_api_server -.->|"controls pipeline"| node_pipeline_runner
node_api_integrations -.->|"integrates platform"| node_youtube

click node_pipeline_runner "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py"
click node_trend_discovery "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py"
click node_source_download "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py"
click node_content_analysis "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/audio_intelligence.py"
click node_audio_tools "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/video_audio_tools.py"
click node_clip_generation "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/smart_clip_engine.py"
click node_video_adapter "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/video_use_adapter.py"
click node_render_engine "https://github.com/fearless-27/youtube_shorts_agent/blob/main/video-use-main/helpers/render.py"
click node_virality_scoring "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py"
click node_copyright_safety "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/copyright_shield_v2.py"
click node_approval "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/ContentStudio.tsx"
click node_scheduling "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py"
click node_learning "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py"
click node_telegram_pipeline "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/telegram_tamil_shorts_pipeline.py"
click node_api_integrations "https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/api_integrations.py"
click node_dashboard_shell "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/Dashboard.tsx"
click node_overview "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/Overview.tsx"
click node_command_center "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/CommandCenter.tsx"
click node_content_studio "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/ContentStudio.tsx"
click node_smart_editor "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/SmartEditor.tsx"
click node_upload_center "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/UploadCenter.tsx"
click node_settings "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/SettingsPage.tsx"
click node_dashboard_context "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/context/DashboardContext.tsx"
click node_store "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/data/store.ts"
click node_api_client "https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/lib/api.ts"
click node_api_server "https://github.com/fearless-27/youtube_shorts_agent/blob/main/server.mjs"

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_pipeline_runner,node_trend_discovery,node_source_download,node_virality_scoring,node_copyright_safety,node_scheduling,node_learning,node_telegram_pipeline toneBlue
class node_content_analysis,node_audio_tools,node_clip_generation,node_video_adapter,node_render_engine toneAmber
class node_approval,node_dashboard_shell,node_overview,node_command_center,node_content_studio,node_smart_editor,node_upload_center,node_settings,node_dashboard_context,node_store toneMint
class node_api_integrations,node_api_client,node_api_server toneRose
class node_sources,node_youtube toneIndigo
```

## Components

### Shorts pipeline

- [Pipeline runner](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py): `pipeline/ghostpipe_v5_1_pipeline.py`
- [Trend discovery](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py): `pipeline/ghostpipe_v5_1_pipeline.py`
- [Source download](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py): `pipeline/ghostpipe_v5_1_pipeline.py`
- [Virality scoring](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py): `pipeline/ghostpipe_v5_1_pipeline.py`
- [Copyright checks](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/copyright_shield_v2.py): `pipeline/copyright_shield_v2.py`
- [Upload scheduling](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py): `pipeline/ghostpipe_v5_1_pipeline.py`
- [Performance learning](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/ghostpipe_v5_1_pipeline.py): `pipeline/ghostpipe_v5_1_pipeline.py`
- [Telegram Shorts](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/telegram_tamil_shorts_pipeline.py): `pipeline/telegram_tamil_shorts_pipeline.py`

### Media intelligence

- [Content analysis](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/audio_intelligence.py): `pipeline/audio_intelligence.py`
- [Audio tools](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/video_audio_tools.py): `pipeline/video_audio_tools.py`
- [Short generation](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/smart_clip_engine.py): `pipeline/smart_clip_engine.py`
- [Video adapter](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/video_use_adapter.py): `pipeline/video_use_adapter.py`
- [Video rendering](https://github.com/fearless-27/youtube_shorts_agent/blob/main/video-use-main/helpers/render.py): `video-use-main/helpers/render.py`

### Operator dashboard

- [Review and approval](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/ContentStudio.tsx): `src/pages/dashboard/ContentStudio.tsx`
- [Dashboard shell](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Overview analytics](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/Overview.tsx): `src/pages/dashboard/Overview.tsx`
- [Command center](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/CommandCenter.tsx): `src/pages/dashboard/CommandCenter.tsx`
- [Content studio](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/ContentStudio.tsx): `src/pages/dashboard/ContentStudio.tsx`
- [Smart editor](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/SmartEditor.tsx): `src/pages/dashboard/SmartEditor.tsx`
- [Upload center](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/UploadCenter.tsx): `src/pages/dashboard/UploadCenter.tsx`
- [Settings](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/pages/dashboard/SettingsPage.tsx): `src/pages/dashboard/SettingsPage.tsx`
- [Dashboard state](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/context/DashboardContext.tsx): `src/context/DashboardContext.tsx`
- [Dashboard data client](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/data/store.ts): `src/data/store.ts`

### API and integrations

- [Platform integrations](https://github.com/fearless-27/youtube_shorts_agent/blob/main/pipeline/api_integrations.py): `pipeline/api_integrations.py`
- [Authenticated API client](https://github.com/fearless-27/youtube_shorts_agent/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Node API server](https://github.com/fearless-27/youtube_shorts_agent/blob/main/server.mjs): `server.mjs`

### Other components

- **Trend sources**
- **YouTube**

## Connections

- Trend sources → Trend discovery: provides trends
- Pipeline runner → Trend discovery: scans trends (evidence: `pipeline/ghostpipe_v5_1_pipeline.py`)
- Pipeline runner → Source download: downloads media (evidence: `pipeline/ghostpipe_v5_1_pipeline.py`)
- Pipeline runner → Content analysis: analyzes content
- Content analysis → Audio tools: uses audio analysis
- Pipeline runner → Short generation: generates Shorts
- Short generation → Video adapter: adapts video
- Video adapter → Video rendering: delegates rendering (evidence: `pipeline/video_use_adapter.py`)
- Pipeline runner → Virality scoring: scores candidates (evidence: `pipeline/ghostpipe_v5_1_pipeline.py`)
- Pipeline runner → Copyright checks: checks copyright (evidence: `pipeline/ghostpipe_v5_1_pipeline.py`)
- Pipeline runner → Review and approval: routes for review
- Review and approval → Upload scheduling: approves uploads
- Pipeline runner → Upload scheduling: schedules uploads (evidence: `pipeline/ghostpipe_v5_1_pipeline.py`)
- Upload scheduling → YouTube: publishes videos
- YouTube → Performance learning: returns performance
- Performance learning → Pipeline runner: informs predictions (evidence: `pipeline/ghostpipe_v5_1_pipeline.py`)
- Pipeline runner → Telegram Shorts: offers Telegram workflow (evidence: `pipeline/telegram_tamil_shorts_pipeline.py`)
- Telegram Shorts → YouTube: uploads safe videos (evidence: `pipeline/telegram_tamil_shorts_pipeline.py`)
- Dashboard shell → Overview analytics: routes views (evidence: `src/pages/Dashboard.tsx`)
- Dashboard shell → Command center: routes views (evidence: `src/pages/Dashboard.tsx`)
- Dashboard shell → Content studio: routes views (evidence: `src/pages/Dashboard.tsx`)
- Dashboard shell → Smart editor: routes views (evidence: `src/pages/Dashboard.tsx`)
- Dashboard shell → Upload center: routes views (evidence: `src/pages/Dashboard.tsx`)
- Dashboard shell → Settings: routes views (evidence: `src/pages/Dashboard.tsx`)
- Dashboard shell → Dashboard state: provides state (evidence: `src/pages/Dashboard.tsx`)
- Dashboard state → Authenticated API client: fetches overview (evidence: `src/context/DashboardContext.tsx`)
- Dashboard data client → Authenticated API client: calls API (evidence: `src/data/store.ts`)
- Authenticated API client → Node API server: sends requests
- Node API server → Pipeline runner: controls pipeline
- Platform integrations → YouTube: integrates platform
