# gvahck/manavoiceai architecture

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

- Interactive diagram: https://gitdiagram.com/gvahck/manavoiceai
- Repository: https://github.com/gvahck/manavoiceai

## Overview

ManaVoice AI is a multilingual text-to-speech platform. Users sign in, choose languages, optionally translate text, generate and play speech, then revisit or bookmark recordings and inspect usage. The React client calls a FastAPI API; speech synthesis writes WAV files to local storage while generation records and user data persist in MongoDB. The README also documents language discovery, account preferences, health probes, and dashboard/analytics capabilities. Route-to-service links below use inspected source references; some backend route implementations and frontend pages were not sampled, so those links are documented or omitted where uncertain.

Main entry points: [`frontend/src/App.tsx`](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/App.tsx) (Route application), [`backend/app/api/routes/speech.py`](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/speech.py) (Speech routes), [`backend/app/main.py`](https://github.com/gvahck/manavoiceai/blob/main/backend/app/main.py) (API application), [`backend/app/repositories/generation_repository.py`](https://github.com/gvahck/manavoiceai/blob/main/backend/app/repositories/generation_repository.py) (Generation repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route application<br/>[App.tsx]"]
  node_apiclient["API client<br/>[apiClient.ts]"]
end

subgraph group_identity["Identity and profile"]
  node_authctx["Auth state<br/>[AuthContext.tsx]"]
  node_authsvc["Auth client<br/>[authService.ts]"]
  node_authroutes["Auth routes<br/>[auth.py]"]
  node_userrepo["User repository<br/>[user_repository.py]"]
end

subgraph group_speech["Speech generation"]
  node_studio["Speech studio<br/>[StudioPage.tsx]"]
  node_speechsvc["Speech client<br/>[speechService.ts]"]
  node_languagesvc["Language client"]
  node_player["Audio player<br/>[AudioPlayer.tsx]"]
  node_speechroutes["Speech routes<br/>[speech.py]"]
  node_translation["Translation service"]
  node_tts["TTS engine<br/>[tts_service.py]"]
  node_storage["Audio storage<br/>[storage_service.py]"]
end

subgraph group_insights["Usage and library"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_analyticspage["Analytics page<br/>[AnalyticsPage.tsx]"]
  node_historypage["History page<br/>[HistoryPage.tsx]"]
  node_savedpage["Saved audio page<br/>[SavedAudioPage.tsx]"]
  node_genrepo[("Generation repository")]
  node_savedrepo[("Saved audio repository")]
  node_dashboardroutes["Dashboard routes<br/>[dashboard.py]"]
  node_analyticsroutes["Analytics routes<br/>[analytics.py]"]
  node_historyroutes["History routes<br/>[history.py]"]
  node_savedroutes["Saved audio routes<br/>[saved_audio.py]"]
end

subgraph group_backend["Backend foundation"]
  node_main["API application<br/>[main.py]"]
  node_deps["Auth dependencies<br/>[deps.py]"]
  node_mongodb[("MongoDB<br/>[mongodb.py]")]
end

node_user(("Visitor or user"))
node_translateapi{{"LibreTranslate"}}
node_huggingface{{"Hugging Face models"}}

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes to"| node_studio
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_analyticspage
node_app -->|"routes to"| node_historypage
node_app -->|"routes to"| node_savedpage
node_authctx -->|"calls"| node_authsvc
node_authsvc -->|"uses"| node_apiclient
node_studio -->|"calls"| node_speechsvc
node_studio -->|"loads languages"| node_languagesvc
node_studio -->|"renders"| node_player
node_speechsvc -->|"sends requests"| node_apiclient
node_speechsvc -->|"calls API"| node_speechroutes
node_languagesvc -->|"sends requests"| node_apiclient
node_main -->|"registers"| node_authroutes
node_main -->|"registers"| node_speechroutes
node_main -->|"registers"| node_dashboardroutes
node_main -->|"registers"| node_analyticsroutes
node_main -->|"registers"| node_historyroutes
node_main -->|"registers"| node_savedroutes
node_authroutes -->|"uses"| node_userrepo
node_deps -->|"provides repository"| node_userrepo
node_deps -->|"gets database"| node_mongodb
node_speechroutes -->|"calls"| node_translation
node_speechroutes -->|"calls"| node_tts
node_speechroutes -->|"persists generations"| node_genrepo
node_speechroutes -->|"checks saved state"| node_savedrepo
node_speechroutes -->|"manages audio"| node_storage
node_tts -->|"saves WAV"| node_storage
node_translation -.->|"translates via"| node_translateapi
node_tts -->|"loads models"| node_huggingface
node_dashboardroutes -->|"queries metrics"| node_genrepo
node_dashboardroutes -->|"queries saved audio"| node_savedrepo
node_analyticsroutes -->|"queries trends"| node_genrepo
node_historyroutes -->|"queries history"| node_genrepo
node_historyroutes -->|"deletes audio"| node_storage
node_savedroutes -.->|"manages bookmarks"| node_savedrepo
node_genrepo -.->|"reads and writes"| node_mongodb
node_savedrepo -.->|"reads and writes"| node_mongodb

click node_app "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/App.tsx"
click node_authctx "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/contexts/AuthContext.tsx"
click node_authsvc "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/authService.ts"
click node_apiclient "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/apiClient.ts"
click node_studio "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/StudioPage.tsx"
click node_speechsvc "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/speechService.ts"
click node_languagesvc "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/languagesService.ts"
click node_player "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/components/speech/AudioPlayer.tsx"
click node_dashboard "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_analyticspage "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/AnalyticsPage.tsx"
click node_historypage "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/HistoryPage.tsx"
click node_savedpage "https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/SavedAudioPage.tsx"
click node_main "https://github.com/gvahck/manavoiceai/blob/main/backend/app/main.py"
click node_authroutes "https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/auth.py"
click node_userrepo "https://github.com/gvahck/manavoiceai/blob/main/backend/app/repositories/user_repository.py"
click node_deps "https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/deps.py"
click node_speechroutes "https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/speech.py"
click node_translation "https://github.com/gvahck/manavoiceai/blob/main/backend/app/services/translation_service.py"
click node_tts "https://github.com/gvahck/manavoiceai/blob/main/backend/app/services/tts_service.py"
click node_storage "https://github.com/gvahck/manavoiceai/blob/main/backend/app/services/storage_service.py"
click node_genrepo "https://github.com/gvahck/manavoiceai/blob/main/backend/app/repositories/generation_repository.py"
click node_savedrepo "https://github.com/gvahck/manavoiceai/blob/main/backend/app/repositories/saved_audio_repository.py"
click node_dashboardroutes "https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/dashboard.py"
click node_analyticsroutes "https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/analytics.py"
click node_historyroutes "https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/history.py"
click node_savedroutes "https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/saved_audio.py"
click node_mongodb "https://github.com/gvahck/manavoiceai/blob/main/backend/app/db/mongodb.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_app,node_apiclient,node_user toneBlue
class node_authctx,node_authsvc,node_authroutes,node_userrepo toneAmber
class node_studio,node_speechsvc,node_languagesvc,node_player,node_speechroutes,node_translation,node_tts,node_storage toneMint
class node_dashboard,node_analyticspage,node_historypage,node_savedpage,node_genrepo,node_savedrepo,node_dashboardroutes,node_analyticsroutes,node_historyroutes,node_savedroutes toneRose
class node_main,node_deps,node_mongodb,node_translateapi,node_huggingface toneIndigo
```

## Components

### Web client

- [Route application](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/apiClient.ts): `frontend/src/services/apiClient.ts`

### Identity and profile

- [Auth state](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/contexts/AuthContext.tsx): `frontend/src/contexts/AuthContext.tsx`
- [Auth client](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/authService.ts): `frontend/src/services/authService.ts`
- [Auth routes](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [User repository](https://github.com/gvahck/manavoiceai/blob/main/backend/app/repositories/user_repository.py): `backend/app/repositories/user_repository.py`

### Speech generation

- [Speech studio](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/StudioPage.tsx): `frontend/src/pages/StudioPage.tsx`
- [Speech client](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/speechService.ts): `frontend/src/services/speechService.ts`
- [Language client](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/services/languagesService.ts): `frontend/src/services/languagesService.ts`
- [Audio player](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/components/speech/AudioPlayer.tsx): `frontend/src/components/speech/AudioPlayer.tsx`
- [Speech routes](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/speech.py): `backend/app/api/routes/speech.py`
- [Translation service](https://github.com/gvahck/manavoiceai/blob/main/backend/app/services/translation_service.py): `backend/app/services/translation_service.py`
- [TTS engine](https://github.com/gvahck/manavoiceai/blob/main/backend/app/services/tts_service.py): `backend/app/services/tts_service.py`
- [Audio storage](https://github.com/gvahck/manavoiceai/blob/main/backend/app/services/storage_service.py): `backend/app/services/storage_service.py`

### Usage and library

- [Dashboard](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Analytics page](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/AnalyticsPage.tsx): `frontend/src/pages/AnalyticsPage.tsx`
- [History page](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/HistoryPage.tsx): `frontend/src/pages/HistoryPage.tsx`
- [Saved audio page](https://github.com/gvahck/manavoiceai/blob/main/frontend/src/pages/SavedAudioPage.tsx): `frontend/src/pages/SavedAudioPage.tsx`
- [Generation repository](https://github.com/gvahck/manavoiceai/blob/main/backend/app/repositories/generation_repository.py): `backend/app/repositories/generation_repository.py`
- [Saved audio repository](https://github.com/gvahck/manavoiceai/blob/main/backend/app/repositories/saved_audio_repository.py): `backend/app/repositories/saved_audio_repository.py`
- [Dashboard routes](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/dashboard.py): `backend/app/api/routes/dashboard.py`
- [Analytics routes](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/analytics.py): `backend/app/api/routes/analytics.py`
- [History routes](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/history.py): `backend/app/api/routes/history.py`
- [Saved audio routes](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/routes/saved_audio.py): `backend/app/api/routes/saved_audio.py`

### Backend foundation

- [API application](https://github.com/gvahck/manavoiceai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Auth dependencies](https://github.com/gvahck/manavoiceai/blob/main/backend/app/api/deps.py): `backend/app/api/deps.py`
- [MongoDB](https://github.com/gvahck/manavoiceai/blob/main/backend/app/db/mongodb.py): `backend/app/db/mongodb.py`

### Other components

- **Visitor or user**
- **LibreTranslate**
- **Hugging Face models**

## Connections

- Visitor or user → Route application: uses (evidence: `frontend/src/App.tsx`)
- Route application → Auth state: provides auth (evidence: `frontend/src/App.tsx`)
- Route application → Speech studio: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Analytics page: routes to (evidence: `frontend/src/App.tsx`)
- Route application → History page: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Saved audio page: routes to (evidence: `frontend/src/App.tsx`)
- Auth state → Auth client: calls (evidence: `frontend/src/contexts/AuthContext.tsx`)
- Auth client → API client: uses (evidence: `frontend/src/services/authService.ts`)
- Speech studio → Speech client: calls (evidence: `frontend/src/pages/StudioPage.tsx`)
- Speech studio → Language client: loads languages (evidence: `frontend/src/pages/StudioPage.tsx`)
- Speech studio → Audio player: renders (evidence: `frontend/src/pages/StudioPage.tsx`)
- Speech client → API client: sends requests (evidence: `frontend/src/services/speechService.ts`)
- Speech client → Speech routes: calls API (evidence: `README.md`)
- Language client → API client: sends requests
- API application → Auth routes: registers (evidence: `backend/app/main.py`)
- API application → Speech routes: registers (evidence: `backend/app/main.py`)
- API application → Dashboard routes: registers (evidence: `backend/app/main.py`)
- API application → Analytics routes: registers (evidence: `backend/app/main.py`)
- API application → History routes: registers (evidence: `backend/app/main.py`)
- API application → Saved audio routes: registers (evidence: `backend/app/main.py`)
- Auth routes → User repository: uses (evidence: `backend/app/api/routes/auth.py`)
- Auth dependencies → User repository: provides repository (evidence: `backend/app/api/deps.py`)
- Auth dependencies → MongoDB: gets database (evidence: `backend/app/api/deps.py`)
- Speech routes → Translation service: calls (evidence: `backend/app/api/routes/speech.py`)
- Speech routes → TTS engine: calls (evidence: `backend/app/api/routes/speech.py`)
- Speech routes → Generation repository: persists generations (evidence: `backend/app/api/routes/speech.py`)
- Speech routes → Saved audio repository: checks saved state (evidence: `backend/app/api/routes/speech.py`)
- Speech routes → Audio storage: manages audio (evidence: `backend/app/api/routes/speech.py`)
- TTS engine → Audio storage: saves WAV (evidence: `backend/app/services/tts_service.py`)
- Translation service → LibreTranslate: translates via (evidence: `README.md`)
- TTS engine → Hugging Face models: loads models (evidence: `backend/app/services/tts_service.py`)
- Dashboard routes → Generation repository: queries metrics (evidence: `backend/app/api/routes/dashboard.py`)
- Dashboard routes → Saved audio repository: queries saved audio (evidence: `backend/app/api/routes/dashboard.py`)
- Analytics routes → Generation repository: queries trends (evidence: `backend/app/api/routes/analytics.py`)
- History routes → Generation repository: queries history (evidence: `backend/app/api/routes/history.py`)
- History routes → Audio storage: deletes audio (evidence: `backend/app/api/routes/history.py`)
- Saved audio routes → Saved audio repository: manages bookmarks
- Generation repository → MongoDB: reads and writes
- Saved audio repository → MongoDB: reads and writes
