# aify688/ai-auto-editor architecture

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

- Interactive diagram: https://gitdiagram.com/aify688/ai-auto-editor
- Repository: https://github.com/aify688/ai-auto-editor

## Overview

QuickCut is a local video-editing application: the React editor manages projects and an EDL, while a FastAPI backend accepts media and runs background jobs for analysis, edit generation, and rendering. The result is previewed and exported as video. The graph includes documented music, captions, templates, text-to-video, and timeline-editing capabilities. Some subsystem links are grounded only in README descriptions or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`backend/services/pipeline.py`](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/pipeline.py) (Edit pipeline), [`frontend/src/store/project.ts`](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/store/project.ts) (Project state), [`backend/main.py`](https://github.com/aify688/ai-auto-editor/blob/main/backend/main.py) (FastAPI application), [`backend/api/media.py`](https://github.com/aify688/ai-auto-editor/blob/main/backend/api/media.py) (Media routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Editor interface"]
  node_app["Editor shell<br/>[App.tsx]"]
  node_ai_edit["AI edit controls<br/>[AiEditPanel.tsx]"]
  node_preview["Preview player<br/>[PreviewPanel.tsx]"]
  node_timeline["Timeline editor<br/>[Timeline.tsx]"]
  node_project_store["Project state<br/>[project.ts]"]
  node_job_hook["Job polling<br/>[useJobs.ts]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API and jobs"]
  node_api_server["FastAPI application<br/>[main.py]"]
  node_job_routes["Job routes<br/>[jobs.py]"]
  node_media_routes["Media routes<br/>[media.py]"]
  node_job_worker["Background jobs<br/>[jobs.py]"]
end

subgraph group_services["Media and editing"]
  node_pipeline["Edit pipeline<br/>[pipeline.py]"]
  node_media["Media ingest<br/>[media.py]"]
  node_analysis["Media analysis<br/>[analysis.py]"]
  node_editing["Edit planning<br/>[editing.py]"]
  node_instructions["Instruction planning<br/>[instructions.py]"]
  node_music["Music services<br/>[music_reco.py]"]
  node_captions["Speech captions<br/>[textvideo.py]"]
  node_templates["Edit templates<br/>[templates.py]"]
end

subgraph group_render["Rendering engine"]
  node_renderer["EDL renderer<br/>[rendering.py]"]
  node_engine["FFmpeg engine<br/>[engine.py]"]
  node_ffmpeg["FFmpeg tools<br/>[ffmpeg_ops.py]"]
end

subgraph group_storage["Project persistence"]
  node_projects["Project service<br/>[projects.py]"]
  node_database[("SQLite database<br/>[db.py]")]
end

node_user(("Editor user"))
node_ffmpeg_service{{"FFmpeg executable"}}

node_user -->|"edits project"| node_app
node_app -->|"loads project"| node_project_store
node_ai_edit -->|"starts generation"| node_job_hook
node_preview -->|"reads project"| node_project_store
node_timeline -.->|"edits timeline"| node_project_store
node_job_hook -->|"polls jobs"| node_api_client
node_project_store -->|"loads and saves"| node_api_client
node_api_client -->|"sends requests"| node_api_server
node_api_server -->|"registers routes"| node_job_routes
node_api_server -->|"registers routes"| node_media_routes
node_job_routes -->|"dispatches jobs"| node_job_worker
node_media_routes -->|"uses media service"| node_media
node_media_routes -->|"dispatches processing"| node_job_worker
node_job_worker -.->|"runs job handlers"| node_pipeline
node_pipeline -->|"uses media assets"| node_media
node_pipeline -->|"analyzes media"| node_analysis
node_pipeline -->|"plans edit"| node_editing
node_pipeline -->|"applies instructions"| node_instructions
node_pipeline -->|"selects music"| node_music
node_pipeline -->|"transcribes speech"| node_captions
node_pipeline -.->|"uses templates"| node_templates
node_pipeline -->|"renders EDL"| node_renderer
node_pipeline -->|"updates renders"| node_projects
node_projects -->|"reads and writes"| node_database
node_renderer -->|"renders timeline"| node_engine
node_engine -->|"runs media operations"| node_ffmpeg
node_ffmpeg -->|"executes commands"| node_ffmpeg_service

click node_app "https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/App.tsx"
click node_ai_edit "https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/components/ai-editor/AiEditPanel.tsx"
click node_preview "https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/components/preview/PreviewPanel.tsx"
click node_timeline "https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/components/timeline/Timeline.tsx"
click node_project_store "https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/store/project.ts"
click node_job_hook "https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/hooks/useJobs.ts"
click node_api_client "https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/services/api.ts"
click node_api_server "https://github.com/aify688/ai-auto-editor/blob/main/backend/main.py"
click node_job_routes "https://github.com/aify688/ai-auto-editor/blob/main/backend/api/jobs.py"
click node_media_routes "https://github.com/aify688/ai-auto-editor/blob/main/backend/api/media.py"
click node_job_worker "https://github.com/aify688/ai-auto-editor/blob/main/backend/workers/jobs.py"
click node_pipeline "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/pipeline.py"
click node_media "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/media.py"
click node_analysis "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/analysis.py"
click node_editing "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/editing.py"
click node_instructions "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/instructions.py"
click node_music "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/music_reco.py"
click node_captions "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/textvideo.py"
click node_templates "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/templates.py"
click node_projects "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/projects.py"
click node_database "https://github.com/aify688/ai-auto-editor/blob/main/backend/db.py"
click node_renderer "https://github.com/aify688/ai-auto-editor/blob/main/backend/services/rendering.py"
click node_engine "https://github.com/aify688/ai-auto-editor/blob/main/video_editor/engine.py"
click node_ffmpeg "https://github.com/aify688/ai-auto-editor/blob/main/video_editor/ffmpeg_ops.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_app,node_ai_edit,node_preview,node_timeline,node_project_store,node_job_hook,node_api_client,node_user toneBlue
class node_api_server,node_job_routes,node_media_routes,node_job_worker toneAmber
class node_pipeline,node_media,node_analysis,node_editing,node_instructions,node_music,node_captions,node_templates toneMint
class node_renderer,node_engine,node_ffmpeg toneRose
class node_projects,node_database,node_ffmpeg_service toneIndigo
```

## Components

### Editor interface

- [Editor shell](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [AI edit controls](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/components/ai-editor/AiEditPanel.tsx): `frontend/src/components/ai-editor/AiEditPanel.tsx`
- [Preview player](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/components/preview/PreviewPanel.tsx): `frontend/src/components/preview/PreviewPanel.tsx`
- [Timeline editor](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/components/timeline/Timeline.tsx): `frontend/src/components/timeline/Timeline.tsx`
- [Project state](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/store/project.ts): `frontend/src/store/project.ts`
- [Job polling](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/hooks/useJobs.ts): `frontend/src/hooks/useJobs.ts`
- [API client](https://github.com/aify688/ai-auto-editor/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and jobs

- [FastAPI application](https://github.com/aify688/ai-auto-editor/blob/main/backend/main.py): `backend/main.py`
- [Job routes](https://github.com/aify688/ai-auto-editor/blob/main/backend/api/jobs.py): `backend/api/jobs.py`
- [Media routes](https://github.com/aify688/ai-auto-editor/blob/main/backend/api/media.py): `backend/api/media.py`
- [Background jobs](https://github.com/aify688/ai-auto-editor/blob/main/backend/workers/jobs.py): `backend/workers/jobs.py`

### Media and editing

- [Edit pipeline](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/pipeline.py): `backend/services/pipeline.py`
- [Media ingest](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/media.py): `backend/services/media.py`
- [Media analysis](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/analysis.py): `backend/services/analysis.py`
- [Edit planning](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/editing.py): `backend/services/editing.py`
- [Instruction planning](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/instructions.py): `backend/services/instructions.py`
- [Music services](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/music_reco.py): `backend/services/music_reco.py`
- [Speech captions](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/textvideo.py): `backend/services/textvideo.py`
- [Edit templates](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/templates.py): `backend/services/templates.py`

### Rendering engine

- [EDL renderer](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/rendering.py): `backend/services/rendering.py`
- [FFmpeg engine](https://github.com/aify688/ai-auto-editor/blob/main/video_editor/engine.py): `video_editor/engine.py`
- [FFmpeg tools](https://github.com/aify688/ai-auto-editor/blob/main/video_editor/ffmpeg_ops.py): `video_editor/ffmpeg_ops.py`

### Project persistence

- [Project service](https://github.com/aify688/ai-auto-editor/blob/main/backend/services/projects.py): `backend/services/projects.py`
- [SQLite database](https://github.com/aify688/ai-auto-editor/blob/main/backend/db.py): `backend/db.py`

### Other components

- **Editor user**
- **FFmpeg executable**

## Connections

- Editor user → Editor shell: edits project
- Editor shell → Project state: loads project (evidence: `frontend/src/App.tsx`)
- AI edit controls → Job polling: starts generation (evidence: `frontend/src/components/ai-editor/AiEditPanel.tsx`)
- Preview player → Project state: reads project (evidence: `frontend/src/components/preview/PreviewPanel.tsx`)
- Timeline editor → Project state: edits timeline
- Job polling → API client: polls jobs (evidence: `frontend/src/hooks/useJobs.ts`)
- Project state → API client: loads and saves (evidence: `frontend/src/store/project.ts`)
- API client → FastAPI application: sends requests
- FastAPI application → Job routes: registers routes (evidence: `backend/main.py`)
- FastAPI application → Media routes: registers routes (evidence: `backend/main.py`)
- Job routes → Background jobs: dispatches jobs (evidence: `backend/api/jobs.py`)
- Media routes → Media ingest: uses media service (evidence: `backend/api/media.py`)
- Media routes → Background jobs: dispatches processing (evidence: `backend/api/media.py`)
- Background jobs → Edit pipeline: runs job handlers (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Media ingest: uses media assets (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Media analysis: analyzes media (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Edit planning: plans edit (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Instruction planning: applies instructions (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Music services: selects music (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Speech captions: transcribes speech (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Edit templates: uses templates (evidence: `backend/services/pipeline.py`)
- Edit pipeline → EDL renderer: renders EDL (evidence: `backend/services/pipeline.py`)
- Edit pipeline → Project service: updates renders (evidence: `backend/services/pipeline.py`)
- Project service → SQLite database: reads and writes (evidence: `backend/services/projects.py`)
- EDL renderer → FFmpeg engine: renders timeline (evidence: `backend/services/rendering.py`)
- FFmpeg engine → FFmpeg tools: runs media operations (evidence: `video_editor/engine.py`)
- FFmpeg tools → FFmpeg executable: executes commands (evidence: `video_editor/ffmpeg_ops.py`)
