# litheshan07/invincible-studios-captions architecture

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

- Interactive diagram: https://gitdiagram.com/litheshan07/invincible-studios-captions
- Repository: https://github.com/litheshan07/invincible-studios-captions

## Overview

Studio Ultimate is a browser-based captioning and video-editing app. Users import a video, obtain a transcript with timed caption segments, edit and style captions in a preview, then export a subtitled video locally. The README documents browser-side rendering and encoding; the sampled UI code shows the editor, undo history, and subtitle renderer. Server routes also provide transcription/translation and project lookup, plus an optional backend proxy. The exact client-to-processing request and some export internals were not shown, so those connections are marked unverified or omitted.

Main entry points: [`src/app/api/v1/projects/process/route.ts`](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/projects/process/route.ts) (Transcription and Translation), [`src/app/EditorLayout.tsx`](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/EditorLayout.tsx) (Timeline Editor), [`src/app/page.tsx`](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/page.tsx) (Captioning Workspace), [`src/app/utils/subtitleRenderer.ts`](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/utils/subtitleRenderer.ts) (Subtitle Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Captioning Client"]
  node_app["Captioning Workspace<br/>[page.tsx]"]
  node_editor["Timeline Editor<br/>[EditorLayout.tsx]"]
  node_history["Undo History<br/>[useUndoHistory.ts]"]
end

subgraph group_render["Preview and Export"]
  node_preview["Subtitle Renderer"]
  node_video["Browser Video Canvas"]
  node_encoder["WebCodecs Encoder"]
  node_muxer["MP4 Muxer<br/>[page.tsx]"]
  node_download["Exported Video"]
end

subgraph group_api["Processing API"]
  node_process["Transcription and Translation<br/>[route.ts]"]
  node_speech["ElevenLabs Speech-to-Text"]
  node_translate["Google Translate"]
end

subgraph group_projects["Project Access"]
  node_projectdb[("In-Memory Project Store<br/>[route.ts]")]
  node_lookup["Project Lookup<br/>[route.ts]"]
  node_proxy["API Backend Proxy<br/>[route.ts]"]
end

node_user(("Video Editor"))
node_backend["Render Backend"]

node_user -->|"imports video"| node_app
node_app -->|"renders editor"| node_editor
node_app -->|"uses history"| node_history
node_editor -->|"draws captions"| node_preview
node_user -->|"edits captions"| node_editor
node_editor -.->|"previews video"| node_video
node_video -->|"provides frames"| node_encoder
node_preview -->|"renders subtitles"| node_video
node_encoder -->|"outputs frames"| node_muxer
node_muxer -->|"produces MP4"| node_download
node_user -.->|"submits video"| node_process
node_process -->|"transcribes audio"| node_speech
node_process -->|"translates text"| node_translate
node_process -->|"initializes store"| node_projectdb
node_lookup -->|"reads project"| node_projectdb
node_proxy -->|"forwards requests"| node_backend

click node_app "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/page.tsx"
click node_editor "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/EditorLayout.tsx"
click node_history "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/hooks/useUndoHistory.ts"
click node_preview "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/utils/subtitleRenderer.ts"
click node_muxer "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/page.tsx"
click node_process "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/projects/process/route.ts"
click node_projectdb "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/projects/process/route.ts"
click node_lookup "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/projects/%5Bid%5D/route.ts"
click node_proxy "https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/%5B...path%5D/route.ts"

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_app,node_editor,node_history toneBlue
class node_preview,node_video,node_encoder,node_muxer,node_download toneAmber
class node_process,node_speech,node_translate toneMint
class node_projectdb,node_lookup,node_proxy toneRose
class node_user,node_backend toneIndigo
```

## Components

### Captioning Client

- [Captioning Workspace](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Timeline Editor](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/EditorLayout.tsx): `src/app/EditorLayout.tsx`
- [Undo History](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/hooks/useUndoHistory.ts): `src/app/hooks/useUndoHistory.ts`

### Preview and Export

- [Subtitle Renderer](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/utils/subtitleRenderer.ts): `src/app/utils/subtitleRenderer.ts`
- **Browser Video Canvas**
- **WebCodecs Encoder**
- [MP4 Muxer](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/page.tsx): `src/app/page.tsx`
- **Exported Video**

### Processing API

- [Transcription and Translation](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/projects/process/route.ts): `src/app/api/v1/projects/process/route.ts`
- **ElevenLabs Speech-to-Text**
- **Google Translate**

### Project Access

- [In-Memory Project Store](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/projects/process/route.ts): `src/app/api/v1/projects/process/route.ts`
- [Project Lookup](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/projects/%5Bid%5D/route.ts): `src/app/api/v1/projects/[id]/route.ts`
- [API Backend Proxy](https://github.com/litheshan07/invincible-studios-captions/blob/main/src/app/api/v1/%5B...path%5D/route.ts): `src/app/api/v1/[...path]/route.ts`

### Other components

- **Video Editor**
- **Render Backend**

## Connections

- Video Editor → Captioning Workspace: imports video (evidence: `src/app/page.tsx`)
- Captioning Workspace → Timeline Editor: renders editor (evidence: `src/app/page.tsx`)
- Captioning Workspace → Undo History: uses history (evidence: `src/app/page.tsx`)
- Timeline Editor → Subtitle Renderer: draws captions (evidence: `src/app/EditorLayout.tsx`)
- Video Editor → Timeline Editor: edits captions (evidence: `src/app/EditorLayout.tsx`)
- Timeline Editor → Browser Video Canvas: previews video
- Browser Video Canvas → WebCodecs Encoder: provides frames (evidence: `README.md`)
- Subtitle Renderer → Browser Video Canvas: renders subtitles (evidence: `README.md`)
- WebCodecs Encoder → MP4 Muxer: outputs frames (evidence: `README.md`)
- MP4 Muxer → Exported Video: produces MP4 (evidence: `README.md`)
- Video Editor → Transcription and Translation: submits video
- Transcription and Translation → ElevenLabs Speech-to-Text: transcribes audio (evidence: `src/app/api/v1/projects/process/route.ts`)
- Transcription and Translation → Google Translate: translates text (evidence: `src/app/api/v1/projects/process/route.ts`)
- Transcription and Translation → In-Memory Project Store: initializes store (evidence: `src/app/api/v1/projects/process/route.ts`)
- Project Lookup → In-Memory Project Store: reads project (evidence: `src/app/api/v1/projects/[id]/route.ts`)
- API Backend Proxy → Render Backend: forwards requests (evidence: `src/app/api/v1/[...path]/route.ts`)
