# abdullahnaveed/ai-shorts-generator architecture

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

- Interactive diagram: https://gitdiagram.com/abdullahnaveed/ai-shorts-generator
- Repository: https://github.com/abdullahnaveed/ai-shorts-generator

## Overview

AI Shorts Generator turns a topic into a captioned vertical video and platform-ready copy, through either the CLI or local review dashboard. The production orchestrator creates a structured script, matches or generates scene visuals, synthesizes narration, and assembles the final video with captions, music, and optional branding. Separate branches support stock and AI library population, reusable semantic matching, batch topics, and review. Edges reflect the README and sampled source/index references; unsampled implementation details are not inferred.

Main entry points: [`pipeline/produce.py`](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/produce.py) (Production orchestrator), [`dashboard/app.py`](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/dashboard/app.py) (Review dashboard), [`run.py`](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/run.py) (CLI commands), [`pipeline/assemble.py`](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/assemble.py) (Video assembly)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Creation and review"]
  node_cli["CLI commands<br/>[run.py]"]
  node_dashboard["Review dashboard<br/>[app.py]"]
  node_drafts["Script drafts<br/>[drafts.py]"]
  node_topics["Topic backlog<br/>[topics.txt]"]
end

subgraph group_production["Video production"]
  node_producer["Production orchestrator<br/>[produce.py]"]
  node_scriptwriter["Script generation<br/>[scriptgen.py]"]
  node_schema["Script and scene schema<br/>[models.py]"]
  node_imagegen["Scene image generation<br/>[images.py]"]
  node_motion["Scene animation<br/>[animate.py]"]
  node_voice["Voice synthesis<br/>[voice.py]"]
  node_captions["Karaoke captions<br/>[captions.py]"]
  node_assembler["Video assembly<br/>[assemble.py]"]
  node_branding["Watermark and cards<br/>[cards.py]"]
  node_outro["Branded outro<br/>[outro.py]"]
end

subgraph group_library["Reusable footage"]
  node_librarymatcher["Scene matching<br/>[match.py]"]
  node_clipcatalog[("Semantic clip catalog<br/>[library.py]")]
  node_stockfetch["Stock footage fetch<br/>[stock.py]"]
  node_librarygen["AI library generation"]
end

subgraph group_state["Project state"]
  node_video_state[("Video state and artifacts<br/>[state.py]")]
end

node_creator(("Creator"))
node_fal{{"fal.ai"}}
node_openai{{"OpenAI"}}
node_stock_services{{"Pexels / Pixabay"}}
node_whisper{{"faster-whisper"}}
node_finished_video["MP4 and platform copy"]

node_creator -->|"runs commands"| node_cli
node_creator -->|"reviews videos"| node_dashboard
node_cli -->|"starts production"| node_producer
node_cli -->|"loads backlog"| node_topics
node_cli -->|"fetches footage"| node_stockfetch
node_cli -->|"generates clips"| node_librarygen
node_cli -->|"starts server"| node_dashboard
node_dashboard -->|"requests scripts"| node_scriptwriter
node_dashboard -->|"manages drafts"| node_drafts
node_dashboard -->|"previews matches"| node_librarymatcher
node_dashboard -->|"fetches stock"| node_stockfetch
node_dashboard -->|"starts production"| node_producer
node_producer -->|"generates script"| node_scriptwriter
node_scriptwriter -->|"returns structure"| node_schema
node_producer -->|"generates scenes"| node_imagegen
node_producer -->|"matches scenes"| node_librarymatcher
node_producer -->|"stores generated clips"| node_clipcatalog
node_producer -->|"synthesizes narration"| node_voice
node_producer -->|"assembles video"| node_assembler
node_producer -->|"records progress"| node_video_state
node_imagegen -->|"generates images"| node_fal
node_motion -->|"generates motion"| node_fal
node_scriptwriter -->|"writes scripts"| node_openai
node_voice -->|"synthesizes speech"| node_openai
node_librarymatcher -->|"searches clips"| node_clipcatalog
node_stockfetch -->|"downloads footage"| node_stock_services
node_stockfetch -->|"catalogs footage"| node_clipcatalog
node_librarygen -->|"generates images"| node_imagegen
node_librarygen -->|"animates clips"| node_motion
node_librarygen -->|"catalogs clips"| node_clipcatalog
node_assembler -->|"burns captions"| node_captions
node_assembler -->|"overlays watermark"| node_branding
node_assembler -->|"stitches outro"| node_outro
node_captions -->|"aligns speech"| node_whisper
node_assembler -->|"exports MP4"| node_finished_video
node_producer -->|"writes platform copy"| node_finished_video

click node_cli "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/run.py"
click node_dashboard "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/dashboard/app.py"
click node_drafts "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/drafts.py"
click node_topics "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/data/topics.txt"
click node_producer "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/produce.py"
click node_scriptwriter "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/scriptgen.py"
click node_schema "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/models.py"
click node_imagegen "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/images.py"
click node_motion "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/animate.py"
click node_voice "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/voice.py"
click node_captions "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/captions.py"
click node_assembler "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/assemble.py"
click node_branding "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/cards.py"
click node_outro "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/outro.py"
click node_librarymatcher "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/match.py"
click node_clipcatalog "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/library.py"
click node_stockfetch "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/stock.py"
click node_librarygen "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/generate_library.py"
click node_video_state "https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/state.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_cli,node_dashboard,node_drafts,node_topics toneBlue
class node_producer,node_scriptwriter,node_schema,node_imagegen,node_motion,node_voice,node_captions,node_assembler,node_branding,node_outro toneAmber
class node_librarymatcher,node_clipcatalog,node_stockfetch,node_librarygen toneMint
class node_video_state toneRose
class node_creator,node_fal,node_openai,node_stock_services,node_whisper,node_finished_video toneIndigo
```

## Components

### Creation and review

- [CLI commands](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/run.py): `run.py`
- [Review dashboard](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/dashboard/app.py): `dashboard/app.py`
- [Script drafts](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/drafts.py): `pipeline/drafts.py`
- [Topic backlog](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/data/topics.txt): `data/topics.txt`

### Video production

- [Production orchestrator](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/produce.py): `pipeline/produce.py`
- [Script generation](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/scriptgen.py): `pipeline/scriptgen.py`
- [Script and scene schema](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/models.py): `pipeline/models.py`
- [Scene image generation](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/images.py): `pipeline/images.py`
- [Scene animation](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/animate.py): `pipeline/animate.py`
- [Voice synthesis](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/voice.py): `pipeline/voice.py`
- [Karaoke captions](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/captions.py): `pipeline/captions.py`
- [Video assembly](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/assemble.py): `pipeline/assemble.py`
- [Watermark and cards](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/cards.py): `pipeline/cards.py`
- [Branded outro](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/outro.py): `pipeline/outro.py`

### Reusable footage

- [Scene matching](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/match.py): `pipeline/match.py`
- [Semantic clip catalog](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/library.py): `pipeline/library.py`
- [Stock footage fetch](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/stock.py): `pipeline/stock.py`
- [AI library generation](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/generate_library.py): `pipeline/generate_library.py`

### Project state

- [Video state and artifacts](https://github.com/AbdullahNaveed/ai-shorts-generator/blob/main/pipeline/state.py): `pipeline/state.py`

### Other components

- **Creator**
- **fal.ai**
- **OpenAI**
- **Pexels / Pixabay**
- **faster-whisper**
- **MP4 and platform copy**

## Connections

- Creator → CLI commands: runs commands (evidence: `README.md`)
- Creator → Review dashboard: reviews videos (evidence: `README.md`)
- CLI commands → Production orchestrator: starts production (evidence: `run.py`)
- CLI commands → Topic backlog: loads backlog (evidence: `README.md`)
- CLI commands → Stock footage fetch: fetches footage (evidence: `run.py`)
- CLI commands → AI library generation: generates clips (evidence: `run.py`)
- CLI commands → Review dashboard: starts server (evidence: `run.py`)
- Review dashboard → Script generation: requests scripts (evidence: `dashboard/app.py`)
- Review dashboard → Script drafts: manages drafts (evidence: `dashboard/app.py`)
- Review dashboard → Scene matching: previews matches (evidence: `dashboard/app.py`)
- Review dashboard → Stock footage fetch: fetches stock (evidence: `dashboard/app.py`)
- Review dashboard → Production orchestrator: starts production (evidence: `dashboard/app.py`)
- Production orchestrator → Script generation: generates script (evidence: `pipeline/produce.py`)
- Script generation → Script and scene schema: returns structure (evidence: `pipeline/scriptgen.py`)
- Production orchestrator → Scene image generation: generates scenes (evidence: `pipeline/produce.py`)
- Production orchestrator → Scene matching: matches scenes (evidence: `pipeline/produce.py`)
- Production orchestrator → Semantic clip catalog: stores generated clips (evidence: `pipeline/produce.py`)
- Production orchestrator → Voice synthesis: synthesizes narration (evidence: `pipeline/produce.py`)
- Production orchestrator → Video assembly: assembles video (evidence: `pipeline/produce.py`)
- Production orchestrator → Video state and artifacts: records progress (evidence: `pipeline/produce.py`)
- Scene image generation → fal.ai: generates images (evidence: `README.md`)
- Scene animation → fal.ai: generates motion (evidence: `README.md`)
- Script generation → OpenAI: writes scripts (evidence: `README.md`)
- Voice synthesis → OpenAI: synthesizes speech (evidence: `README.md`)
- Scene matching → Semantic clip catalog: searches clips (evidence: `pipeline/match.py`)
- Stock footage fetch → Pexels / Pixabay: downloads footage (evidence: `README.md`)
- Stock footage fetch → Semantic clip catalog: catalogs footage (evidence: `pipeline/stock.py`)
- AI library generation → Scene image generation: generates images (evidence: `pipeline/generate_library.py`)
- AI library generation → Scene animation: animates clips (evidence: `pipeline/generate_library.py`)
- AI library generation → Semantic clip catalog: catalogs clips (evidence: `pipeline/generate_library.py`)
- Video assembly → Karaoke captions: burns captions (evidence: `pipeline/assemble.py`)
- Video assembly → Watermark and cards: overlays watermark (evidence: `pipeline/assemble.py`)
- Video assembly → Branded outro: stitches outro (evidence: `pipeline/assemble.py`)
- Karaoke captions → faster-whisper: aligns speech (evidence: `README.md`)
- Video assembly → MP4 and platform copy: exports MP4 (evidence: `README.md`)
- Production orchestrator → MP4 and platform copy: writes platform copy (evidence: `README.md`)
