# abinash123hg/crack-edit architecture

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

- Interactive diagram: https://gitdiagram.com/abinash123hg/crack-edit
- Repository: https://github.com/abinash123hg/crack-edit

## Overview

CRACK EDIT is a local, CPU-first short-form video editor. The user supplies clips, music, and optional prompt, voiceover, and text; the API analyses beats, builds and validates an edit plan, renders a vertical MP4, and serves the result for download. The graph also preserves documented optional masking and audio-finishing capabilities. Edges use the excerpts, SOURCE INDEX references, or README statements; unsampled integration details are left unconnected or marked unverified.

Main entry points: [`backend/app.py`](https://github.com/abinash123hg/crack-edit/blob/main/backend/app.py) (FastAPI jobs), [`backend/core/render.py`](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/render.py) (Video rendering), [`frontend/app.js`](https://github.com/abinash123hg/crack-edit/blob/main/frontend/app.js) (Browser editor), [`backend/core/audio.py`](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/audio.py) (Beat analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_web_ui["Browser editor<br/>[app.js]"]
end

subgraph group_api["Edit API"]
  node_api_app["FastAPI jobs<br/>[app.py]"]
  node_profiles["Hardware profiles"]
end

subgraph group_planning["Analysis and planning"]
  node_beat_analysis["Beat analysis<br/>[audio.py]"]
  node_clip_prep["Clip preparation<br/>[media.py]"]
  node_edit_planner["Edit planning<br/>[planner.py]"]
end

subgraph group_rendering["Media processing"]
  node_video_renderer["Video rendering<br/>[render.py]"]
  node_speed_ramps["Speed ramps<br/>[speed_ramp.py]"]
  node_camera_effects["Camera effects<br/>[camera_fx.py]"]
  node_finished_video["Rendered MP4"]
end

subgraph group_finishing["Finishing features"]
  node_audio_finish["Audio finishing<br/>[pro_pipeline.py]"]
  node_text_templates["Text templates<br/>[text_templates.py]"]
  node_color_grading["Color grading<br/>[grade.py]"]
  node_person_masking["Person masking<br/>[masking.py]"]
end

node_user(("Editor"))
node_ffmpeg["FFmpeg tools"]

node_user -->|"selects media"| node_web_ui
node_web_ui -->|"submits edit"| node_api_app
node_api_app -->|"analyses audio"| node_beat_analysis
node_api_app -->|"prepares clips"| node_clip_prep
node_api_app -->|"builds plan"| node_edit_planner
node_api_app -->|"selects profile"| node_profiles
node_api_app -->|"renders plan"| node_video_renderer
node_api_app -->|"mixes tracks"| node_audio_finish
node_api_app -->|"lists templates"| node_text_templates
node_api_app -->|"serves download"| node_user
node_video_renderer -->|"uses ramp filter"| node_speed_ramps
node_video_renderer -->|"builds camera filter"| node_camera_effects
node_video_renderer -->|"gets profile"| node_profiles
node_beat_analysis -->|"decodes audio"| node_ffmpeg
node_video_renderer -->|"encodes video"| node_ffmpeg
node_audio_finish -->|"mixes audio"| node_ffmpeg
node_video_renderer -->|"writes MP4"| node_finished_video
node_person_masking -.->|"may mask subject"| node_video_renderer
node_color_grading -.->|"may grade footage"| node_video_renderer

click node_web_ui "https://github.com/abinash123hg/crack-edit/blob/main/frontend/app.js"
click node_api_app "https://github.com/abinash123hg/crack-edit/blob/main/backend/app.py"
click node_beat_analysis "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/audio.py"
click node_clip_prep "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/media.py"
click node_edit_planner "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/planner.py"
click node_profiles "https://github.com/abinash123hg/crack-edit/blob/main/backend/hardware_profile.py"
click node_video_renderer "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/render.py"
click node_speed_ramps "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/speed_ramp.py"
click node_camera_effects "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/camera_fx.py"
click node_audio_finish "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/pro_pipeline.py"
click node_text_templates "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/text_templates.py"
click node_color_grading "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/grade.py"
click node_person_masking "https://github.com/abinash123hg/crack-edit/blob/main/backend/core/masking.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_web_ui toneBlue
class node_api_app,node_profiles toneAmber
class node_beat_analysis,node_clip_prep,node_edit_planner toneMint
class node_video_renderer,node_speed_ramps,node_camera_effects,node_finished_video toneRose
class node_audio_finish,node_text_templates,node_color_grading,node_person_masking,node_user,node_ffmpeg toneIndigo
```

## Components

### User interface

- [Browser editor](https://github.com/abinash123hg/crack-edit/blob/main/frontend/app.js): `frontend/app.js`

### Edit API

- [FastAPI jobs](https://github.com/abinash123hg/crack-edit/blob/main/backend/app.py): `backend/app.py`
- [Hardware profiles](https://github.com/abinash123hg/crack-edit/blob/main/backend/hardware_profile.py): `backend/hardware_profile.py`

### Analysis and planning

- [Beat analysis](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/audio.py): `backend/core/audio.py`
- [Clip preparation](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/media.py): `backend/core/media.py`
- [Edit planning](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/planner.py): `backend/core/planner.py`

### Media processing

- [Video rendering](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/render.py): `backend/core/render.py`
- [Speed ramps](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/speed_ramp.py): `backend/core/speed_ramp.py`
- [Camera effects](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/camera_fx.py): `backend/core/camera_fx.py`
- **Rendered MP4**

### Finishing features

- [Audio finishing](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/pro_pipeline.py): `backend/core/pro_pipeline.py`
- [Text templates](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/text_templates.py): `backend/core/text_templates.py`
- [Color grading](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/grade.py): `backend/core/grade.py`
- [Person masking](https://github.com/abinash123hg/crack-edit/blob/main/backend/core/masking.py): `backend/core/masking.py`

### Other components

- **Editor**
- **FFmpeg tools**

## Connections

- Editor → Browser editor: selects media (evidence: `README.md`)
- Browser editor → FastAPI jobs: submits edit (evidence: `README.md`)
- FastAPI jobs → Beat analysis: analyses audio (evidence: `backend/app.py`)
- FastAPI jobs → Clip preparation: prepares clips (evidence: `backend/app.py`)
- FastAPI jobs → Edit planning: builds plan (evidence: `backend/app.py`)
- FastAPI jobs → Hardware profiles: selects profile (evidence: `backend/app.py`)
- FastAPI jobs → Video rendering: renders plan (evidence: `backend/app.py`)
- FastAPI jobs → Audio finishing: mixes tracks (evidence: `backend/app.py`)
- FastAPI jobs → Text templates: lists templates (evidence: `backend/app.py`)
- FastAPI jobs → Editor: serves download (evidence: `README.md`)
- Video rendering → Speed ramps: uses ramp filter (evidence: `backend/core/render.py`)
- Video rendering → Camera effects: builds camera filter (evidence: `backend/core/render.py`)
- Video rendering → Hardware profiles: gets profile (evidence: `backend/core/render.py`)
- Beat analysis → FFmpeg tools: decodes audio (evidence: `README.md`)
- Video rendering → FFmpeg tools: encodes video (evidence: `README.md`)
- Audio finishing → FFmpeg tools: mixes audio (evidence: `README.md`)
- Video rendering → Rendered MP4: writes MP4 (evidence: `README.md`)
- Person masking → Video rendering: may mask subject
- Color grading → Video rendering: may grade footage
