# mehbul/chopify architecture

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

- Interactive diagram: https://gitdiagram.com/mehbul/chopify
- Repository: https://github.com/mehbul/chopify

## Overview

Chopify is a local video-to-shorts application with a browser Studio and CLI. Users submit local recordings or video URLs; projects coordinate source preparation, transcription, clip discovery and review, then render selected clips with captions and exports. The graph also preserves long-source handling, audio/visual evidence, semantic search, and reusable caption branding. Relationships are cited to README workflow descriptions or source files whose excerpts or index references support them; unsampled implementation details are omitted.

Main entry points: [`projects.py`](https://github.com/mehbul/chopify/blob/main/projects.py) (Project runner), [`dashboard.py`](https://github.com/mehbul/chopify/blob/main/dashboard.py) (Browser Studio), [`score_clips.py`](https://github.com/mehbul/chopify/blob/main/score_clips.py) (Clip selection), [`render_clips.py`](https://github.com/mehbul/chopify/blob/main/render_clips.py) (Clip renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_studio["Browser Studio<br/>[dashboard.py]"]
  node_cli["CLI<br/>[chopify.py]"]
end

subgraph group_project["Project workflow"]
  node_project_runner["Project runner<br/>[projects.py]"]
  node_project_state[("Resumable projects<br/>[projects.py]")]
  node_source_ingest["Source ingest<br/>[ingest.py]"]
  node_transcription["Transcription"]
  node_long_sections["Long-source sections<br/>[sections.py]"]
  node_media_tools["Local media tools"]
end

subgraph group_discovery["Clip discovery"]
  node_selection["Clip selection<br/>[score_clips.py]"]
  node_audio_evidence["Audio evidence<br/>[evidence.py]"]
  node_visual_analysis["Visual analysis<br/>[visual.py]"]
  node_semantic_search["Semantic search<br/>[semantic.py]"]
  node_ollama["Local Ollama"]
end

subgraph group_editing["Caption editing"]
  node_caption_editor["Caption editor<br/>[captions.py]"]
  node_caption_presets["Caption presets<br/>[branding.py]"]
end

subgraph group_export["Clip export"]
  node_clip_renderer["Clip renderer<br/>[render_clips.py]"]
end

node_creator(("Creator"))

node_creator -->|"uses"| node_studio
node_creator -->|"uses"| node_cli
node_studio -->|"queues jobs"| node_project_runner
node_cli -->|"runs projects"| node_project_runner
node_project_runner -->|"saves checkpoints"| node_project_state
node_project_runner -->|"probes sources"| node_source_ingest
node_project_runner -->|"creates transcripts"| node_transcription
node_project_runner -->|"discovers candidates"| node_selection
node_project_runner -->|"renders clips"| node_clip_renderer
node_source_ingest -->|"probes and downloads"| node_media_tools
node_transcription -->|"processes media"| node_media_tools
node_project_runner -->|"plans long-source sections"| node_long_sections
node_long_sections -->|"downloads sections"| node_source_ingest
node_selection -->|"uses audio evidence"| node_audio_evidence
node_selection -->|"uses visual evidence"| node_visual_analysis
node_visual_analysis -->|"uses source identity"| node_audio_evidence
node_selection -->|"supports semantic search"| node_semantic_search
node_semantic_search -.->|"requests embeddings"| node_ollama
node_studio -->|"edits captions"| node_caption_editor
node_studio -->|"manages brand presets"| node_caption_presets
node_clip_renderer -->|"exports SRT captions"| node_caption_editor
node_clip_renderer -->|"resolves caption style"| node_caption_presets
node_clip_renderer -->|"encodes video"| node_media_tools

click node_studio "https://github.com/mehbul/chopify/blob/main/dashboard.py"
click node_cli "https://github.com/mehbul/chopify/blob/main/chopify.py"
click node_project_runner "https://github.com/mehbul/chopify/blob/main/projects.py"
click node_project_state "https://github.com/mehbul/chopify/blob/main/projects.py"
click node_source_ingest "https://github.com/mehbul/chopify/blob/main/ingest.py"
click node_transcription "https://github.com/mehbul/chopify/blob/main/download_and_transcribe.py"
click node_long_sections "https://github.com/mehbul/chopify/blob/main/sections.py"
click node_selection "https://github.com/mehbul/chopify/blob/main/score_clips.py"
click node_audio_evidence "https://github.com/mehbul/chopify/blob/main/evidence.py"
click node_visual_analysis "https://github.com/mehbul/chopify/blob/main/visual.py"
click node_semantic_search "https://github.com/mehbul/chopify/blob/main/semantic.py"
click node_caption_editor "https://github.com/mehbul/chopify/blob/main/captions.py"
click node_caption_presets "https://github.com/mehbul/chopify/blob/main/branding.py"
click node_clip_renderer "https://github.com/mehbul/chopify/blob/main/render_clips.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_cli toneBlue
class node_project_runner,node_project_state,node_source_ingest,node_transcription,node_long_sections,node_media_tools toneAmber
class node_selection,node_audio_evidence,node_visual_analysis,node_semantic_search,node_ollama toneMint
class node_caption_editor,node_caption_presets toneRose
class node_clip_renderer,node_creator toneIndigo
```

## Components

### User interfaces

- [Browser Studio](https://github.com/mehbul/chopify/blob/main/dashboard.py): `dashboard.py`
- [CLI](https://github.com/mehbul/chopify/blob/main/chopify.py): `chopify.py`

### Project workflow

- [Project runner](https://github.com/mehbul/chopify/blob/main/projects.py): `projects.py`
- [Resumable projects](https://github.com/mehbul/chopify/blob/main/projects.py): `projects.py`
- [Source ingest](https://github.com/mehbul/chopify/blob/main/ingest.py): `ingest.py`
- [Transcription](https://github.com/mehbul/chopify/blob/main/download_and_transcribe.py): `download_and_transcribe.py`
- [Long-source sections](https://github.com/mehbul/chopify/blob/main/sections.py): `sections.py`
- **Local media tools**

### Clip discovery

- [Clip selection](https://github.com/mehbul/chopify/blob/main/score_clips.py): `score_clips.py`
- [Audio evidence](https://github.com/mehbul/chopify/blob/main/evidence.py): `evidence.py`
- [Visual analysis](https://github.com/mehbul/chopify/blob/main/visual.py): `visual.py`
- [Semantic search](https://github.com/mehbul/chopify/blob/main/semantic.py): `semantic.py`
- **Local Ollama**

### Caption editing

- [Caption editor](https://github.com/mehbul/chopify/blob/main/captions.py): `captions.py`
- [Caption presets](https://github.com/mehbul/chopify/blob/main/branding.py): `branding.py`

### Clip export

- [Clip renderer](https://github.com/mehbul/chopify/blob/main/render_clips.py): `render_clips.py`

### Other components

- **Creator**

## Connections

- Creator → Browser Studio: uses (evidence: `README.md`)
- Creator → CLI: uses (evidence: `README.md`)
- Browser Studio → Project runner: queues jobs (evidence: `dashboard.py`)
- CLI → Project runner: runs projects (evidence: `chopify.py`)
- Project runner → Resumable projects: saves checkpoints (evidence: `projects.py`)
- Project runner → Source ingest: probes sources (evidence: `projects.py`)
- Project runner → Transcription: creates transcripts (evidence: `projects.py`)
- Project runner → Clip selection: discovers candidates (evidence: `projects.py`)
- Project runner → Clip renderer: renders clips (evidence: `projects.py`)
- Source ingest → Local media tools: probes and downloads (evidence: `ingest.py`)
- Transcription → Local media tools: processes media (evidence: `download_and_transcribe.py`)
- Project runner → Long-source sections: plans long-source sections (evidence: `README.md`)
- Long-source sections → Source ingest: downloads sections (evidence: `sections.py`)
- Clip selection → Audio evidence: uses audio evidence (evidence: `score_clips.py`)
- Clip selection → Visual analysis: uses visual evidence (evidence: `score_clips.py`)
- Visual analysis → Audio evidence: uses source identity (evidence: `visual.py`)
- Clip selection → Semantic search: supports semantic search (evidence: `score_clips.py`)
- Semantic search → Local Ollama: requests embeddings (evidence: `README.md`)
- Browser Studio → Caption editor: edits captions (evidence: `README.md`)
- Browser Studio → Caption presets: manages brand presets (evidence: `dashboard.py`)
- Clip renderer → Caption editor: exports SRT captions (evidence: `render_clips.py`)
- Clip renderer → Caption presets: resolves caption style (evidence: `render_clips.py`)
- Clip renderer → Local media tools: encodes video (evidence: `README.md`)
