# olelehmann/youtube-automation-agent architecture

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

- Interactive diagram: https://gitdiagram.com/olelehmann/youtube-automation-agent
- Repository: https://github.com/olelehmann/youtube-automation-agent

## Overview

This repository is a YouTube channel automation service: a user requests content through the dashboard/API or automation runs on a schedule; specialized agents plan topics, write scripts, create thumbnails and SEO metadata, produce video assets, then schedule and publish to YouTube. Analytics feed ongoing optimization. The graph reflects the documented stages and source-index references; unsampled integrations and internal agent handoffs are omitted where no caller evidence was provided.

Main entry points: [`index.js`](https://github.com/olelehmann/youtube-automation-agent/blob/master/index.js) (Dashboard and API), [`database/db.js`](https://github.com/olelehmann/youtube-automation-agent/blob/master/database/db.js) (Automation Database), [`utils/logger.js`](https://github.com/olelehmann/youtube-automation-agent/blob/master/utils/logger.js) (Logging), [`agents/production-management-agent.js`](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/production-management-agent.js) (Production Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Service Control"]
  node_api["Dashboard and API<br/>[index.js]"]
  node_dashboard["Web Dashboard<br/>[index.html]"]
  node_scheduler["Automation Scheduler"]
end

subgraph group_planning["Content Planning"]
  node_strategy["Trend Strategy"]
  node_script["Script Writing"]
  node_seo["SEO Optimization"]
end

subgraph group_production["Video Production"]
  node_thumbnail["Thumbnail Design"]
  node_production_agent["Production Management"]
  node_video_generator["AI Media Generation"]
  node_assets["Generated Content Assets"]
end

subgraph group_publishing["Publishing and Insights"]
  node_publisher["Publishing and Scheduling"]
  node_youtube["YouTube Platform"]
  node_analytics["Analytics and Optimization"]
end

subgraph group_infrastructure["Persistence and Support"]
  node_database[("Automation Database<br/>[db.js]")]
  node_credentials["Credential Management"]
  node_setup["Initial Setup<br/>[setup.js]"]
  node_logger["Logging<br/>[logger.js]"]
end

node_creator(("Channel Operator"))

node_creator -->|"uses"| node_dashboard
node_dashboard -->|"sends requests"| node_api
node_creator -->|"requests generation"| node_api
node_api -->|"dispatches to"| node_strategy
node_api -->|"dispatches to"| node_script
node_api -->|"dispatches to"| node_thumbnail
node_api -->|"dispatches to"| node_seo
node_api -->|"dispatches to"| node_production_agent
node_api -->|"publishes via"| node_publisher
node_api -->|"queries"| node_analytics
node_api -->|"reads schedule"| node_database
node_api -->|"validates"| node_credentials
node_api -->|"initializes"| node_scheduler
node_scheduler -->|"checks schedule"| node_publisher
node_scheduler -->|"reads settings"| node_database
node_production_agent -->|"generates media"| node_video_generator
node_production_agent -->|"writes assets"| node_assets
node_publisher -->|"uploads video"| node_youtube
node_publisher -->|"saves schedule"| node_database
node_strategy -.->|"loads history"| node_database
node_script -->|"saves script"| node_database
node_thumbnail -->|"saves thumbnail"| node_database
node_seo -->|"saves SEO data"| node_database
node_production_agent -.->|"updates production"| node_database
node_analytics -.->|"analyzes performance"| node_youtube
node_analytics -.->|"stores reports"| node_database
node_setup -->|"configures"| node_credentials
node_setup -->|"initializes"| node_database
node_strategy -->|"logs events"| node_logger
node_script -->|"logs events"| node_logger
node_thumbnail -->|"logs events"| node_logger
node_seo -->|"logs events"| node_logger
node_production_agent -->|"logs events"| node_logger
node_publisher -->|"logs events"| node_logger
node_analytics -->|"logs events"| node_logger
node_scheduler -->|"logs events"| node_logger

click node_api "https://github.com/olelehmann/youtube-automation-agent/blob/master/index.js"
click node_dashboard "https://github.com/olelehmann/youtube-automation-agent/blob/master/dashboard/index.html"
click node_scheduler "https://github.com/olelehmann/youtube-automation-agent/blob/master/schedules/daily-automation.js"
click node_strategy "https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/content-strategy-agent.js"
click node_script "https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/script-writer-agent.js"
click node_thumbnail "https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/thumbnail-designer-agent.js"
click node_seo "https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/seo-optimizer-agent.js"
click node_production_agent "https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/production-management-agent.js"
click node_video_generator "https://github.com/olelehmann/youtube-automation-agent/blob/master/utils/ai-video-generator.js"
click node_assets "https://github.com/olelehmann/youtube-automation-agent/tree/master/data"
click node_publisher "https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/publishing-scheduling-agent.js"
click node_analytics "https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/analytics-optimization-agent.js"
click node_database "https://github.com/olelehmann/youtube-automation-agent/blob/master/database/db.js"
click node_credentials "https://github.com/olelehmann/youtube-automation-agent/blob/master/utils/credential-manager.js"
click node_setup "https://github.com/olelehmann/youtube-automation-agent/blob/master/setup.js"
click node_logger "https://github.com/olelehmann/youtube-automation-agent/blob/master/utils/logger.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_api,node_dashboard,node_scheduler toneBlue
class node_strategy,node_script,node_seo toneAmber
class node_thumbnail,node_production_agent,node_video_generator,node_assets toneMint
class node_publisher,node_youtube,node_analytics toneRose
class node_database,node_credentials,node_setup,node_logger,node_creator toneIndigo
```

## Components

### Service Control

- [Dashboard and API](https://github.com/olelehmann/youtube-automation-agent/blob/master/index.js): `index.js`
- [Web Dashboard](https://github.com/olelehmann/youtube-automation-agent/blob/master/dashboard/index.html): `dashboard/index.html`
- [Automation Scheduler](https://github.com/olelehmann/youtube-automation-agent/blob/master/schedules/daily-automation.js): `schedules/daily-automation.js`

### Content Planning

- [Trend Strategy](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/content-strategy-agent.js): `agents/content-strategy-agent.js`
- [Script Writing](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/script-writer-agent.js): `agents/script-writer-agent.js`
- [SEO Optimization](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/seo-optimizer-agent.js): `agents/seo-optimizer-agent.js`

### Video Production

- [Thumbnail Design](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/thumbnail-designer-agent.js): `agents/thumbnail-designer-agent.js`
- [Production Management](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/production-management-agent.js): `agents/production-management-agent.js`
- [AI Media Generation](https://github.com/olelehmann/youtube-automation-agent/blob/master/utils/ai-video-generator.js): `utils/ai-video-generator.js`
- [Generated Content Assets](https://github.com/olelehmann/youtube-automation-agent/tree/master/data): `data`

### Publishing and Insights

- [Publishing and Scheduling](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/publishing-scheduling-agent.js): `agents/publishing-scheduling-agent.js`
- **YouTube Platform**
- [Analytics and Optimization](https://github.com/olelehmann/youtube-automation-agent/blob/master/agents/analytics-optimization-agent.js): `agents/analytics-optimization-agent.js`

### Persistence and Support

- [Automation Database](https://github.com/olelehmann/youtube-automation-agent/blob/master/database/db.js): `database/db.js`
- [Credential Management](https://github.com/olelehmann/youtube-automation-agent/blob/master/utils/credential-manager.js): `utils/credential-manager.js`
- [Initial Setup](https://github.com/olelehmann/youtube-automation-agent/blob/master/setup.js): `setup.js`
- [Logging](https://github.com/olelehmann/youtube-automation-agent/blob/master/utils/logger.js): `utils/logger.js`

### Other components

- **Channel Operator**

## Connections

- Channel Operator → Web Dashboard: uses (evidence: `README.md`)
- Web Dashboard → Dashboard and API: sends requests (evidence: `README.md`)
- Channel Operator → Dashboard and API: requests generation (evidence: `README.md`)
- Dashboard and API → Trend Strategy: dispatches to (evidence: `index.js`)
- Dashboard and API → Script Writing: dispatches to (evidence: `index.js`)
- Dashboard and API → Thumbnail Design: dispatches to (evidence: `index.js`)
- Dashboard and API → SEO Optimization: dispatches to (evidence: `index.js`)
- Dashboard and API → Production Management: dispatches to (evidence: `index.js`)
- Dashboard and API → Publishing and Scheduling: publishes via (evidence: `index.js`)
- Dashboard and API → Analytics and Optimization: queries (evidence: `index.js`)
- Dashboard and API → Automation Database: reads schedule (evidence: `index.js`)
- Dashboard and API → Credential Management: validates (evidence: `index.js`)
- Dashboard and API → Automation Scheduler: initializes (evidence: `index.js`)
- Automation Scheduler → Publishing and Scheduling: checks schedule (evidence: `schedules/daily-automation.js`)
- Automation Scheduler → Automation Database: reads settings (evidence: `schedules/daily-automation.js`)
- Production Management → AI Media Generation: generates media (evidence: `agents/production-management-agent.js`)
- Production Management → Generated Content Assets: writes assets (evidence: `agents/production-management-agent.js`)
- Publishing and Scheduling → YouTube Platform: uploads video (evidence: `agents/publishing-scheduling-agent.js`)
- Publishing and Scheduling → Automation Database: saves schedule (evidence: `agents/publishing-scheduling-agent.js`)
- Trend Strategy → Automation Database: loads history
- Script Writing → Automation Database: saves script (evidence: `agents/script-writer-agent.js`)
- Thumbnail Design → Automation Database: saves thumbnail (evidence: `agents/thumbnail-designer-agent.js`)
- SEO Optimization → Automation Database: saves SEO data (evidence: `agents/seo-optimizer-agent.js`)
- Production Management → Automation Database: updates production
- Analytics and Optimization → YouTube Platform: analyzes performance
- Analytics and Optimization → Automation Database: stores reports
- Initial Setup → Credential Management: configures (evidence: `setup.js`)
- Initial Setup → Automation Database: initializes (evidence: `setup.js`)
- Trend Strategy → Logging: logs events (evidence: `agents/content-strategy-agent.js`)
- Script Writing → Logging: logs events (evidence: `agents/script-writer-agent.js`)
- Thumbnail Design → Logging: logs events (evidence: `agents/thumbnail-designer-agent.js`)
- SEO Optimization → Logging: logs events (evidence: `agents/seo-optimizer-agent.js`)
- Production Management → Logging: logs events (evidence: `agents/production-management-agent.js`)
- Publishing and Scheduling → Logging: logs events (evidence: `agents/publishing-scheduling-agent.js`)
- Analytics and Optimization → Logging: logs events (evidence: `agents/analytics-optimization-agent.js`)
- Automation Scheduler → Logging: logs events (evidence: `schedules/daily-automation.js`)
