# harry0703/moneyprinterturbo architecture

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

- Interactive diagram: https://gitdiagram.com/harry0703/moneyprinterturbo
- Repository: https://github.com/harry0703/moneyprinterturbo
- Video tour (about a minute): https://gitdiagram.com/harry0703/moneyprinterturbo/video

## Overview

MoneyPrinterTurbo is an AI short-video creation application with WebUI and HTTP API entry points. Users provide a topic or keywords and receive generated scripts, matched media, subtitles, background music, and a composed video. The graph shows the documented creation stages and the task-management layer; several service connections are documented only at product level because their implementation excerpts were not provided.

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

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_webui["WebUI<br/>[Main.py]"]
  node_api["HTTP API<br/>[router.py]"]
end

subgraph group_runtime["API and Tasks"]
  node_video_api["Video Endpoints<br/>[video.py]"]
  node_llm_api["LLM Endpoints<br/>[llm.py]"]
  node_manager["Task Manager<br/>[base_manager.py]"]
  node_redis_manager[("Redis Queue<br/>[redis_manager.py]")]
  node_task["Task Orchestrator<br/>[task.py]"]
end

subgraph group_creation["Creation Services"]
  node_llm["Script and LLM<br/>[llm.py]"]
  node_material["Media Matching<br/>[material.py]"]
  node_voice["Voice Generation<br/>[voice.py]"]
  node_subtitle["Subtitle Processing<br/>[subtitle.py]"]
  node_bgm["Background Music<br/>[bgm.py]"]
  node_video["Video Composition<br/>[video.py]"]
end

subgraph group_support["Configuration and State"]
  node_config["Runtime Configuration<br/>[config.py]"]
  node_state["Task State<br/>[state.py]"]
end

node_creator(("Creator"))
node_external_models{{"AI Model Providers"}}
node_media_sources{{"Media Sources"}}

node_creator -->|"creates with"| node_webui
node_creator -->|"submits requests"| node_api
node_webui -.->|"starts creation"| node_task
node_api -->|"routes requests"| node_video_api
node_api -->|"routes requests"| node_llm_api
node_video_api -->|"queues work"| node_manager
node_video_api -->|"starts task"| node_task
node_llm_api -->|"requests text"| node_llm
node_manager -->|"executes work"| node_task
node_redis_manager -->|"implements queue"| node_manager
node_task -->|"generates script"| node_llm
node_task -->|"matches media"| node_material
node_task -.->|"generates narration"| node_voice
node_task -.->|"creates subtitles"| node_subtitle
node_task -->|"adds music"| node_bgm
node_task -.->|"composes video"| node_video
node_llm -->|"calls model"| node_external_models
node_material -.->|"fetches media"| node_media_sources
node_task -.->|"records progress"| node_state
node_llm -->|"reads settings"| node_config
node_video_api -->|"updates task state"| node_state

click node_webui "https://github.com/harry0703/moneyprinterturbo/blob/main/webui/Main.py"
click node_api "https://github.com/harry0703/moneyprinterturbo/blob/main/app/router.py"
click node_video_api "https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/v1/video.py"
click node_llm_api "https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/v1/llm.py"
click node_manager "https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/manager/base_manager.py"
click node_redis_manager "https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/manager/redis_manager.py"
click node_task "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/task.py"
click node_llm "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/llm.py"
click node_material "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/material.py"
click node_voice "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/voice.py"
click node_subtitle "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/subtitle.py"
click node_bgm "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/bgm.py"
click node_video "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/video.py"
click node_config "https://github.com/harry0703/moneyprinterturbo/blob/main/app/config/config.py"
click node_state "https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/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_webui,node_api toneBlue
class node_video_api,node_llm_api,node_manager,node_redis_manager,node_task toneAmber
class node_llm,node_material,node_voice,node_subtitle,node_bgm,node_video toneMint
class node_config,node_state toneRose
class node_creator,node_external_models,node_media_sources toneIndigo
```

## Components

### User Interfaces

- [WebUI](https://github.com/harry0703/moneyprinterturbo/blob/main/webui/Main.py): `webui/Main.py`
- [HTTP API](https://github.com/harry0703/moneyprinterturbo/blob/main/app/router.py): `app/router.py`

### API and Tasks

- [Video Endpoints](https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/v1/video.py): `app/controllers/v1/video.py`
- [LLM Endpoints](https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/v1/llm.py): `app/controllers/v1/llm.py`
- [Task Manager](https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/manager/base_manager.py): `app/controllers/manager/base_manager.py`
- [Redis Queue](https://github.com/harry0703/moneyprinterturbo/blob/main/app/controllers/manager/redis_manager.py): `app/controllers/manager/redis_manager.py`
- [Task Orchestrator](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/task.py): `app/services/task.py`

### Creation Services

- [Script and LLM](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/llm.py): `app/services/llm.py`
- [Media Matching](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/material.py): `app/services/material.py`
- [Voice Generation](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/voice.py): `app/services/voice.py`
- [Subtitle Processing](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/subtitle.py): `app/services/subtitle.py`
- [Background Music](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/bgm.py): `app/services/bgm.py`
- [Video Composition](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/video.py): `app/services/video.py`

### Configuration and State

- [Runtime Configuration](https://github.com/harry0703/moneyprinterturbo/blob/main/app/config/config.py): `app/config/config.py`
- [Task State](https://github.com/harry0703/moneyprinterturbo/blob/main/app/services/state.py): `app/services/state.py`

### Other components

- **Creator**
- **AI Model Providers**
- **Media Sources**

## Connections

- Creator → WebUI: creates with (evidence: `README.md`)
- Creator → HTTP API: submits requests (evidence: `README.md`)
- WebUI → Task Orchestrator: starts creation (evidence: `webui/Main.py`)
- HTTP API → Video Endpoints: routes requests (evidence: `app/router.py`)
- HTTP API → LLM Endpoints: routes requests (evidence: `app/router.py`)
- Video Endpoints → Task Manager: queues work (evidence: `app/controllers/v1/video.py`)
- Video Endpoints → Task Orchestrator: starts task (evidence: `app/controllers/v1/video.py`)
- LLM Endpoints → Script and LLM: requests text (evidence: `app/controllers/v1/llm.py`)
- Task Manager → Task Orchestrator: executes work (evidence: `app/controllers/manager/base_manager.py`)
- Redis Queue → Task Manager: implements queue (evidence: `app/controllers/manager/redis_manager.py`)
- Task Orchestrator → Script and LLM: generates script (evidence: `app/services/task.py`)
- Task Orchestrator → Media Matching: matches media (evidence: `app/services/task.py`)
- Task Orchestrator → Voice Generation: generates narration (evidence: `app/services/task.py`)
- Task Orchestrator → Subtitle Processing: creates subtitles (evidence: `app/services/task.py`)
- Task Orchestrator → Background Music: adds music (evidence: `app/services/task.py`)
- Task Orchestrator → Video Composition: composes video (evidence: `app/services/task.py`)
- Script and LLM → AI Model Providers: calls model (evidence: `app/services/llm.py`)
- Media Matching → Media Sources: fetches media
- Task Orchestrator → Task State: records progress (evidence: `app/services/task.py`)
- Script and LLM → Runtime Configuration: reads settings (evidence: `app/services/llm.py`)
- Video Endpoints → Task State: updates task state (evidence: `app/controllers/v1/video.py`)
