# kleniobraz/opussb architecture

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

- Interactive diagram: https://gitdiagram.com/kleniobraz/opussb
- Repository: https://github.com/kleniobraz/opussb

## Overview

OpusSB is a video-clipping and podcast-production application with a web interface and a Flask backend. Its user-facing capabilities include video upload, clip review/editing, caption review, projects, and podcast workflows. The sampled source shows backend job processing, caption-review calls, and GPU reframe behavior; the file tree also documents frontend and podcast feature areas. Several podcast and frontend-to-backend relationships are not visible in the excerpts, so they are represented without speculative connections.

Main entry points: [`caption_reviewer.py`](https://github.com/kleniobraz/opussb/blob/master/caption_reviewer.py) (Caption review pipeline), [`db.py`](https://github.com/kleniobraz/opussb/blob/master/db.py) (Application database), [`app.py`](https://github.com/kleniobraz/opussb/blob/master/app.py) (Flask application), [`gpu_reframe/handler.py`](https://github.com/kleniobraz/opussb/blob/master/gpu_reframe/handler.py) (Reframe worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_upload["Video upload<br/>[upload-console.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_projects["Projects<br/>[page.tsx]"]
  node_project_detail["Project detail<br/>[page.tsx]"]
  node_editor["Clip editor<br/>[clip-editor.tsx]"]
  node_caption_ui["Caption reviewer UI<br/>[page.tsx]"]
  node_podcast_ui["Podcast UI<br/>[page.tsx]"]
  node_api_client["Frontend API client<br/>[api.ts]"]
end

subgraph group_video["Video processing"]
  node_flask["Flask application<br/>[app.py]"]
  node_processor["Clip processor<br/>[processor.py]"]
  node_reframer["Reframe worker<br/>[handler.py]"]
  node_reframe_core["Reframe algorithms<br/>[reframe_core.py]"]
  node_captions["Caption handling<br/>[captions.py]"]
  node_caption_review["Caption review pipeline"]
  node_caption_sampler["Caption frame sampling<br/>[caption_sampler.py]"]
end

subgraph group_podcast["Podcast production"]
  node_podcast_ingest["Podcast ingest<br/>[podcast_ingest.py]"]
  node_podcast_cut["Podcast intro cut<br/>[podcast_cut.py]"]
  node_podcast_compose["Podcast assembly<br/>[podcast_compose.py]"]
  node_podcast_audio["Podcast audio extraction<br/>[podcast_audio.py]"]
end

subgraph group_services["Shared services"]
  node_db[("Application database<br/>[db.py]")]
  node_s3["S3 storage<br/>[s3_client.py]"]
  node_anthropic["Claude client"]
  node_config["Configuration<br/>[config.py]"]
  node_inflight["In-flight work tracking<br/>[em_voo.py]"]
end

node_user(("User"))

node_user -.->|"uploads video"| node_upload
node_flask -->|"starts job"| node_processor
node_flask -->|"deletes session"| node_db
node_reframer -->|"generates keyframes"| node_reframe_core
node_caption_review -->|"estimates budget"| node_caption_sampler
node_caption_review -->|"requests review"| node_anthropic
node_caption_review -->|"reads glossary"| node_db
node_podcast_ingest -->|"updates job"| node_db

click node_upload "https://github.com/kleniobraz/opussb/blob/master/frontend/components/upload-console.tsx"
click node_dashboard "https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/painel/page.tsx"
click node_projects "https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/projetos/page.tsx"
click node_project_detail "https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/projetos/%5Bid%5D/page.tsx"
click node_editor "https://github.com/kleniobraz/opussb/blob/master/frontend/components/editor/clip-editor.tsx"
click node_caption_ui "https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/revisor/page.tsx"
click node_podcast_ui "https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/podcast/page.tsx"
click node_api_client "https://github.com/kleniobraz/opussb/blob/master/frontend/lib/api.ts"
click node_flask "https://github.com/kleniobraz/opussb/blob/master/app.py"
click node_processor "https://github.com/kleniobraz/opussb/blob/master/processor.py"
click node_reframer "https://github.com/kleniobraz/opussb/blob/master/gpu_reframe/handler.py"
click node_reframe_core "https://github.com/kleniobraz/opussb/blob/master/reframe_core.py"
click node_captions "https://github.com/kleniobraz/opussb/blob/master/captions.py"
click node_caption_review "https://github.com/kleniobraz/opussb/blob/master/caption_reviewer.py"
click node_caption_sampler "https://github.com/kleniobraz/opussb/blob/master/caption_sampler.py"
click node_podcast_ingest "https://github.com/kleniobraz/opussb/blob/master/podcast_ingest.py"
click node_podcast_cut "https://github.com/kleniobraz/opussb/blob/master/podcast_cut.py"
click node_podcast_compose "https://github.com/kleniobraz/opussb/blob/master/podcast_compose.py"
click node_podcast_audio "https://github.com/kleniobraz/opussb/blob/master/podcast_audio.py"
click node_db "https://github.com/kleniobraz/opussb/blob/master/db.py"
click node_s3 "https://github.com/kleniobraz/opussb/blob/master/s3_client.py"
click node_anthropic "https://github.com/kleniobraz/opussb/blob/master/anthropic_client.py"
click node_config "https://github.com/kleniobraz/opussb/blob/master/config.py"
click node_inflight "https://github.com/kleniobraz/opussb/blob/master/em_voo.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_upload,node_dashboard,node_projects,node_project_detail,node_editor,node_caption_ui,node_podcast_ui,node_api_client,node_user toneBlue
class node_flask,node_processor,node_reframer,node_reframe_core,node_captions,node_caption_review,node_caption_sampler toneAmber
class node_podcast_ingest,node_podcast_cut,node_podcast_compose,node_podcast_audio toneMint
class node_db,node_s3,node_anthropic,node_config,node_inflight toneRose
```

## Components

### Web application

- [Video upload](https://github.com/kleniobraz/opussb/blob/master/frontend/components/upload-console.tsx): `frontend/components/upload-console.tsx`
- [Dashboard](https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/painel/page.tsx): `frontend/app/(app)/painel/page.tsx`
- [Projects](https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/projetos/page.tsx): `frontend/app/(app)/projetos/page.tsx`
- [Project detail](https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/projetos/%5Bid%5D/page.tsx): `frontend/app/(app)/projetos/[id]/page.tsx`
- [Clip editor](https://github.com/kleniobraz/opussb/blob/master/frontend/components/editor/clip-editor.tsx): `frontend/components/editor/clip-editor.tsx`
- [Caption reviewer UI](https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/revisor/page.tsx): `frontend/app/(app)/revisor/page.tsx`
- [Podcast UI](https://github.com/kleniobraz/opussb/blob/master/frontend/app/(app)/podcast/page.tsx): `frontend/app/(app)/podcast/page.tsx`
- [Frontend API client](https://github.com/kleniobraz/opussb/blob/master/frontend/lib/api.ts): `frontend/lib/api.ts`

### Video processing

- [Flask application](https://github.com/kleniobraz/opussb/blob/master/app.py): `app.py`
- [Clip processor](https://github.com/kleniobraz/opussb/blob/master/processor.py): `processor.py`
- [Reframe worker](https://github.com/kleniobraz/opussb/blob/master/gpu_reframe/handler.py): `gpu_reframe/handler.py`
- [Reframe algorithms](https://github.com/kleniobraz/opussb/blob/master/reframe_core.py): `reframe_core.py`
- [Caption handling](https://github.com/kleniobraz/opussb/blob/master/captions.py): `captions.py`
- [Caption review pipeline](https://github.com/kleniobraz/opussb/blob/master/caption_reviewer.py): `caption_reviewer.py`
- [Caption frame sampling](https://github.com/kleniobraz/opussb/blob/master/caption_sampler.py): `caption_sampler.py`

### Podcast production

- [Podcast ingest](https://github.com/kleniobraz/opussb/blob/master/podcast_ingest.py): `podcast_ingest.py`
- [Podcast intro cut](https://github.com/kleniobraz/opussb/blob/master/podcast_cut.py): `podcast_cut.py`
- [Podcast assembly](https://github.com/kleniobraz/opussb/blob/master/podcast_compose.py): `podcast_compose.py`
- [Podcast audio extraction](https://github.com/kleniobraz/opussb/blob/master/podcast_audio.py): `podcast_audio.py`

### Shared services

- [Application database](https://github.com/kleniobraz/opussb/blob/master/db.py): `db.py`
- [S3 storage](https://github.com/kleniobraz/opussb/blob/master/s3_client.py): `s3_client.py`
- [Claude client](https://github.com/kleniobraz/opussb/blob/master/anthropic_client.py): `anthropic_client.py`
- [Configuration](https://github.com/kleniobraz/opussb/blob/master/config.py): `config.py`
- [In-flight work tracking](https://github.com/kleniobraz/opussb/blob/master/em_voo.py): `em_voo.py`

### Other components

- **User**

## Connections

- User → Video upload: uploads video
- Flask application → Clip processor: starts job (evidence: `app.py`)
- Flask application → Application database: deletes session (evidence: `app.py`)
- Reframe worker → Reframe algorithms: generates keyframes (evidence: `gpu_reframe/handler.py`)
- Caption review pipeline → Caption frame sampling: estimates budget (evidence: `caption_reviewer.py`)
- Caption review pipeline → Claude client: requests review (evidence: `caption_reviewer.py`)
- Caption review pipeline → Application database: reads glossary (evidence: `caption_reviewer.py`)
- Podcast ingest → Application database: updates job (evidence: `podcast_ingest.py`)
