# abdallarashed7/moneyprinterturbo architecture

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

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

## Overview

MoneyPrinterTurbo turns a topic or script into short-form video, with API, CLI, and WebUI entry points. The main workflow validates generation parameters, queues and tracks a task, then coordinates script generation, stock/local materials, speech, subtitles, music, rendering, and optional social publishing. The graph also preserves the documented batch, provider, and publishing capabilities. Some subsystem links are based on the task module’s indexed references and README; unsampled implementation details are not inferred beyond those references.

Main entry points: [`app/services/task.py`](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/task.py) (Generation task), [`app/controllers/v1/video.py`](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/controllers/v1/video.py) (HTTP API), [`app/controllers/manager/base_manager.py`](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/controllers/manager/base_manager.py) (Task manager), [`app/controllers/manager/redis_manager.py`](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/controllers/manager/redis_manager.py) (Redis queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_webui["WebUI<br/>[Main.py]"]
  node_api["HTTP API<br/>[video.py]"]
  node_cli["CLI<br/>[cli.py]"]
  node_router["API routing<br/>[router.py]"]
end

subgraph group_control["Task control"]
  node_manager["Task manager<br/>[base_manager.py]"]
  node_redis_manager["Redis queue<br/>[redis_manager.py]"]
  node_task["Generation task<br/>[task.py]"]
  node_state[("Task state<br/>[state.py]")]
end

subgraph group_creation["Video creation"]
  node_llm["Script and metadata<br/>[llm.py]"]
  node_materials["Video materials<br/>[material.py]"]
  node_voice["Voice synthesis<br/>[voice.py]"]
  node_subtitle["Subtitle generation<br/>[subtitle.py]"]
  node_bgm["Music selection<br/>[bgm.py]"]
  node_music_gen["Music generation<br/>[sonilo.py]"]
  node_eleven_music["ElevenLabs music"]
  node_render["Video rendering<br/>[video.py]"]
end

subgraph group_support["Shared services"]
  node_params["Request schemas<br/>[schema.py]"]
  node_config["Runtime config<br/>[config.py]"]
  node_providers["Model providers<br/>[llm_provider.py]"]
  node_artifacts["Task artifacts<br/>[task_artifacts.py]"]
  node_security["File path security<br/>[file_security.py]"]
end

subgraph group_delivery["Publishing"]
  node_crosspost["Cross-platform posting<br/>[upload_post.py]"]
end

node_user(("Creator"))
node_external_ai{{"AI and media services"}}
node_social{{"Social platforms"}}

node_user -->|"configures"| node_webui
node_user -->|"requests generation"| node_api
node_user -->|"runs generation"| node_cli
node_webui -->|"starts tasks"| node_task
node_cli -->|"starts tasks"| node_task
node_api -->|"registered by"| node_router
node_api -->|"validates"| node_params
node_api -->|"submits task"| node_manager
node_manager -->|"executes"| node_task
node_manager -.->|"uses queue implementation"| node_redis_manager
node_redis_manager -->|"dispatches"| node_task
node_redis_manager -->|"patches failed task"| node_state
node_task -->|"records progress"| node_state
node_task -->|"requests script"| node_llm
node_llm -->|"selects provider"| node_providers
node_llm -->|"calls model service"| node_external_ai
node_task -->|"gets footage"| node_materials
node_task -->|"synthesizes narration"| node_voice
node_task -->|"generates subtitles"| node_subtitle
node_task -->|"selects background music"| node_bgm
node_task -->|"generates music"| node_music_gen
node_task -->|"generates music"| node_eleven_music
node_task -->|"assembles video"| node_render
node_render -->|"mixes audio"| node_bgm
node_render -.->|"writes outputs"| node_artifacts
node_materials -.->|"fetches media"| node_external_ai
node_task -->|"starts publishing"| node_crosspost
node_crosspost -->|"uploads video"| node_social
node_api -->|"checks file paths"| node_security

click node_webui "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/webui/Main.py"
click node_api "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/controllers/v1/video.py"
click node_cli "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/cli.py"
click node_router "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/router.py"
click node_params "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/models/schema.py"
click node_manager "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/controllers/manager/base_manager.py"
click node_redis_manager "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/controllers/manager/redis_manager.py"
click node_task "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/task.py"
click node_state "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/state.py"
click node_config "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/config/config.py"
click node_llm "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/llm.py"
click node_providers "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/models/llm_provider.py"
click node_materials "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/material.py"
click node_voice "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/voice.py"
click node_subtitle "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/subtitle.py"
click node_bgm "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/bgm.py"
click node_music_gen "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/sonilo.py"
click node_eleven_music "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/elevenlabs_music.py"
click node_render "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/video.py"
click node_artifacts "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/task_artifacts.py"
click node_security "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/utils/file_security.py"
click node_crosspost "https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/upload_post.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_cli,node_router toneBlue
class node_manager,node_redis_manager,node_task,node_state toneAmber
class node_llm,node_materials,node_voice,node_subtitle,node_bgm,node_music_gen,node_eleven_music,node_render toneMint
class node_params,node_config,node_providers,node_artifacts,node_security toneRose
class node_crosspost,node_user,node_external_ai,node_social toneIndigo
```

## Components

### User interfaces

- [WebUI](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/webui/Main.py): `webui/Main.py`
- [HTTP API](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/controllers/v1/video.py): `app/controllers/v1/video.py`
- [CLI](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/cli.py): `cli.py`
- [API routing](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/router.py): `app/router.py`

### Task control

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

### Video creation

- [Script and metadata](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/llm.py): `app/services/llm.py`
- [Video materials](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/material.py): `app/services/material.py`
- [Voice synthesis](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/voice.py): `app/services/voice.py`
- [Subtitle generation](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/subtitle.py): `app/services/subtitle.py`
- [Music selection](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/bgm.py): `app/services/bgm.py`
- [Music generation](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/sonilo.py): `app/services/sonilo.py`
- [ElevenLabs music](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/elevenlabs_music.py): `app/services/elevenlabs_music.py`
- [Video rendering](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/video.py): `app/services/video.py`

### Shared services

- [Request schemas](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/models/schema.py): `app/models/schema.py`
- [Runtime config](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/config/config.py): `app/config/config.py`
- [Model providers](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/models/llm_provider.py): `app/models/llm_provider.py`
- [Task artifacts](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/task_artifacts.py): `app/services/task_artifacts.py`
- [File path security](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/utils/file_security.py): `app/utils/file_security.py`

### Publishing

- [Cross-platform posting](https://github.com/abdallarashed7/moneyprinterturbo/blob/main/app/services/upload_post.py): `app/services/upload_post.py`

### Other components

- **Creator**
- **AI and media services**
- **Social platforms**

## Connections

- Creator → WebUI: configures (evidence: `README.md`)
- Creator → HTTP API: requests generation (evidence: `README.md`)
- Creator → CLI: runs generation (evidence: `README.md`)
- WebUI → Generation task: starts tasks (evidence: `webui/Main.py`)
- CLI → Generation task: starts tasks (evidence: `cli.py`)
- HTTP API → API routing: registered by (evidence: `app/router.py`)
- HTTP API → Request schemas: validates (evidence: `app/controllers/v1/video.py`)
- HTTP API → Task manager: submits task (evidence: `app/controllers/v1/video.py`)
- Task manager → Generation task: executes (evidence: `app/controllers/manager/base_manager.py`)
- Task manager → Redis queue: uses queue implementation (evidence: `app/controllers/manager/redis_manager.py`)
- Redis queue → Generation task: dispatches (evidence: `app/controllers/manager/redis_manager.py`)
- Redis queue → Task state: patches failed task (evidence: `app/controllers/manager/redis_manager.py`)
- Generation task → Task state: records progress (evidence: `app/services/task.py`)
- Generation task → Script and metadata: requests script (evidence: `app/services/task.py`)
- Script and metadata → Model providers: selects provider (evidence: `app/services/llm.py`)
- Script and metadata → AI and media services: calls model service (evidence: `app/services/llm.py`)
- Generation task → Video materials: gets footage (evidence: `app/services/task.py`)
- Generation task → Voice synthesis: synthesizes narration (evidence: `app/services/task.py`)
- Generation task → Subtitle generation: generates subtitles (evidence: `app/services/task.py`)
- Generation task → Music selection: selects background music (evidence: `app/services/task.py`)
- Generation task → Music generation: generates music (evidence: `app/services/task.py`)
- Generation task → ElevenLabs music: generates music (evidence: `app/services/task.py`)
- Generation task → Video rendering: assembles video (evidence: `app/services/task.py`)
- Video rendering → Music selection: mixes audio (evidence: `app/services/video.py`)
- Video rendering → Task artifacts: writes outputs
- Video materials → AI and media services: fetches media
- Generation task → Cross-platform posting: starts publishing (evidence: `app/services/task.py`)
- Cross-platform posting → Social platforms: uploads video
- HTTP API → File path security: checks file paths (evidence: `app/controllers/v1/video.py`)
