# lukaszliniewicz/pandrator architecture

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

- Interactive diagram: https://gitdiagram.com/lukaszliniewicz/pandrator
- Repository: https://github.com/lukaszliniewicz/pandrator

## Overview

Pandrator is a browser-based workspace for turning documents and media into audiobooks, transcripts, translated subtitles, voiceovers, and reviewed video edits. A user selects a workflow in the web interface; the API coordinates session-backed processing and results are reviewed and exported. Major branches also include temporary quick transcription and MCP-assisted preparation, validation, and resumable work. Manager handles installation and runtime operations. The README documents product flows; the source excerpts show API, MCP, and manager entry points, but not the full processing call graph, so undocumented links are omitted.

Main entry points: [`pandrator/web/api_routes.py`](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/api_routes.py) (HTTP API), [`pandrator_mcp/server.py`](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_mcp/server.py) (MCP tools), [`pandrator/logic/tts_handler.py`](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/tts_handler.py) (Audiobook generation), [`pandrator/web/workflow_export.py`](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/workflow_export.py) (Review and export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Browser workspace"]
  node_webui["Web interface<br/>[app.DpXEFSz1.js]"]
  node_api["HTTP API<br/>[api_routes.py]"]
  node_sessions[("Sessions and state<br/>[models.py]")]
end

subgraph group_media["Media workflows"]
  node_cleaning["Document preparation<br/>[pipeline.py]"]
  node_audiobook["Audiobook generation<br/>[tts_handler.py]"]
  node_dubbing["Subtitle and dubbing<br/>[workflow.py]"]
  node_quicktranscribe["Quick transcription"]
  node_mediaedit["Recording edits"]
  node_export["Review and export<br/>[workflow_export.py]"]
end

subgraph group_speech["Speech services"]
  node_speechengines["Speech engines"]
end

subgraph group_automation["Automation"]
  node_mcp["MCP tools<br/>[server.py]"]
end

subgraph group_runtime["Runtime management"]
  node_managerapi["Manager API<br/>[app.py]"]
  node_managerapp["Manager operations<br/>[application.py]"]
  node_operationengine[("Operation journal<br/>[engine.py]")]
end

node_user(("User"))
node_agent(("MCP-capable agent"))

node_user -->|"chooses workflow"| node_webui
node_webui -.->|"sends requests"| node_api
node_api -->|"reads and writes"| node_sessions
node_api -.->|"prepares documents"| node_cleaning
node_api -.->|"starts generation"| node_audiobook
node_api -.->|"starts subtitle work"| node_dubbing
node_api -->|"offers transcription"| node_quicktranscribe
node_api -->|"offers editing"| node_mediaedit
node_audiobook -->|"uses providers"| node_speechengines
node_user -->|"requests assistance"| node_mcp
node_mcp -->|"coordinates work"| node_agent
node_agent -->|"submits results"| node_mcp
node_mcp -.->|"tracks work"| node_api
node_user -->|"sets up runtime"| node_managerapi
node_managerapi -->|"delegates operations"| node_managerapp
node_managerapp -.->|"queues tasks"| node_operationengine
node_audiobook -->|"produces audio"| node_export
node_dubbing -->|"produces subtitles and media"| node_export
node_mediaedit -->|"renders reviewed edit"| node_export

click node_webui "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/static/_app/immutable/entry/app.DpXEFSz1.js"
click node_api "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/api_routes.py"
click node_sessions "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/models.py"
click node_cleaning "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/source_cleaning/pipeline.py"
click node_audiobook "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/tts_handler.py"
click node_dubbing "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/dubbing/workflow.py"
click node_quicktranscribe "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/quick_transcription_routes.py"
click node_mediaedit "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/media_edit_routes.py"
click node_export "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/workflow_export.py"
click node_speechengines "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/tts_provider_profiles.py"
click node_mcp "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_mcp/server.py"
click node_managerapi "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_manager/api/app.py"
click node_managerapp "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_manager/application.py"
click node_operationengine "https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_manager/operations/engine.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_sessions,node_user toneBlue
class node_cleaning,node_audiobook,node_dubbing,node_quicktranscribe,node_mediaedit,node_export toneAmber
class node_speechengines toneMint
class node_mcp toneRose
class node_managerapi,node_managerapp,node_operationengine,node_agent toneIndigo
```

## Components

### Browser workspace

- [Web interface](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/static/_app/immutable/entry/app.DpXEFSz1.js): `pandrator/web/static/_app/immutable/entry/app.DpXEFSz1.js`
- [HTTP API](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/api_routes.py): `pandrator/web/api_routes.py`
- [Sessions and state](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/models.py): `pandrator/web/models.py`

### Media workflows

- [Document preparation](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/source_cleaning/pipeline.py): `pandrator/logic/source_cleaning/pipeline.py`
- [Audiobook generation](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/tts_handler.py): `pandrator/logic/tts_handler.py`
- [Subtitle and dubbing](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/dubbing/workflow.py): `pandrator/logic/dubbing/workflow.py`
- [Quick transcription](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/quick_transcription_routes.py): `pandrator/web/quick_transcription_routes.py`
- [Recording edits](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/media_edit_routes.py): `pandrator/web/media_edit_routes.py`
- [Review and export](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/web/workflow_export.py): `pandrator/web/workflow_export.py`

### Speech services

- [Speech engines](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator/logic/tts_provider_profiles.py): `pandrator/logic/tts_provider_profiles.py`

### Automation

- [MCP tools](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_mcp/server.py): `pandrator_mcp/server.py`

### Runtime management

- [Manager API](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_manager/api/app.py): `pandrator_manager/api/app.py`
- [Manager operations](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_manager/application.py): `pandrator_manager/application.py`
- [Operation journal](https://github.com/lukaszliniewicz/pandrator/blob/main/pandrator_manager/operations/engine.py): `pandrator_manager/operations/engine.py`

### Other components

- **User**
- **MCP-capable agent**

## Connections

- User → Web interface: chooses workflow (evidence: `README.md`)
- Web interface → HTTP API: sends requests
- HTTP API → Sessions and state: reads and writes (evidence: `pandrator/web/api_routes.py`)
- HTTP API → Document preparation: prepares documents
- HTTP API → Audiobook generation: starts generation
- HTTP API → Subtitle and dubbing: starts subtitle work
- HTTP API → Quick transcription: offers transcription (evidence: `README.md`)
- HTTP API → Recording edits: offers editing (evidence: `README.md`)
- Audiobook generation → Speech engines: uses providers (evidence: `pandrator/logic/tts_handler.py`)
- User → MCP tools: requests assistance (evidence: `README.md`)
- MCP tools → MCP-capable agent: coordinates work (evidence: `README.md`)
- MCP-capable agent → MCP tools: submits results (evidence: `README.md`)
- MCP tools → HTTP API: tracks work
- User → Manager API: sets up runtime (evidence: `README.md`)
- Manager API → Manager operations: delegates operations (evidence: `pandrator_manager/api/app.py`)
- Manager operations → Operation journal: queues tasks
- Audiobook generation → Review and export: produces audio (evidence: `README.md`)
- Subtitle and dubbing → Review and export: produces subtitles and media (evidence: `README.md`)
- Recording edits → Review and export: renders reviewed edit (evidence: `README.md`)
