# johnweslykurasa/voxbridge architecture

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

- Interactive diagram: https://gitdiagram.com/johnweslykurasa/voxbridge
- Repository: https://github.com/johnweslykurasa/voxbridge

## Overview

VoxBridge is a web platform for audio and video localization, with a Next.js frontend and a Python AI engine. The user workflow runs from submitting media or text through project creation and processing to viewing, streaming, or downloading localized results; video merging is a further capability. The diagram preserves the documented ASR, translation, speech synthesis, and merge stages. Some backend and frontend implementation details were not sampled, so those connections are shown only where the excerpts or README support them.

Main entry points: [`frontend/src/models/Project.ts`](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/Project.ts) (MongoDB records), [`frontend/src/app/api/upload/save/route.ts`](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/upload/save/route.ts) (Media upload and save), [`backend/tts.py`](https://github.com/johnweslykurasa/voxbridge/blob/main/backend/tts.py) (Speech synthesis), [`frontend/src/app/api/text-to-voice/route.ts`](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/text-to-voice/route.ts) (Text-to-voice API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_dashboard["Dashboard and upload<br/>[page.tsx]"]
end

subgraph group_api["Application API"]
  node_project_api["Project APIs<br/>[route.ts]"]
  node_upload_api["Media upload and save<br/>[route.ts]"]
  node_text_api["Text-to-voice API<br/>[route.ts]"]
  node_stream_api["Audio streaming<br/>[route.ts]"]
  node_merge_api["Video merge API<br/>[route.ts]"]
  node_download_api["Result downloads<br/>[route.ts]"]
end

subgraph group_ai["AI processing"]
  node_engine["Python AI service<br/>[main.py]"]
  node_asr["Speech transcription<br/>[transcribe.py]"]
  node_translation["Text translation<br/>[translate_text.py]"]
  node_synthesis["Speech synthesis<br/>[tts.py]"]
  node_preprocess["Audio preprocessing"]
  node_video_process["Video composition<br/>[video_merge.py]"]
end

subgraph group_data["Persistence and media"]
  node_database[("MongoDB records<br/>[Project.ts]")]
  node_media_model["Media records<br/>[MediaFile.ts]"]
  node_translation_model["Translation records<br/>[Translation.ts]"]
  node_user_model["User records<br/>[User.ts]"]
end

node_creator(("Creator"))
node_cloudinary[("Cloudinary media")]

node_creator -->|"submits media"| node_dashboard
node_dashboard -.->|"uploads through"| node_upload_api
node_upload_api -->|"creates project"| node_database
node_upload_api -->|"stores media"| node_media_model
node_upload_api -->|"finds or creates"| node_user_model
node_upload_api -->|"invokes TTS helper"| node_synthesis
node_engine -->|"runs script"| node_asr
node_synthesis -->|"preprocesses reference"| node_preprocess
node_text_api -->|"connects and creates"| node_database
node_text_api -->|"creates translation"| node_translation_model
node_text_api -->|"finds or creates"| node_user_model
node_text_api -->|"invokes TTS helper"| node_synthesis
node_project_api -->|"queries projects"| node_database
node_project_api -->|"looks up owner"| node_user_model
node_merge_api -->|"connects to"| node_database
node_merge_api -->|"loads translation"| node_translation_model
node_merge_api -->|"runs merge script"| node_video_process
node_merge_api -->|"uploads merged video"| node_cloudinary
node_stream_api -->|"loads project"| node_database
node_stream_api -->|"loads translation"| node_translation_model
node_download_api -.->|"serves localized results"| node_database
node_engine -.->|"provides translation"| node_translation
node_engine -.->|"provides speech synthesis"| node_synthesis
node_engine -.->|"provides video merge"| node_video_process
node_synthesis -.->|"publishes audio"| node_cloudinary

click node_dashboard "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/dashboard/upload/page.tsx"
click node_project_api "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/projects/route.ts"
click node_upload_api "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/upload/save/route.ts"
click node_text_api "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/text-to-voice/route.ts"
click node_stream_api "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/tts/stream/%5Bid%5D/route.ts"
click node_merge_api "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/video-merge/route.ts"
click node_download_api "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/download/srt/%5Bid%5D/route.ts"
click node_engine "https://github.com/johnweslykurasa/voxbridge/blob/main/backend/main.py"
click node_asr "https://github.com/johnweslykurasa/voxbridge/blob/main/backend/transcribe.py"
click node_translation "https://github.com/johnweslykurasa/voxbridge/blob/main/backend/translate_text.py"
click node_synthesis "https://github.com/johnweslykurasa/voxbridge/blob/main/backend/tts.py"
click node_preprocess "https://github.com/johnweslykurasa/voxbridge/blob/main/backend/audio_preprocessor.py"
click node_video_process "https://github.com/johnweslykurasa/voxbridge/blob/main/backend/video_merge.py"
click node_database "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/Project.ts"
click node_media_model "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/MediaFile.ts"
click node_translation_model "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/Translation.ts"
click node_user_model "https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/User.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_dashboard toneBlue
class node_project_api,node_upload_api,node_text_api,node_stream_api,node_merge_api,node_download_api,node_cloudinary toneAmber
class node_engine,node_asr,node_translation,node_synthesis,node_preprocess,node_video_process toneMint
class node_database,node_media_model,node_translation_model,node_user_model toneRose
class node_creator toneIndigo
```

## Components

### Web experience

- [Dashboard and upload](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/dashboard/upload/page.tsx): `frontend/src/app/dashboard/upload/page.tsx`

### Application API

- [Project APIs](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/projects/route.ts): `frontend/src/app/api/projects/route.ts`
- [Media upload and save](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/upload/save/route.ts): `frontend/src/app/api/upload/save/route.ts`
- [Text-to-voice API](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/text-to-voice/route.ts): `frontend/src/app/api/text-to-voice/route.ts`
- [Audio streaming](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/tts/stream/%5Bid%5D/route.ts): `frontend/src/app/api/tts/stream/[id]/route.ts`
- [Video merge API](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/video-merge/route.ts): `frontend/src/app/api/video-merge/route.ts`
- [Result downloads](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/app/api/download/srt/%5Bid%5D/route.ts): `frontend/src/app/api/download/srt/[id]/route.ts`

### AI processing

- [Python AI service](https://github.com/johnweslykurasa/voxbridge/blob/main/backend/main.py): `backend/main.py`
- [Speech transcription](https://github.com/johnweslykurasa/voxbridge/blob/main/backend/transcribe.py): `backend/transcribe.py`
- [Text translation](https://github.com/johnweslykurasa/voxbridge/blob/main/backend/translate_text.py): `backend/translate_text.py`
- [Speech synthesis](https://github.com/johnweslykurasa/voxbridge/blob/main/backend/tts.py): `backend/tts.py`
- [Audio preprocessing](https://github.com/johnweslykurasa/voxbridge/blob/main/backend/audio_preprocessor.py): `backend/audio_preprocessor.py`
- [Video composition](https://github.com/johnweslykurasa/voxbridge/blob/main/backend/video_merge.py): `backend/video_merge.py`

### Persistence and media

- [MongoDB records](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/Project.ts): `frontend/src/models/Project.ts`
- [Media records](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/MediaFile.ts): `frontend/src/models/MediaFile.ts`
- [Translation records](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/Translation.ts): `frontend/src/models/Translation.ts`
- [User records](https://github.com/johnweslykurasa/voxbridge/blob/main/frontend/src/models/User.ts): `frontend/src/models/User.ts`

### Other components

- **Creator**
- **Cloudinary media**

## Connections

- Creator → Dashboard and upload: submits media (evidence: `README.md`)
- Dashboard and upload → Media upload and save: uploads through
- Media upload and save → MongoDB records: creates project (evidence: `frontend/src/app/api/upload/save/route.ts`)
- Media upload and save → Media records: stores media (evidence: `frontend/src/app/api/upload/save/route.ts`)
- Media upload and save → User records: finds or creates (evidence: `frontend/src/app/api/upload/save/route.ts`)
- Media upload and save → Speech synthesis: invokes TTS helper (evidence: `frontend/src/app/api/upload/save/route.ts`)
- Python AI service → Speech transcription: runs script (evidence: `backend/main.py`)
- Speech synthesis → Audio preprocessing: preprocesses reference (evidence: `backend/tts.py`)
- Text-to-voice API → MongoDB records: connects and creates (evidence: `frontend/src/app/api/text-to-voice/route.ts`)
- Text-to-voice API → Translation records: creates translation (evidence: `frontend/src/app/api/text-to-voice/route.ts`)
- Text-to-voice API → User records: finds or creates (evidence: `frontend/src/app/api/text-to-voice/route.ts`)
- Text-to-voice API → Speech synthesis: invokes TTS helper (evidence: `frontend/src/app/api/text-to-voice/route.ts`)
- Project APIs → MongoDB records: queries projects (evidence: `frontend/src/app/api/projects/route.ts`)
- Project APIs → User records: looks up owner (evidence: `frontend/src/app/api/projects/route.ts`)
- Video merge API → MongoDB records: connects to (evidence: `frontend/src/app/api/video-merge/route.ts`)
- Video merge API → Translation records: loads translation (evidence: `frontend/src/app/api/video-merge/route.ts`)
- Video merge API → Video composition: runs merge script (evidence: `frontend/src/app/api/video-merge/route.ts`)
- Video merge API → Cloudinary media: uploads merged video (evidence: `frontend/src/app/api/video-merge/route.ts`)
- Audio streaming → MongoDB records: loads project (evidence: `frontend/src/app/api/tts/stream/[id]/route.ts`)
- Audio streaming → Translation records: loads translation (evidence: `frontend/src/app/api/tts/stream/[id]/route.ts`)
- Result downloads → MongoDB records: serves localized results
- Python AI service → Text translation: provides translation (evidence: `README.md`)
- Python AI service → Speech synthesis: provides speech synthesis (evidence: `README.md`)
- Python AI service → Video composition: provides video merge (evidence: `README.md`)
- Speech synthesis → Cloudinary media: publishes audio
