# punitdixit/moneyprinterturbo architecture

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

- Interactive diagram: https://gitdiagram.com/punitdixit/moneyprinterturbo
- Repository: https://github.com/punitdixit/moneyprinterturbo

## Overview

MoneyPrinterTurbo is an AI short-video creation application exposed through a WebUI and HTTP API. A user submits a topic or keywords; the application generates a script, finds or generates visual material, creates narration and subtitles, adds music, and assembles a finished video. The graph preserves those documented capabilities and the task/state and provider layers. Some service implementations were not sampled, so their workflow links rely on the README or SOURCE INDEX rather than inspection of their internals.

Main entry points: [`app/services/task.py`](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/task.py) (Video task), [`app/controllers/v1/video.py`](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/v1/video.py) (Video API), [`app/router.py`](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/router.py) (HTTP router), [`app/services/llm.py`](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/llm.py) (Script and copy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_webui["WebUI<br/>[Main.py]"]
  node_api["Video API<br/>[video.py]"]
  node_llm_api["LLM API<br/>[llm.py]"]
  node_router["HTTP router<br/>[router.py]"]
end

subgraph group_orchestration["Task orchestration"]
  node_task_manager["Task manager<br/>[base_manager.py]"]
  node_redis_manager["Redis queue<br/>[redis_manager.py]"]
  node_task_pipeline["Video task<br/>[task.py]"]
  node_task_state[("Task state<br/>[state.py]")]
end

subgraph group_creation["Content generation"]
  node_llm["Script and copy<br/>[llm.py]"]
  node_materials["Visual materials<br/>[material.py]"]
  node_provider_adapters["Video providers<br/>[ofox.py]"]
  node_voice["Voice generation<br/>[voice.py]"]
  node_subtitles["Subtitle generation<br/>[subtitle.py]"]
  node_music["Background music<br/>[bgm.py]"]
end

subgraph group_assembly["Media assembly"]
  node_video["Video assembly<br/>[video.py]"]
  node_artifacts["Task artifacts<br/>[task_artifacts.py]"]
end

subgraph group_platform["Runtime services"]
  node_config[("Configuration<br/>[config.py]")]
  node_schemas["Request and task models<br/>[schema.py]"]
  node_file_tools["Media utilities<br/>[utils.py]"]
end

node_user(("Creator"))

node_user -->|"submits topic"| node_webui
node_user -->|"calls API"| node_router
node_webui -->|"starts creation"| node_task_pipeline
node_router -->|"routes video"| node_api
node_router -->|"routes LLM"| node_llm_api
node_api -->|"queues task"| node_task_manager
node_api -->|"dispatches task"| node_task_pipeline
node_task_manager -.->|"uses queue"| node_redis_manager
node_redis_manager -->|"updates state"| node_task_state
node_task_pipeline -->|"records progress"| node_task_state
node_llm_api -->|"requests generation"| node_llm
node_task_pipeline -->|"generates script"| node_llm
node_task_pipeline -->|"finds material"| node_materials
node_materials -->|"uses providers"| node_provider_adapters
node_task_pipeline -->|"generates narration"| node_voice
node_task_pipeline -->|"creates subtitles"| node_subtitles
node_task_pipeline -->|"adds music"| node_music
node_task_pipeline -->|"assembles video"| node_video
node_task_pipeline -->|"stores outputs"| node_artifacts
node_video -.->|"uses media tools"| node_file_tools
node_api -->|"validates requests"| node_schemas
node_task_pipeline -->|"reads settings"| node_config
node_llm -->|"reads provider settings"| node_config

click node_webui "https://github.com/punitdixit/moneyprinterturbo/blob/main/webui/Main.py"
click node_api "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/v1/video.py"
click node_llm_api "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/v1/llm.py"
click node_router "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/router.py"
click node_task_manager "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/manager/base_manager.py"
click node_redis_manager "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/manager/redis_manager.py"
click node_task_pipeline "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/task.py"
click node_task_state "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/state.py"
click node_llm "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/llm.py"
click node_materials "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/material.py"
click node_provider_adapters "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/ofox.py"
click node_voice "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/voice.py"
click node_subtitles "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/subtitle.py"
click node_music "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/bgm.py"
click node_video "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/video.py"
click node_artifacts "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/task_artifacts.py"
click node_config "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/config/config.py"
click node_schemas "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/models/schema.py"
click node_file_tools "https://github.com/punitdixit/moneyprinterturbo/blob/main/app/utils/utils.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_webui,node_api,node_llm_api,node_router toneBlue
class node_task_manager,node_redis_manager,node_task_pipeline,node_task_state toneAmber
class node_llm,node_materials,node_provider_adapters,node_voice,node_subtitles,node_music toneMint
class node_video,node_artifacts toneRose
class node_config,node_schemas,node_file_tools,node_user toneIndigo
```

## Components

### User interfaces

- [WebUI](https://github.com/punitdixit/moneyprinterturbo/blob/main/webui/Main.py): `webui/Main.py`
- [Video API](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/v1/video.py): `app/controllers/v1/video.py`
- [LLM API](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/v1/llm.py): `app/controllers/v1/llm.py`
- [HTTP router](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/router.py): `app/router.py`

### Task orchestration

- [Task manager](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/manager/base_manager.py): `app/controllers/manager/base_manager.py`
- [Redis queue](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/controllers/manager/redis_manager.py): `app/controllers/manager/redis_manager.py`
- [Video task](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/task.py): `app/services/task.py`
- [Task state](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/state.py): `app/services/state.py`

### Content generation

- [Script and copy](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/llm.py): `app/services/llm.py`
- [Visual materials](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/material.py): `app/services/material.py`
- [Video providers](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/ofox.py): `app/services/ofox.py`
- [Voice generation](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/voice.py): `app/services/voice.py`
- [Subtitle generation](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/subtitle.py): `app/services/subtitle.py`
- [Background music](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/bgm.py): `app/services/bgm.py`

### Media assembly

- [Video assembly](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/video.py): `app/services/video.py`
- [Task artifacts](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/services/task_artifacts.py): `app/services/task_artifacts.py`

### Runtime services

- [Configuration](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/config/config.py): `app/config/config.py`
- [Request and task models](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/models/schema.py): `app/models/schema.py`
- [Media utilities](https://github.com/punitdixit/moneyprinterturbo/blob/main/app/utils/utils.py): `app/utils/utils.py`

### Other components

- **Creator**

## Connections

- Creator → WebUI: submits topic (evidence: `README.md`)
- Creator → HTTP router: calls API (evidence: `README.md`)
- WebUI → Video task: starts creation (evidence: `webui/Main.py`)
- HTTP router → Video API: routes video (evidence: `app/router.py`)
- HTTP router → LLM API: routes LLM (evidence: `app/router.py`)
- Video API → Task manager: queues task (evidence: `app/controllers/v1/video.py`)
- Video API → Video task: dispatches task (evidence: `app/controllers/v1/video.py`)
- Task manager → Redis queue: uses queue (evidence: `app/controllers/manager/redis_manager.py`)
- Redis queue → Task state: updates state (evidence: `app/controllers/manager/redis_manager.py`)
- Video task → Task state: records progress (evidence: `app/services/task.py`)
- LLM API → Script and copy: requests generation (evidence: `app/controllers/v1/llm.py`)
- Video task → Script and copy: generates script (evidence: `app/services/task.py`)
- Video task → Visual materials: finds material (evidence: `app/services/task.py`)
- Visual materials → Video providers: uses providers (evidence: `app/services/material.py`)
- Video task → Voice generation: generates narration (evidence: `app/services/task.py`)
- Video task → Subtitle generation: creates subtitles (evidence: `app/services/task.py`)
- Video task → Background music: adds music (evidence: `app/services/task.py`)
- Video task → Video assembly: assembles video (evidence: `app/services/task.py`)
- Video task → Task artifacts: stores outputs (evidence: `app/services/task.py`)
- Video assembly → Media utilities: uses media tools
- Video API → Request and task models: validates requests (evidence: `app/controllers/v1/video.py`)
- Video task → Configuration: reads settings (evidence: `app/services/task.py`)
- Script and copy → Configuration: reads provider settings (evidence: `app/services/llm.py`)
