# chanukya13/crowdcut architecture

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

- Interactive diagram: https://gitdiagram.com/chanukya13/crowdcut
- Repository: https://github.com/chanukya13/crowdcut

## Overview

CROWDCUT turns audience comments into inspectable, ranked video moments and presents them in an editor-facing Studio, trailer, and export pack. Its main path is URL submission, cached or live signal ingestion, timestamp analysis and exclusion-aware ranking, then rendering. README documents the major product outputs and integrations; sampled source confirms the shared engine, external API access, cache, and some rendering functions, but omits much of the server and UI wiring.

Main entry points: [`crowdcut.py`](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py) (Analysis handler), [`index.html`](https://github.com/chanukya13/crowdcut/blob/main/index.html) (Studio UI), [`preview.html`](https://github.com/chanukya13/crowdcut/blob/main/preview.html) (Preview pages), [`cache`](https://github.com/chanukya13/crowdcut/tree/main/cache) (API cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Editor experience"]
  node_studio["Studio UI<br/>[index.html]"]
  node_server["Web server<br/>[crowdcut.py]"]
  node_preview["Preview pages<br/>[preview.html]"]
end

subgraph group_ingestion["Signal ingestion"]
  node_ingest["Signal ingestion<br/>[crowdcut.py]"]
  node_cache[("API cache")]
end

subgraph group_analysis["Moment analysis"]
  node_engine["Analysis handler<br/>[crowdcut.py]"]
  node_timestamps["Timestamp extraction<br/>[crowdcut.py]"]
  node_dedup["Author deduplication<br/>[crowdcut.py]"]
  node_ranking["Masked peak ranking<br/>[crowdcut.py]"]
end

subgraph group_outputs["Editorial outputs"]
  node_studioresult["Reaction visualization<br/>[index.html]"]
  node_trailer["Crowd Trailer<br/>[crowdcut.py]"]
  node_pack["Edit pack<br/>[crowdcut.py]"]
  node_receipts["Moment receipts<br/>[crowdcut.py]"]
  node_owned["Owned-video export<br/>[crowdcut.py]"]
end

node_editor(("Editor"))
node_youtube["YouTube Data API"]
node_sponsorblock["SponsorBlock API"]
node_dearrow["DeArrow API"]

node_editor -->|"submits video"| node_studio
node_studio -->|"requests analysis"| node_server
node_server -->|"dispatches request"| node_engine
node_engine -->|"loads signals"| node_ingest
node_ingest -->|"reads or writes"| node_cache
node_ingest -->|"fetches metadata and comments"| node_youtube
node_ingest -->|"fetches segments"| node_sponsorblock
node_ingest -->|"fetches corroboration"| node_dearrow
node_engine -->|"extracts timestamps"| node_timestamps
node_engine -->|"deduplicates authors"| node_dedup
node_engine -->|"ranks with masks"| node_ranking
node_studio -->|"shows results"| node_studioresult
node_engine -->|"selects clip windows"| node_trailer
node_engine -->|"builds exports"| node_pack
node_engine -->|"builds receipts"| node_receipts
node_engine -.->|"exports owned file"| node_owned
node_server -->|"serves preview"| node_preview

click node_studio "https://github.com/chanukya13/crowdcut/blob/main/index.html"
click node_server "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_preview "https://github.com/chanukya13/crowdcut/blob/main/preview.html"
click node_engine "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_ingest "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_cache "https://github.com/chanukya13/crowdcut/tree/main/cache"
click node_timestamps "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_dedup "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_ranking "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_studioresult "https://github.com/chanukya13/crowdcut/blob/main/index.html"
click node_trailer "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_pack "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_receipts "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py"
click node_owned "https://github.com/chanukya13/crowdcut/blob/main/crowdcut.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_server,node_preview toneBlue
class node_ingest,node_cache toneAmber
class node_engine,node_timestamps,node_dedup,node_ranking,node_youtube,node_sponsorblock,node_dearrow toneMint
class node_studioresult,node_trailer,node_pack,node_receipts,node_owned toneRose
class node_editor toneIndigo
```

## Components

### Editor experience

- [Studio UI](https://github.com/chanukya13/crowdcut/blob/main/index.html): `index.html`
- [Web server](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [Preview pages](https://github.com/chanukya13/crowdcut/blob/main/preview.html): `preview.html`

### Signal ingestion

- [Signal ingestion](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [API cache](https://github.com/chanukya13/crowdcut/tree/main/cache): `cache`

### Moment analysis

- [Analysis handler](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [Timestamp extraction](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [Author deduplication](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [Masked peak ranking](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`

### Editorial outputs

- [Reaction visualization](https://github.com/chanukya13/crowdcut/blob/main/index.html): `index.html`
- [Crowd Trailer](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [Edit pack](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [Moment receipts](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`
- [Owned-video export](https://github.com/chanukya13/crowdcut/blob/main/crowdcut.py): `crowdcut.py`

### Other components

- **Editor**
- **YouTube Data API**
- **SponsorBlock API**
- **DeArrow API**

## Connections

- Editor → Studio UI: submits video
- Studio UI → Web server: requests analysis
- Web server → Analysis handler: dispatches request
- Analysis handler → Signal ingestion: loads signals
- Signal ingestion → API cache: reads or writes
- Signal ingestion → YouTube Data API: fetches metadata and comments
- Signal ingestion → SponsorBlock API: fetches segments
- Signal ingestion → DeArrow API: fetches corroboration
- Analysis handler → Timestamp extraction: extracts timestamps
- Analysis handler → Author deduplication: deduplicates authors
- Analysis handler → Masked peak ranking: ranks with masks
- Studio UI → Reaction visualization: shows results
- Analysis handler → Crowd Trailer: selects clip windows
- Analysis handler → Edit pack: builds exports
- Analysis handler → Moment receipts: builds receipts
- Analysis handler → Owned-video export: exports owned file
- Web server → Preview pages: serves preview
