# praveen-m11/ai-video-editing architecture

> Architecture diagram of the GitHub repository praveen-m11/ai-video-editing, 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/praveen-m11/ai-video-editing
- Repository: https://github.com/praveen-m11/ai-video-editing

## Overview

IncuBrix is a prompt-driven video editor: users ingest media, create a session, submit natural-language or direct timeline edits, and export rendered video. Its core stages are media intake and transcription, instruction interpretation, deterministic timeline mutation with reversible history, and asynchronous rendering. The README documents the overall workflow and optional providers; source-index references and excerpts support selected internal calls, while unsampled route and service details are represented only at their documented subsystem level.

Main entry points: [`app/main.py`](https://github.com/praveen-m11/ai-video-editing/blob/main/app/main.py) (FastAPI Application), [`app/timeline/engine.py`](https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/engine.py) (Timeline Engine), [`app/services/video_service.py`](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/video_service.py) (Video Intake), [`app/services/instruction_service.py`](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/instruction_service.py) (Instruction Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Editing Studio"]
  node_studio["Web Studio<br/>[App.jsx]"]
  node_client_api["API Client<br/>[api.js]"]
end

subgraph group_api["API and Sessions"]
  node_application["FastAPI Application<br/>[main.py]"]
  node_video_routes["Video Routes<br/>[videos.py]"]
  node_session_routes["Session Routes<br/>[sessions.py]"]
  node_instruction_routes["Instruction Routes<br/>[instructions.py]"]
  node_subtitle_routes["Subtitle Routes<br/>[subtitles.py]"]
  node_session_service["Session Service<br/>[session_service.py]"]
  node_database[("Application Database<br/>[base.py]")]
end

subgraph group_media["Media Processing"]
  node_video_service["Video Intake<br/>[video_service.py]"]
  node_transcription["Transcription"]
  node_subtitle_service["Subtitle Service"]
  node_translation["Translation"]
end

subgraph group_timeline["Timeline Editing"]
  node_instruction_service["Instruction Service"]
  node_interpreter["Prompt Interpreter<br/>[base.py]"]
  node_timeline_engine["Timeline Engine<br/>[engine.py]"]
  node_timeline_mapping["Content Mapping<br/>[mapping.py]"]
  node_timeline_history["Edit History<br/>[history.py]"]
  node_timeline_hashing["Timeline Hashing<br/>[hashing.py]"]
end

subgraph group_render["Rendering and Storage"]
  node_job_queue["Render Jobs<br/>[queue.py]"]
  node_render_service["Render Service<br/>[render_service.py]"]
  node_ffmpeg["FFmpeg Renderer<br/>[ffmpeg.py]"]
  node_storage[("Media Storage")]
end

node_user(("Editor"))
node_openai["OpenAI Services"]
node_ffmpeg_tool["FFmpeg / FFprobe"]

node_user -->|"edits with"| node_studio
node_studio -->|"requests"| node_client_api
node_client_api -.->|"calls HTTP API"| node_application
node_application -->|"registers"| node_video_routes
node_application -->|"registers"| node_session_routes
node_application -->|"registers"| node_instruction_routes
node_application -->|"registers"| node_subtitle_routes
node_video_routes -->|"delegates intake"| node_video_service
node_video_service -->|"stores media"| node_storage
node_video_service -->|"transcribes audio"| node_transcription
node_video_service -->|"inspects media"| node_ffmpeg_tool
node_session_routes -->|"creates sessions"| node_session_service
node_session_routes -->|"submits edits"| node_instruction_service
node_instruction_routes -->|"delegates instructions"| node_instruction_service
node_instruction_service -->|"interprets prompts"| node_interpreter
node_instruction_service -->|"executes proposals"| node_timeline_engine
node_timeline_engine -->|"maps source time"| node_timeline_mapping
node_timeline_engine -->|"tracks edits"| node_timeline_history
node_timeline_engine -->|"hashes timeline"| node_timeline_hashing
node_session_service -->|"hashes initial timeline"| node_timeline_hashing
node_session_service -->|"persists sessions"| node_database
node_subtitle_routes -.->|"delegates subtitles"| node_subtitle_service
node_subtitle_service -->|"translates captions"| node_translation
node_subtitle_service -->|"uses transcript"| node_transcription
node_translation -->|"requests translation"| node_openai
node_timeline_engine -->|"translates caption text"| node_translation
node_user -->|"requests export"| node_job_queue
node_job_queue -.->|"dispatches render"| node_render_service
node_render_service -.->|"builds render"| node_ffmpeg
node_ffmpeg -->|"stores output"| node_storage
node_ffmpeg -->|"renders media"| node_ffmpeg_tool

click node_studio "https://github.com/praveen-m11/ai-video-editing/blob/main/frontend/src/App.jsx"
click node_client_api "https://github.com/praveen-m11/ai-video-editing/blob/main/frontend/src/api.js"
click node_application "https://github.com/praveen-m11/ai-video-editing/blob/main/app/main.py"
click node_video_routes "https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/videos.py"
click node_session_routes "https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/sessions.py"
click node_instruction_routes "https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/instructions.py"
click node_subtitle_routes "https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/subtitles.py"
click node_session_service "https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/session_service.py"
click node_instruction_service "https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/instruction_service.py"
click node_interpreter "https://github.com/praveen-m11/ai-video-editing/blob/main/app/interpreter/base.py"
click node_timeline_engine "https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/engine.py"
click node_timeline_mapping "https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/mapping.py"
click node_timeline_history "https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/history.py"
click node_timeline_hashing "https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/hashing.py"
click node_video_service "https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/video_service.py"
click node_transcription "https://github.com/praveen-m11/ai-video-editing/tree/main/app/transcription"
click node_subtitle_service "https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/subtitle_service.py"
click node_translation "https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/translation_service.py"
click node_job_queue "https://github.com/praveen-m11/ai-video-editing/blob/main/app/jobs/queue.py"
click node_render_service "https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/render_service.py"
click node_ffmpeg "https://github.com/praveen-m11/ai-video-editing/blob/main/app/renderer/ffmpeg.py"
click node_storage "https://github.com/praveen-m11/ai-video-editing/tree/main/app/storage"
click node_database "https://github.com/praveen-m11/ai-video-editing/blob/main/app/models/base.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_studio,node_client_api toneBlue
class node_application,node_video_routes,node_session_routes,node_instruction_routes,node_subtitle_routes,node_session_service,node_database toneAmber
class node_video_service,node_transcription,node_subtitle_service,node_translation toneMint
class node_instruction_service,node_interpreter,node_timeline_engine,node_timeline_mapping,node_timeline_history,node_timeline_hashing toneRose
class node_job_queue,node_render_service,node_ffmpeg,node_storage,node_user,node_openai,node_ffmpeg_tool toneIndigo
```

## Components

### Editing Studio

- [Web Studio](https://github.com/praveen-m11/ai-video-editing/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API Client](https://github.com/praveen-m11/ai-video-editing/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and Sessions

- [FastAPI Application](https://github.com/praveen-m11/ai-video-editing/blob/main/app/main.py): `app/main.py`
- [Video Routes](https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/videos.py): `app/api/videos.py`
- [Session Routes](https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/sessions.py): `app/api/sessions.py`
- [Instruction Routes](https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/instructions.py): `app/api/instructions.py`
- [Subtitle Routes](https://github.com/praveen-m11/ai-video-editing/blob/main/app/api/subtitles.py): `app/api/subtitles.py`
- [Session Service](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/session_service.py): `app/services/session_service.py`
- [Application Database](https://github.com/praveen-m11/ai-video-editing/blob/main/app/models/base.py): `app/models/base.py`

### Media Processing

- [Video Intake](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/video_service.py): `app/services/video_service.py`
- [Transcription](https://github.com/praveen-m11/ai-video-editing/tree/main/app/transcription): `app/transcription`
- [Subtitle Service](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/subtitle_service.py): `app/services/subtitle_service.py`
- [Translation](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/translation_service.py): `app/services/translation_service.py`

### Timeline Editing

- [Instruction Service](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/instruction_service.py): `app/services/instruction_service.py`
- [Prompt Interpreter](https://github.com/praveen-m11/ai-video-editing/blob/main/app/interpreter/base.py): `app/interpreter/base.py`
- [Timeline Engine](https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/engine.py): `app/timeline/engine.py`
- [Content Mapping](https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/mapping.py): `app/timeline/mapping.py`
- [Edit History](https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/history.py): `app/timeline/history.py`
- [Timeline Hashing](https://github.com/praveen-m11/ai-video-editing/blob/main/app/timeline/hashing.py): `app/timeline/hashing.py`

### Rendering and Storage

- [Render Jobs](https://github.com/praveen-m11/ai-video-editing/blob/main/app/jobs/queue.py): `app/jobs/queue.py`
- [Render Service](https://github.com/praveen-m11/ai-video-editing/blob/main/app/services/render_service.py): `app/services/render_service.py`
- [FFmpeg Renderer](https://github.com/praveen-m11/ai-video-editing/blob/main/app/renderer/ffmpeg.py): `app/renderer/ffmpeg.py`
- [Media Storage](https://github.com/praveen-m11/ai-video-editing/tree/main/app/storage): `app/storage`

### Other components

- **Editor**
- **OpenAI Services**
- **FFmpeg / FFprobe**

## Connections

- Editor → Web Studio: edits with
- Web Studio → API Client: requests (evidence: `frontend/src/App.jsx`)
- API Client → FastAPI Application: calls HTTP API
- FastAPI Application → Video Routes: registers (evidence: `app/main.py`)
- FastAPI Application → Session Routes: registers (evidence: `app/main.py`)
- FastAPI Application → Instruction Routes: registers (evidence: `app/main.py`)
- FastAPI Application → Subtitle Routes: registers (evidence: `app/main.py`)
- Video Routes → Video Intake: delegates intake (evidence: `app/api/videos.py`)
- Video Intake → Media Storage: stores media
- Video Intake → Transcription: transcribes audio
- Video Intake → FFmpeg / FFprobe: inspects media
- Session Routes → Session Service: creates sessions (evidence: `app/api/sessions.py`)
- Session Routes → Instruction Service: submits edits (evidence: `app/api/sessions.py`)
- Instruction Routes → Instruction Service: delegates instructions (evidence: `app/services/instruction_service.py`)
- Instruction Service → Prompt Interpreter: interprets prompts (evidence: `app/services/instruction_service.py`)
- Instruction Service → Timeline Engine: executes proposals (evidence: `app/services/instruction_service.py`)
- Timeline Engine → Content Mapping: maps source time (evidence: `app/timeline/engine.py`)
- Timeline Engine → Edit History: tracks edits (evidence: `app/timeline/engine.py`)
- Timeline Engine → Timeline Hashing: hashes timeline (evidence: `app/timeline/engine.py`)
- Session Service → Timeline Hashing: hashes initial timeline (evidence: `app/services/session_service.py`)
- Session Service → Application Database: persists sessions (evidence: `app/services/session_service.py`)
- Subtitle Routes → Subtitle Service: delegates subtitles
- Subtitle Service → Translation: translates captions (evidence: `app/services/subtitle_service.py`)
- Subtitle Service → Transcription: uses transcript (evidence: `app/services/subtitle_service.py`)
- Translation → OpenAI Services: requests translation (evidence: `app/services/translation_service.py`)
- Timeline Engine → Translation: translates caption text (evidence: `app/timeline/engine.py`)
- Editor → Render Jobs: requests export
- Render Jobs → Render Service: dispatches render
- Render Service → FFmpeg Renderer: builds render
- FFmpeg Renderer → Media Storage: stores output (evidence: `app/renderer/ffmpeg.py`)
- FFmpeg Renderer → FFmpeg / FFprobe: renders media (evidence: `app/renderer/ffmpeg.py`)
