# debanjan110d/youtube-stream-automator architecture

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

- Interactive diagram: https://gitdiagram.com/debanjan110d/youtube-stream-automator
- Repository: https://github.com/debanjan110d/youtube-stream-automator

## Overview

OmniStream Automator is a creator-facing livestream scheduler that prepares a broadcast once and publishes it to YouTube, with optional Kick and Twitch metadata synchronization. The main workflow runs from the dashboard’s template and stream inputs through the create-stream API to scheduling, thumbnail upload, and ingest binding; connected platforms use encrypted session credentials. Account linking, previous-stream reuse, analytics, and MCP scheduling are separate product branches. The README documents several dashboard capabilities whose detailed wiring is not present in the sampled source, so those links are shown only at the documented feature level.

Main entry points: [`app/dashboard/page.tsx`](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/dashboard/page.tsx) (Dashboard), [`app/api/create-stream/route.ts`](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/create-stream/route.ts) (Schedule API), [`lib/session.ts`](https://github.com/debanjan110d/youtube-stream-automator/blob/main/lib/session.ts) (Encrypted session), [`app/api/previous-stream/route.ts`](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/previous-stream/route.ts) (Previous stream)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_creator["Creator dashboard"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_templates["Template import"]
  node_tagmanager["Tag editor<br/>[TagManager.tsx]"]
  node_thumbnail["Thumbnail upload"]
  node_tour["Guided tour<br/>[InteractiveTour.ts]"]
end

subgraph group_publishing["Broadcast publishing"]
  node_schedule["Schedule API<br/>[route.ts]"]
  node_youtube["YouTube client<br/>[youtube.ts]"]
end

subgraph group_accounts["Accounts and sessions"]
  node_session["Encrypted session<br/>[session.ts]"]
  node_googlelogin["YouTube OAuth<br/>[route.ts]"]
  node_googlecallback["YouTube callback<br/>[route.ts]"]
  node_kicklogin["Kick OAuth<br/>[route.ts]"]
  node_kickcallback["Kick callback<br/>[route.ts]"]
  node_twitchlogin["Twitch OAuth<br/>[route.ts]"]
  node_twitchcallback["Twitch callback<br/>[route.ts]"]
  node_status["Connection status<br/>[route.ts]"]
end

subgraph group_insights["Analytics and reuse"]
  node_previous["Previous stream<br/>[route.ts]"]
  node_analyticsapi["Analytics API<br/>[route.ts]"]
  node_analyticsui["Analytics view<br/>[page.tsx]"]
  node_analyticsstore[("Analytics log")]
end

subgraph group_automation["AI automation"]
  node_mcp["MCP server<br/>[server.ts]"]
end

node_creator(("Creator"))
node_ytservice["YouTube Live"]
node_kickservice["Kick API"]
node_twitchservice["Twitch API"]
node_assistant(("AI assistant"))
node_nextapp["Next.js APIs"]

node_creator -->|"uses"| node_dashboard
node_dashboard -->|"imports templates"| node_templates
node_dashboard -->|"edits tags"| node_tagmanager
node_dashboard -->|"uploads image"| node_thumbnail
node_dashboard -->|"starts tour"| node_tour
node_dashboard -->|"submits schedule"| node_schedule
node_schedule -->|"reads credentials"| node_session
node_schedule -->|"requests client"| node_youtube
node_youtube -->|"reads credentials"| node_session
node_schedule -->|"schedules and binds"| node_ytservice
node_schedule -->|"uploads thumbnail"| node_ytservice
node_schedule -.->|"syncs channel"| node_kickservice
node_schedule -.->|"syncs channel"| node_twitchservice
node_googlelogin -->|"OAuth redirect"| node_googlecallback
node_googlelogin -->|"authorizes"| node_ytservice
node_googlecallback -->|"exchanges code"| node_ytservice
node_googlecallback -->|"stores credentials"| node_session
node_kicklogin -->|"OAuth redirect"| node_kickcallback
node_kickcallback -->|"exchanges code"| node_kickservice
node_kickcallback -->|"stores credentials"| node_session
node_twitchlogin -->|"OAuth redirect"| node_twitchcallback
node_twitchcallback -->|"exchanges code"| node_twitchservice
node_twitchcallback -->|"stores credentials"| node_session
node_status -->|"reads session"| node_session
node_dashboard -->|"checks connections"| node_status
node_dashboard -->|"loads previous stream"| node_previous
node_previous -->|"requests client"| node_youtube
node_previous -->|"reads broadcast details"| node_ytservice
node_dashboard -->|"opens analytics"| node_analyticsui
node_analyticsui -->|"requests history"| node_analyticsapi
node_analyticsapi -->|"checks access"| node_session
node_analyticsapi -->|"reads log"| node_analyticsstore
node_schedule -->|"writes log"| node_analyticsstore
node_assistant -->|"invokes tools"| node_mcp
node_mcp -->|"calls APIs"| node_nextapp
node_nextapp -->|"routes schedule request"| node_schedule
node_nextapp -->|"routes log request"| node_analyticsapi
node_mcp -->|"checks template connection"| node_previous

click node_dashboard "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/dashboard/page.tsx"
click node_templates "https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/MarkdownUploader.tsx"
click node_tagmanager "https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/TagManager.tsx"
click node_thumbnail "https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/ThumbnailUploader.tsx"
click node_tour "https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/InteractiveTour.ts"
click node_schedule "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/create-stream/route.ts"
click node_youtube "https://github.com/debanjan110d/youtube-stream-automator/blob/main/lib/youtube.ts"
click node_session "https://github.com/debanjan110d/youtube-stream-automator/blob/main/lib/session.ts"
click node_googlelogin "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/login/route.ts"
click node_googlecallback "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/callback/route.ts"
click node_kicklogin "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/login/kick/route.ts"
click node_kickcallback "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/callback/kick/route.ts"
click node_twitchlogin "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/login/twitch/route.ts"
click node_twitchcallback "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/callback/twitch/route.ts"
click node_status "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/status/route.ts"
click node_previous "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/previous-stream/route.ts"
click node_analyticsapi "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/analytics/route.ts"
click node_analyticsui "https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/analytics/page.tsx"
click node_mcp "https://github.com/debanjan110d/youtube-stream-automator/blob/main/mcp/server.ts"

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_templates,node_tagmanager,node_thumbnail,node_tour toneBlue
class node_schedule,node_youtube toneAmber
class node_session,node_googlelogin,node_googlecallback,node_kicklogin,node_kickcallback,node_twitchlogin,node_twitchcallback,node_status,node_kickservice,node_twitchservice,node_nextapp toneMint
class node_previous,node_analyticsapi,node_analyticsui,node_analyticsstore toneRose
class node_mcp,node_creator,node_ytservice,node_assistant toneIndigo
```

## Components

### Creator dashboard

- [Dashboard](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Template import](https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/MarkdownUploader.tsx): `components/MarkdownUploader.tsx`
- [Tag editor](https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/TagManager.tsx): `components/TagManager.tsx`
- [Thumbnail upload](https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/ThumbnailUploader.tsx): `components/ThumbnailUploader.tsx`
- [Guided tour](https://github.com/debanjan110d/youtube-stream-automator/blob/main/components/InteractiveTour.ts): `components/InteractiveTour.ts`

### Broadcast publishing

- [Schedule API](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/create-stream/route.ts): `app/api/create-stream/route.ts`
- [YouTube client](https://github.com/debanjan110d/youtube-stream-automator/blob/main/lib/youtube.ts): `lib/youtube.ts`

### Accounts and sessions

- [Encrypted session](https://github.com/debanjan110d/youtube-stream-automator/blob/main/lib/session.ts): `lib/session.ts`
- [YouTube OAuth](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [YouTube callback](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/callback/route.ts): `app/api/auth/callback/route.ts`
- [Kick OAuth](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/login/kick/route.ts): `app/api/auth/login/kick/route.ts`
- [Kick callback](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/callback/kick/route.ts): `app/api/auth/callback/kick/route.ts`
- [Twitch OAuth](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/login/twitch/route.ts): `app/api/auth/login/twitch/route.ts`
- [Twitch callback](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/callback/twitch/route.ts): `app/api/auth/callback/twitch/route.ts`
- [Connection status](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/auth/status/route.ts): `app/api/auth/status/route.ts`

### Analytics and reuse

- [Previous stream](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/previous-stream/route.ts): `app/api/previous-stream/route.ts`
- [Analytics API](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/api/analytics/route.ts): `app/api/analytics/route.ts`
- [Analytics view](https://github.com/debanjan110d/youtube-stream-automator/blob/main/app/analytics/page.tsx): `app/analytics/page.tsx`
- **Analytics log**

### AI automation

- [MCP server](https://github.com/debanjan110d/youtube-stream-automator/blob/main/mcp/server.ts): `mcp/server.ts`

### Other components

- **Creator**
- **YouTube Live**
- **Kick API**
- **Twitch API**
- **AI assistant**
- **Next.js APIs**

## Connections

- Creator → Dashboard: uses
- Dashboard → Template import: imports templates
- Dashboard → Tag editor: edits tags
- Dashboard → Thumbnail upload: uploads image
- Dashboard → Guided tour: starts tour
- Dashboard → Schedule API: submits schedule
- Schedule API → Encrypted session: reads credentials
- Schedule API → YouTube client: requests client
- YouTube client → Encrypted session: reads credentials
- Schedule API → YouTube Live: schedules and binds
- Schedule API → YouTube Live: uploads thumbnail
- Schedule API → Kick API: syncs channel
- Schedule API → Twitch API: syncs channel
- YouTube OAuth → YouTube callback: OAuth redirect
- YouTube OAuth → YouTube Live: authorizes
- YouTube callback → YouTube Live: exchanges code
- YouTube callback → Encrypted session: stores credentials
- Kick OAuth → Kick callback: OAuth redirect
- Kick callback → Kick API: exchanges code
- Kick callback → Encrypted session: stores credentials
- Twitch OAuth → Twitch callback: OAuth redirect
- Twitch callback → Twitch API: exchanges code
- Twitch callback → Encrypted session: stores credentials
- Connection status → Encrypted session: reads session
- Dashboard → Connection status: checks connections
- Dashboard → Previous stream: loads previous stream
- Previous stream → YouTube client: requests client
- Previous stream → YouTube Live: reads broadcast details
- Dashboard → Analytics view: opens analytics
- Analytics view → Analytics API: requests history
- Analytics API → Encrypted session: checks access
- Analytics API → Analytics log: reads log
- Schedule API → Analytics log: writes log
- AI assistant → MCP server: invokes tools
- MCP server → Next.js APIs: calls APIs
- Next.js APIs → Schedule API: routes schedule request
- Next.js APIs → Analytics API: routes log request
- MCP server → Previous stream: checks template connection
