# haziqahmedqasmi/peakcut architecture

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

- Interactive diagram: https://gitdiagram.com/haziqahmedqasmi/peakcut
- Repository: https://github.com/haziqahmedqasmi/peakcut

## Overview

PeakCut turns uploaded or linked videos—and optionally live streams—into captioned vertical clips, then lets creators review and post them. The primary workflow runs from the dashboard through queued video processing, transcription, AI moment selection and rendering. Separate branches cover live clipping, creator workspaces, social-account posting, and multi-user administration. The graph follows README-described capabilities and indexed source references; several subsystem internals were not sampled, so their undocumented call relationships are omitted.

Main entry points: [`studio/server.py`](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/server.py) (Web Server), [`studio/jobs.py`](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/jobs.py) (Video Jobs), [`studio/live.py`](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/live.py) (Live Sessions), [`studio/posting.py`](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/posting.py) (Clip Posting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_server["Web Server<br/>[server.py]"]
  node_auth["Sign-in<br/>[auth.py]"]
  node_database[("Account Database<br/>[db.py]")]
  node_storage["User Storage<br/>[storage.py]"]
  node_usage["AI Usage<br/>[usage.py]"]
  node_notices["Activity Notices<br/>[notices.py]"]
  node_admin["Administration<br/>[admin.py]"]
  node_updates["Update Notices<br/>[updates.py]"]
end

subgraph group_clips["Clip Production"]
  node_jobs["Video Jobs<br/>[jobs.py]"]
  node_media["Video Intake<br/>[media.py]"]
  node_transcribe["Speech Transcription<br/>[transcribe.py]"]
  node_brain["Moment Selection<br/>[brain.py]"]
  node_ai["AI Providers<br/>[ai.py]"]
  node_render["Clip Rendering<br/>[render.py]"]
  node_load["Capacity Control<br/>[load.py]"]
end

subgraph group_live["Live Clipping"]
  node_live["Live Sessions<br/>[live.py]"]
end

subgraph group_workspace["Creator Workspaces"]
  node_creator["Creator Workspaces<br/>[creators.py]"]
  node_profiles["Stream Profiles<br/>[profiles.py]"]
end

subgraph group_platform["Accounts and Posting"]
  node_social["Social Accounts<br/>[accounts.py]"]
  node_posting["Clip Posting<br/>[posting.py]"]
end

node_browser(("Dashboard<br/>[index.html]"))
node_source{{"Video Platforms"}}
node_social_platforms{{"Social Platforms"}}

node_browser -->|"uses dashboard"| node_server
node_server -->|"routes sign-in"| node_auth
node_auth -->|"stores sessions"| node_database
node_server -->|"routes clip work"| node_jobs
node_jobs -->|"gets video"| node_media
node_media -->|"downloads video"| node_source
node_jobs -->|"transcribes audio"| node_transcribe
node_jobs -->|"selects moments"| node_brain
node_brain -->|"requests analysis"| node_ai
node_jobs -->|"renders clips"| node_render
node_jobs -->|"queues by capacity"| node_load
node_jobs -->|"logs clip activity"| node_creator
node_live -->|"transcribes stream"| node_transcribe
node_live -->|"selects highlights"| node_brain
node_live -->|"uses workspace settings"| node_creator
node_live -->|"uses stream profiles"| node_profiles
node_server -->|"routes live sessions"| node_live
node_server -->|"routes workspaces"| node_creator
node_server -->|"routes account connections"| node_social
node_server -->|"routes posting"| node_posting
node_posting -->|"uses connected accounts"| node_social
node_posting -->|"publishes clips"| node_social_platforms
node_server -->|"serves storage settings"| node_storage
node_server -->|"serves usage view"| node_usage
node_server -->|"serves activity"| node_notices
node_server -->|"serves admin dashboard"| node_admin
node_server -->|"shows update notices"| node_updates

click node_browser "https://github.com/haziqahmedqasmi/peakcut/blob/main/web/index.html"
click node_server "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/server.py"
click node_auth "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/auth.py"
click node_database "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/db.py"
click node_storage "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/storage.py"
click node_jobs "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/jobs.py"
click node_media "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/media.py"
click node_transcribe "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/transcribe.py"
click node_brain "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/brain.py"
click node_ai "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/ai.py"
click node_render "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/render.py"
click node_load "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/load.py"
click node_live "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/live.py"
click node_creator "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/creators.py"
click node_profiles "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/profiles.py"
click node_social "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/accounts.py"
click node_posting "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/posting.py"
click node_usage "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/usage.py"
click node_notices "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/notices.py"
click node_admin "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/admin.py"
click node_updates "https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/updates.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_server,node_auth,node_database,node_storage,node_usage,node_notices,node_admin,node_updates toneBlue
class node_jobs,node_media,node_transcribe,node_brain,node_ai,node_render,node_load toneAmber
class node_live toneMint
class node_creator,node_profiles toneRose
class node_social,node_posting,node_source,node_social_platforms toneIndigo
class node_browser toneTeal
```

## Components

### Application

- [Web Server](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/server.py): `studio/server.py`
- [Sign-in](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/auth.py): `studio/auth.py`
- [Account Database](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/db.py): `studio/db.py`
- [User Storage](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/storage.py): `studio/storage.py`
- [AI Usage](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/usage.py): `studio/usage.py`
- [Activity Notices](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/notices.py): `studio/notices.py`
- [Administration](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/admin.py): `studio/admin.py`
- [Update Notices](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/updates.py): `studio/updates.py`

### Clip Production

- [Video Jobs](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/jobs.py): `studio/jobs.py`
- [Video Intake](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/media.py): `studio/media.py`
- [Speech Transcription](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/transcribe.py): `studio/transcribe.py`
- [Moment Selection](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/brain.py): `studio/brain.py`
- [AI Providers](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/ai.py): `studio/ai.py`
- [Clip Rendering](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/render.py): `studio/render.py`
- [Capacity Control](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/load.py): `studio/load.py`

### Live Clipping

- [Live Sessions](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/live.py): `studio/live.py`

### Creator Workspaces

- [Creator Workspaces](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/creators.py): `studio/creators.py`
- [Stream Profiles](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/profiles.py): `studio/profiles.py`

### Accounts and Posting

- [Social Accounts](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/accounts.py): `studio/accounts.py`
- [Clip Posting](https://github.com/haziqahmedqasmi/peakcut/blob/main/studio/posting.py): `studio/posting.py`

### Other components

- [Dashboard](https://github.com/haziqahmedqasmi/peakcut/blob/main/web/index.html): `web/index.html`
- **Video Platforms**
- **Social Platforms**

## Connections

- Dashboard → Web Server: uses dashboard (evidence: `README.md`)
- Web Server → Sign-in: routes sign-in (evidence: `studio/server.py`)
- Sign-in → Account Database: stores sessions (evidence: `studio/auth.py`)
- Web Server → Video Jobs: routes clip work (evidence: `studio/server.py`)
- Video Jobs → Video Intake: gets video (evidence: `studio/jobs.py`)
- Video Intake → Video Platforms: downloads video (evidence: `README.md`)
- Video Jobs → Speech Transcription: transcribes audio (evidence: `studio/jobs.py`)
- Video Jobs → Moment Selection: selects moments (evidence: `studio/jobs.py`)
- Moment Selection → AI Providers: requests analysis (evidence: `studio/brain.py`)
- Video Jobs → Clip Rendering: renders clips (evidence: `studio/jobs.py`)
- Video Jobs → Capacity Control: queues by capacity (evidence: `studio/jobs.py`)
- Video Jobs → Creator Workspaces: logs clip activity (evidence: `studio/jobs.py`)
- Live Sessions → Speech Transcription: transcribes stream (evidence: `studio/live.py`)
- Live Sessions → Moment Selection: selects highlights (evidence: `studio/live.py`)
- Live Sessions → Creator Workspaces: uses workspace settings (evidence: `studio/live.py`)
- Live Sessions → Stream Profiles: uses stream profiles (evidence: `studio/live.py`)
- Web Server → Live Sessions: routes live sessions (evidence: `studio/server.py`)
- Web Server → Creator Workspaces: routes workspaces (evidence: `studio/server.py`)
- Web Server → Social Accounts: routes account connections (evidence: `studio/server.py`)
- Web Server → Clip Posting: routes posting (evidence: `studio/server.py`)
- Clip Posting → Social Accounts: uses connected accounts (evidence: `README.md`)
- Clip Posting → Social Platforms: publishes clips (evidence: `README.md`)
- Web Server → User Storage: serves storage settings (evidence: `studio/server.py`)
- Web Server → AI Usage: serves usage view (evidence: `studio/server.py`)
- Web Server → Activity Notices: serves activity (evidence: `studio/server.py`)
- Web Server → Administration: serves admin dashboard (evidence: `README.md`)
- Web Server → Update Notices: shows update notices (evidence: `README.md`)
