# soluraai/wowclip architecture

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

- Interactive diagram: https://gitdiagram.com/soluraai/wowclip
- Repository: https://github.com/soluraai/wowclip

## Overview

WowClip turns a YouTube video into ranked short-form clip candidates through a two-stage AI pipeline, with a web interface for starting runs, watching progress, reviewing the gate verdict, and exploring clips. Stage 1 validates and analyzes the video, then saves artifacts; Stage 2 builds a finder payload, discovers moments, refines cuts, and curates results. The graph follows documented stage relationships and indexed imports; several Python modules were not excerpted, so their internal calls are not inferred.

Main entry points: [`pipeline/run.py`](https://github.com/soluraai/wowclip/blob/main/pipeline/run.py) (Stage 1 runner), [`pipeline/clips.py`](https://github.com/soluraai/wowclip/blob/main/pipeline/clips.py) (Stage 2 runner), [`app/page.tsx`](https://github.com/soluraai/wowclip/blob/main/app/page.tsx) (Run interface), [`pipeline/modules/llm_client.py`](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/llm_client.py) (LLM client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_home["Run interface<br/>[page.tsx]"]
  node_clipresults["Clip results<br/>[ClipResults.tsx]"]
  node_clipcard["Clip player<br/>[ClipCard.tsx]"]
  node_types["UI data types<br/>[types.ts]"]
end

subgraph group_api["Web API"]
  node_validateapi["Validation API<br/>[route.ts]"]
  node_processapi["Gate API<br/>[route.ts]"]
  node_clipsapi["History API<br/>[route.ts]"]
  node_run_events["Event recording<br/>[run-events.ts]"]
  node_urlvalidate["YouTube URL parser<br/>[youtube.ts]"]
end

subgraph group_ingest["Video analysis"]
  node_run["Stage 1 runner<br/>[run.py]"]
  node_validate["Video validation"]
  node_captions["Captions and heatmap"]
  node_comments["Audience comments"]
  node_analytics["Transcript analytics"]
  node_bouncer["Gate verdict<br/>[step_05_bouncer.py]"]
  node_transcript["Transcript processing<br/>[transcript.py]"]
end

subgraph group_clips["Clip generation"]
  node_clipsrun["Stage 2 runner<br/>[clips.py]"]
  node_payload["Finder payload<br/>[step_06_payload.py]"]
  node_finders["Category finders<br/>[step_07_finders.py]"]
  node_refiner["Clip refinement<br/>[step_08_refiner.py]"]
  node_curator["Clip curation<br/>[step_09_curator.py]"]
end

subgraph group_shared["Pipeline services"]
  node_store[("Run artifacts<br/>[store.py]")]
  node_events["Pipeline events<br/>[events.py]"]
  node_llmclient["LLM client<br/>[llm_client.py]"]
end

node_viewer(("Video editor"))
node_youtube(("YouTube"))
node_llm(("LLM provider"))

node_viewer -->|"submits video"| node_home
node_home -->|"validates link"| node_validateapi
node_validateapi -->|"parses link"| node_urlvalidate
node_home -->|"starts run"| node_processapi
node_processapi -->|"revalidates link"| node_urlvalidate
node_processapi -->|"spawns stage 1"| node_run
node_processapi -->|"records events"| node_run_events
node_home -->|"loads saved runs"| node_clipsapi
node_clipsapi -->|"reads artifacts"| node_store
node_clipsapi -->|"reads events"| node_run_events
node_home -->|"renders results"| node_clipresults
node_clipresults -->|"renders clips"| node_clipcard
node_clipcard -->|"plays source video"| node_youtube
node_run -->|"runs validation"| node_validate
node_run -->|"runs caption stage"| node_captions
node_run -->|"runs comment stage"| node_comments
node_run -->|"runs analytics"| node_analytics
node_run -->|"runs gate"| node_bouncer
node_run -->|"processes transcript"| node_transcript
node_run -->|"saves run artifacts"| node_store
node_run -->|"emits progress"| node_events
node_captions -->|"fetches captions"| node_youtube
node_comments -->|"fetches comments"| node_youtube
node_comments -->|"triages comments"| node_llmclient
node_bouncer -.->|"requests verdict"| node_llmclient
node_run -.->|"hands off for stage 2"| node_clipsrun
node_clipsrun -->|"reads saved inputs"| node_store
node_clipsrun -->|"builds payload"| node_payload
node_clipsrun -->|"runs finders"| node_finders
node_clipsrun -->|"refines candidates"| node_refiner
node_clipsrun -->|"curates results"| node_curator
node_finders -.->|"requests candidates"| node_llmclient
node_refiner -->|"requests cut refinement"| node_llmclient
node_clipsrun -->|"saves clip artifacts"| node_store
node_clipsrun -->|"emits progress"| node_events
node_llmclient -.->|"calls model"| node_llm

click node_home "https://github.com/soluraai/wowclip/blob/main/app/page.tsx"
click node_clipresults "https://github.com/soluraai/wowclip/blob/main/app/components/ClipResults.tsx"
click node_clipcard "https://github.com/soluraai/wowclip/blob/main/app/components/ClipCard.tsx"
click node_types "https://github.com/soluraai/wowclip/blob/main/app/lib/types.ts"
click node_validateapi "https://github.com/soluraai/wowclip/blob/main/app/api/validate/route.ts"
click node_processapi "https://github.com/soluraai/wowclip/blob/main/app/api/process/route.ts"
click node_clipsapi "https://github.com/soluraai/wowclip/blob/main/app/api/clips/route.ts"
click node_run_events "https://github.com/soluraai/wowclip/blob/main/app/lib/run-events.ts"
click node_urlvalidate "https://github.com/soluraai/wowclip/blob/main/app/lib/youtube.ts"
click node_run "https://github.com/soluraai/wowclip/blob/main/pipeline/run.py"
click node_validate "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_01_validate.py"
click node_captions "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_02_captions.py"
click node_comments "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_03_comments.py"
click node_analytics "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_04_analytics.py"
click node_bouncer "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_05_bouncer.py"
click node_transcript "https://github.com/soluraai/wowclip/blob/main/pipeline/transcript.py"
click node_clipsrun "https://github.com/soluraai/wowclip/blob/main/pipeline/clips.py"
click node_payload "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_06_payload.py"
click node_finders "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_07_finders.py"
click node_refiner "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_08_refiner.py"
click node_curator "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_09_curator.py"
click node_store "https://github.com/soluraai/wowclip/blob/main/pipeline/store.py"
click node_events "https://github.com/soluraai/wowclip/blob/main/pipeline/events.py"
click node_llmclient "https://github.com/soluraai/wowclip/blob/main/pipeline/modules/llm_client.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_home,node_clipresults,node_clipcard,node_types toneBlue
class node_validateapi,node_processapi,node_clipsapi,node_run_events,node_urlvalidate toneAmber
class node_run,node_validate,node_captions,node_comments,node_analytics,node_bouncer,node_transcript toneMint
class node_clipsrun,node_payload,node_finders,node_refiner,node_curator toneRose
class node_store,node_events,node_llmclient,node_viewer,node_youtube,node_llm toneIndigo
```

## Components

### Web experience

- [Run interface](https://github.com/soluraai/wowclip/blob/main/app/page.tsx): `app/page.tsx`
- [Clip results](https://github.com/soluraai/wowclip/blob/main/app/components/ClipResults.tsx): `app/components/ClipResults.tsx`
- [Clip player](https://github.com/soluraai/wowclip/blob/main/app/components/ClipCard.tsx): `app/components/ClipCard.tsx`
- [UI data types](https://github.com/soluraai/wowclip/blob/main/app/lib/types.ts): `app/lib/types.ts`

### Web API

- [Validation API](https://github.com/soluraai/wowclip/blob/main/app/api/validate/route.ts): `app/api/validate/route.ts`
- [Gate API](https://github.com/soluraai/wowclip/blob/main/app/api/process/route.ts): `app/api/process/route.ts`
- [History API](https://github.com/soluraai/wowclip/blob/main/app/api/clips/route.ts): `app/api/clips/route.ts`
- [Event recording](https://github.com/soluraai/wowclip/blob/main/app/lib/run-events.ts): `app/lib/run-events.ts`
- [YouTube URL parser](https://github.com/soluraai/wowclip/blob/main/app/lib/youtube.ts): `app/lib/youtube.ts`

### Video analysis

- [Stage 1 runner](https://github.com/soluraai/wowclip/blob/main/pipeline/run.py): `pipeline/run.py`
- [Video validation](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_01_validate.py): `pipeline/modules/step_01_validate.py`
- [Captions and heatmap](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_02_captions.py): `pipeline/modules/step_02_captions.py`
- [Audience comments](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_03_comments.py): `pipeline/modules/step_03_comments.py`
- [Transcript analytics](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_04_analytics.py): `pipeline/modules/step_04_analytics.py`
- [Gate verdict](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_05_bouncer.py): `pipeline/modules/step_05_bouncer.py`
- [Transcript processing](https://github.com/soluraai/wowclip/blob/main/pipeline/transcript.py): `pipeline/transcript.py`

### Clip generation

- [Stage 2 runner](https://github.com/soluraai/wowclip/blob/main/pipeline/clips.py): `pipeline/clips.py`
- [Finder payload](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_06_payload.py): `pipeline/modules/step_06_payload.py`
- [Category finders](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_07_finders.py): `pipeline/modules/step_07_finders.py`
- [Clip refinement](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_08_refiner.py): `pipeline/modules/step_08_refiner.py`
- [Clip curation](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/step_09_curator.py): `pipeline/modules/step_09_curator.py`

### Pipeline services

- [Run artifacts](https://github.com/soluraai/wowclip/blob/main/pipeline/store.py): `pipeline/store.py`
- [Pipeline events](https://github.com/soluraai/wowclip/blob/main/pipeline/events.py): `pipeline/events.py`
- [LLM client](https://github.com/soluraai/wowclip/blob/main/pipeline/modules/llm_client.py): `pipeline/modules/llm_client.py`

### Other components

- **Video editor**
- **YouTube**
- **LLM provider**

## Connections

- Video editor → Run interface: submits video (evidence: `README.md`)
- Run interface → Validation API: validates link (evidence: `README.md`)
- Validation API → YouTube URL parser: parses link (evidence: `app/api/validate/route.ts`)
- Run interface → Gate API: starts run (evidence: `README.md`)
- Gate API → YouTube URL parser: revalidates link (evidence: `app/api/process/route.ts`)
- Gate API → Stage 1 runner: spawns stage 1 (evidence: `README.md`)
- Gate API → Event recording: records events (evidence: `app/api/process/route.ts`)
- Run interface → History API: loads saved runs (evidence: `README.md`)
- History API → Run artifacts: reads artifacts (evidence: `app/api/clips/route.ts`)
- History API → Event recording: reads events (evidence: `app/api/clips/route.ts`)
- Run interface → Clip results: renders results (evidence: `app/page.tsx`)
- Clip results → Clip player: renders clips (evidence: `app/components/ClipResults.tsx`)
- Clip player → YouTube: plays source video (evidence: `app/components/ClipCard.tsx`)
- Stage 1 runner → Video validation: runs validation (evidence: `pipeline/run.py`)
- Stage 1 runner → Captions and heatmap: runs caption stage (evidence: `README.md`)
- Stage 1 runner → Audience comments: runs comment stage (evidence: `README.md`)
- Stage 1 runner → Transcript analytics: runs analytics (evidence: `README.md`)
- Stage 1 runner → Gate verdict: runs gate (evidence: `pipeline/run.py`)
- Stage 1 runner → Transcript processing: processes transcript (evidence: `pipeline/run.py`)
- Stage 1 runner → Run artifacts: saves run artifacts (evidence: `pipeline/run.py`)
- Stage 1 runner → Pipeline events: emits progress (evidence: `pipeline/run.py`)
- Captions and heatmap → YouTube: fetches captions (evidence: `README.md`)
- Audience comments → YouTube: fetches comments (evidence: `pipeline/modules/step_03_comments.py`)
- Audience comments → LLM client: triages comments (evidence: `pipeline/modules/step_03_comments.py`)
- Gate verdict → LLM client: requests verdict
- Stage 1 runner → Stage 2 runner: hands off for stage 2
- Stage 2 runner → Run artifacts: reads saved inputs (evidence: `pipeline/clips.py`)
- Stage 2 runner → Finder payload: builds payload (evidence: `README.md`)
- Stage 2 runner → Category finders: runs finders (evidence: `README.md`)
- Stage 2 runner → Clip refinement: refines candidates (evidence: `README.md`)
- Stage 2 runner → Clip curation: curates results (evidence: `README.md`)
- Category finders → LLM client: requests candidates
- Clip refinement → LLM client: requests cut refinement
- Stage 2 runner → Run artifacts: saves clip artifacts (evidence: `pipeline/clips.py`)
- Stage 2 runner → Pipeline events: emits progress (evidence: `README.md`)
- LLM client → LLM provider: calls model
