# rahul0070050/subtivio architecture

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

- Interactive diagram: https://gitdiagram.com/rahul0070050/subtivio
- Repository: https://github.com/rahul0070050/subtivio

## Overview

Subtivio Studio is a browser-based subtitle localization and timing workspace. Users bring in SRT/WebVTT captions, edit and translate cue text while preserving timing, check playback and readability, then export or publish the result to the community library. The graph includes the documented editor, translation, preview, transliteration, and publishing capabilities; source excerpts confirm selected API-to-storage calls. Several page and API implementations were not sampled, so their internal wiring is not inferred.

Main entry points: [`src/app/editor/page.tsx`](https://github.com/rahul0070050/subtivio/blob/master/src/app/editor/page.tsx) (Editor workspace), [`src/app/api/subtitles/publish/route.ts`](https://github.com/rahul0070050/subtivio/blob/master/src/app/api/subtitles/publish/route.ts) (Publish endpoint), [`src/app/translate/page.tsx`](https://github.com/rahul0070050/subtivio/blob/master/src/app/translate/page.tsx) (Translate workspace), [`src/components/studio/SubtitleEditor.tsx`](https://github.com/rahul0070050/subtivio/blob/master/src/components/studio/SubtitleEditor.tsx) (Cue editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspaces["Studio workspaces"]
  node_editor_page["Editor workspace<br/>[page.tsx]"]
  node_translate_page["Translate workspace<br/>[page.tsx]"]
  node_subtitle_editor["Cue editor<br/>[SubtitleEditor.tsx]"]
  node_preview["Synchronized preview"]
  node_uploader["Subtitle uploader"]
  node_transliteration["Transliteration"]
  node_language_config["Language config<br/>[languages.ts]"]
end

subgraph group_subtitle_flow["Subtitle processing"]
  node_parse_api["Parse endpoint<br/>[route.ts]"]
  node_parser["SRT/VTT parser<br/>[parser.ts]"]
  node_subtitle_data["Subtitle cue model<br/>[types.ts]"]
  node_session_storage[("Workspace session<br/>[storage.ts]")]
  node_translation_api["Translation endpoint<br/>[route.ts]"]
  node_transliteration_api["Transliteration endpoint<br/>[route.ts]"]
  node_export_modal["Export controls<br/>[ExportModal.tsx]"]
  node_export_api["Export endpoint<br/>[route.ts]"]
  node_serializer["Subtitle serializer<br/>[serializer.ts]"]
end

subgraph group_community["Publishing and library"]
  node_publish_modal["Publish controls<br/>[PublishModal.tsx]"]
  node_publish_api["Publish endpoint<br/>[route.ts]"]
  node_published_store[("Published subtitle store<br/>[publishedStore.ts]")]
  node_published_list["Subtitle library<br/>[page.tsx]"]
  node_published_detail["Published subtitle view<br/>[page.tsx]"]
  node_b2[("B2 object storage<br/>[b2.ts]")]
end

subgraph group_identity["Identity and persistence"]
  node_auth_context["Session context<br/>[AuthContext.tsx]"]
  node_auth_api["Authentication endpoints<br/>[route.ts]"]
  node_auth_store[("Passkey and OTP store<br/>[store.ts]")]
  node_mongodb[("MongoDB<br/>[mongodb.ts]")]
  node_email["Resend email<br/>[resend.ts]"]
end

node_user(("Subtitle creator"))

node_user -->|"opens workspace"| node_editor_page
node_user -->|"opens workspace"| node_translate_page
node_editor_page -->|"loads captions"| node_uploader
node_editor_page -->|"renders editor"| node_subtitle_editor
node_editor_page -->|"renders preview"| node_preview
node_uploader -.->|"parses captions"| node_parse_api
node_parse_api -->|"parses input"| node_parser
node_parser -->|"creates cues"| node_subtitle_data
node_editor_page -->|"saves workspace"| node_session_storage
node_subtitle_editor -->|"supports typing"| node_transliteration
node_transliteration -.->|"uses language settings"| node_language_config
node_translate_page -.->|"requests translation"| node_translation_api
node_translate_page -.->|"verifies playback"| node_preview
node_subtitle_editor -.->|"requests transliteration"| node_transliteration_api
node_editor_page -->|"opens export"| node_export_modal
node_export_modal -.->|"requests export"| node_export_api
node_export_api -->|"serializes cues"| node_serializer
node_publish_modal -.->|"submits release"| node_publish_api
node_publish_api -->|"serializes cues"| node_serializer
node_publish_api -->|"saves release"| node_published_store
node_publish_api -->|"uploads subtitle"| node_b2
node_published_list -.->|"lists releases"| node_published_store
node_published_detail -.->|"loads release"| node_published_store
node_auth_context -.->|"checks session"| node_auth_api
node_auth_api -->|"verifies passkey"| node_auth_store
node_auth_store -->|"reads and writes"| node_mongodb
node_auth_store -->|"sends OTP"| node_email

click node_editor_page "https://github.com/rahul0070050/subtivio/blob/master/src/app/editor/page.tsx"
click node_translate_page "https://github.com/rahul0070050/subtivio/blob/master/src/app/translate/page.tsx"
click node_subtitle_editor "https://github.com/rahul0070050/subtivio/blob/master/src/components/studio/SubtitleEditor.tsx"
click node_preview "https://github.com/rahul0070050/subtivio/blob/master/src/components/studio/SynchronizedPreview.tsx"
click node_uploader "https://github.com/rahul0070050/subtivio/blob/master/src/components/studio/SubtitleUploader.tsx"
click node_transliteration "https://github.com/rahul0070050/subtivio/blob/master/src/lib/transliteration/transliterateClient.ts"
click node_language_config "https://github.com/rahul0070050/subtivio/blob/master/src/lib/transliteration/languages.ts"
click node_parse_api "https://github.com/rahul0070050/subtivio/blob/master/src/app/api/subtitles/parse/route.ts"
click node_parser "https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/parser.ts"
click node_subtitle_data "https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/types.ts"
click node_session_storage "https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/storage.ts"
click node_translation_api "https://github.com/rahul0070050/subtivio/blob/master/src/app/api/translate/route.ts"
click node_transliteration_api "https://github.com/rahul0070050/subtivio/blob/master/src/app/api/transliterate/route.ts"
click node_export_modal "https://github.com/rahul0070050/subtivio/blob/master/src/components/modals/ExportModal.tsx"
click node_export_api "https://github.com/rahul0070050/subtivio/blob/master/src/app/api/subtitles/export/route.ts"
click node_serializer "https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/serializer.ts"
click node_publish_modal "https://github.com/rahul0070050/subtivio/blob/master/src/components/modals/PublishModal.tsx"
click node_publish_api "https://github.com/rahul0070050/subtivio/blob/master/src/app/api/subtitles/publish/route.ts"
click node_published_store "https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/publishedStore.ts"
click node_published_list "https://github.com/rahul0070050/subtivio/blob/master/src/app/subtitles/page.tsx"
click node_published_detail "https://github.com/rahul0070050/subtivio/blob/master/src/app/subtitles/%5Bid%5D/page.tsx"
click node_b2 "https://github.com/rahul0070050/subtivio/blob/master/src/lib/storage/b2.ts"
click node_auth_context "https://github.com/rahul0070050/subtivio/blob/master/src/lib/auth/AuthContext.tsx"
click node_auth_api "https://github.com/rahul0070050/subtivio/blob/master/src/app/api/auth/verify-otp/route.ts"
click node_auth_store "https://github.com/rahul0070050/subtivio/blob/master/src/lib/auth/store.ts"
click node_mongodb "https://github.com/rahul0070050/subtivio/blob/master/src/lib/db/mongodb.ts"
click node_email "https://github.com/rahul0070050/subtivio/blob/master/src/lib/email/resend.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_editor_page,node_translate_page,node_subtitle_editor,node_preview,node_uploader,node_transliteration,node_language_config toneBlue
class node_parse_api,node_parser,node_subtitle_data,node_session_storage,node_translation_api,node_transliteration_api,node_export_modal,node_export_api,node_serializer toneAmber
class node_publish_modal,node_publish_api,node_published_store,node_published_list,node_published_detail,node_b2 toneMint
class node_auth_context,node_auth_api,node_auth_store,node_mongodb,node_email toneRose
class node_user toneIndigo
```

## Components

### Studio workspaces

- [Editor workspace](https://github.com/rahul0070050/subtivio/blob/master/src/app/editor/page.tsx): `src/app/editor/page.tsx`
- [Translate workspace](https://github.com/rahul0070050/subtivio/blob/master/src/app/translate/page.tsx): `src/app/translate/page.tsx`
- [Cue editor](https://github.com/rahul0070050/subtivio/blob/master/src/components/studio/SubtitleEditor.tsx): `src/components/studio/SubtitleEditor.tsx`
- [Synchronized preview](https://github.com/rahul0070050/subtivio/blob/master/src/components/studio/SynchronizedPreview.tsx): `src/components/studio/SynchronizedPreview.tsx`
- [Subtitle uploader](https://github.com/rahul0070050/subtivio/blob/master/src/components/studio/SubtitleUploader.tsx): `src/components/studio/SubtitleUploader.tsx`
- [Transliteration](https://github.com/rahul0070050/subtivio/blob/master/src/lib/transliteration/transliterateClient.ts): `src/lib/transliteration/transliterateClient.ts`
- [Language config](https://github.com/rahul0070050/subtivio/blob/master/src/lib/transliteration/languages.ts): `src/lib/transliteration/languages.ts`

### Subtitle processing

- [Parse endpoint](https://github.com/rahul0070050/subtivio/blob/master/src/app/api/subtitles/parse/route.ts): `src/app/api/subtitles/parse/route.ts`
- [SRT/VTT parser](https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/parser.ts): `src/lib/subtitles/parser.ts`
- [Subtitle cue model](https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/types.ts): `src/lib/subtitles/types.ts`
- [Workspace session](https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/storage.ts): `src/lib/subtitles/storage.ts`
- [Translation endpoint](https://github.com/rahul0070050/subtivio/blob/master/src/app/api/translate/route.ts): `src/app/api/translate/route.ts`
- [Transliteration endpoint](https://github.com/rahul0070050/subtivio/blob/master/src/app/api/transliterate/route.ts): `src/app/api/transliterate/route.ts`
- [Export controls](https://github.com/rahul0070050/subtivio/blob/master/src/components/modals/ExportModal.tsx): `src/components/modals/ExportModal.tsx`
- [Export endpoint](https://github.com/rahul0070050/subtivio/blob/master/src/app/api/subtitles/export/route.ts): `src/app/api/subtitles/export/route.ts`
- [Subtitle serializer](https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/serializer.ts): `src/lib/subtitles/serializer.ts`

### Publishing and library

- [Publish controls](https://github.com/rahul0070050/subtivio/blob/master/src/components/modals/PublishModal.tsx): `src/components/modals/PublishModal.tsx`
- [Publish endpoint](https://github.com/rahul0070050/subtivio/blob/master/src/app/api/subtitles/publish/route.ts): `src/app/api/subtitles/publish/route.ts`
- [Published subtitle store](https://github.com/rahul0070050/subtivio/blob/master/src/lib/subtitles/publishedStore.ts): `src/lib/subtitles/publishedStore.ts`
- [Subtitle library](https://github.com/rahul0070050/subtivio/blob/master/src/app/subtitles/page.tsx): `src/app/subtitles/page.tsx`
- [Published subtitle view](https://github.com/rahul0070050/subtivio/blob/master/src/app/subtitles/%5Bid%5D/page.tsx): `src/app/subtitles/[id]/page.tsx`
- [B2 object storage](https://github.com/rahul0070050/subtivio/blob/master/src/lib/storage/b2.ts): `src/lib/storage/b2.ts`

### Identity and persistence

- [Session context](https://github.com/rahul0070050/subtivio/blob/master/src/lib/auth/AuthContext.tsx): `src/lib/auth/AuthContext.tsx`
- [Authentication endpoints](https://github.com/rahul0070050/subtivio/blob/master/src/app/api/auth/verify-otp/route.ts): `src/app/api/auth/verify-otp/route.ts`
- [Passkey and OTP store](https://github.com/rahul0070050/subtivio/blob/master/src/lib/auth/store.ts): `src/lib/auth/store.ts`
- [MongoDB](https://github.com/rahul0070050/subtivio/blob/master/src/lib/db/mongodb.ts): `src/lib/db/mongodb.ts`
- [Resend email](https://github.com/rahul0070050/subtivio/blob/master/src/lib/email/resend.ts): `src/lib/email/resend.ts`

### Other components

- **Subtitle creator**

## Connections

- Subtitle creator → Editor workspace: opens workspace
- Subtitle creator → Translate workspace: opens workspace
- Editor workspace → Subtitle uploader: loads captions (evidence: `src/app/editor/page.tsx`)
- Editor workspace → Cue editor: renders editor (evidence: `src/app/editor/page.tsx`)
- Editor workspace → Synchronized preview: renders preview (evidence: `src/app/editor/page.tsx`)
- Subtitle uploader → Parse endpoint: parses captions
- Parse endpoint → SRT/VTT parser: parses input (evidence: `src/app/api/subtitles/parse/route.ts`)
- SRT/VTT parser → Subtitle cue model: creates cues (evidence: `src/lib/subtitles/parser.ts`)
- Editor workspace → Workspace session: saves workspace (evidence: `src/app/editor/page.tsx`)
- Cue editor → Transliteration: supports typing (evidence: `src/components/studio/SubtitleEditor.tsx`)
- Transliteration → Language config: uses language settings
- Translate workspace → Translation endpoint: requests translation
- Translate workspace → Synchronized preview: verifies playback
- Cue editor → Transliteration endpoint: requests transliteration
- Editor workspace → Export controls: opens export (evidence: `src/app/editor/page.tsx`)
- Export controls → Export endpoint: requests export
- Export endpoint → Subtitle serializer: serializes cues (evidence: `src/app/api/subtitles/export/route.ts`)
- Publish controls → Publish endpoint: submits release
- Publish endpoint → Subtitle serializer: serializes cues (evidence: `src/app/api/subtitles/publish/route.ts`)
- Publish endpoint → Published subtitle store: saves release (evidence: `src/app/api/subtitles/publish/route.ts`)
- Publish endpoint → B2 object storage: uploads subtitle (evidence: `src/app/api/subtitles/publish/route.ts`)
- Subtitle library → Published subtitle store: lists releases
- Published subtitle view → Published subtitle store: loads release
- Session context → Authentication endpoints: checks session
- Authentication endpoints → Passkey and OTP store: verifies passkey (evidence: `src/app/api/auth/verify-otp/route.ts`)
- Passkey and OTP store → MongoDB: reads and writes (evidence: `src/lib/auth/store.ts`)
- Passkey and OTP store → Resend email: sends OTP (evidence: `src/lib/auth/store.ts`)
