# hemasagarraju/wandervoice_ai architecture

> Architecture diagram of the GitHub repository hemasagarraju/wandervoice_ai, 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/hemasagarraju/wandervoice_ai
- Repository: https://github.com/hemasagarraju/wandervoice_ai

## Overview

WanderVoice AI is a web-based tourist audio guide. Visitors choose a featured destination or search for one, configure narration depth and language, then request a generated guide; the backend creates narration text and audio, and the browser plays it or falls back to device speech. The graph also includes destination discovery, transcript and audio controls, and runtime API-key/status features documented or shown in the excerpts. Some route details and UI wiring are unsampled, so only documented or excerpt-supported connections are shown.

Main entry points: [`script.js`](https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js) (Guide request flow), [`app.py`](https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py) (Audio generation), [`index.html`](https://github.com/hemasagarraju/wandervoice_ai/blob/main/index.html) (Destination UI), [`style.css`](https://github.com/hemasagarraju/wandervoice_ai/blob/main/style.css) (Guide presentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Destination discovery"]
  node_destination_ui["Destination UI<br/>[index.html]"]
  node_destination_logic["Search and selection<br/>[script.js]"]
end

subgraph group_experience["Guide experience"]
  node_guide_controls["Guide controls<br/>[index.html]"]
  node_client_flow["Guide request flow<br/>[script.js]"]
  node_audio_transcript["Audio and transcript<br/>[script.js]"]
  node_browser_speech["Device speech synthesis"]
  node_visual_design["Guide presentation<br/>[style.css]"]
  node_api_services["Key and status UI<br/>[script.js]"]
end

subgraph group_backend["Guide backend"]
  node_flask_app["Flask API<br/>[app.py]"]
  node_narration_generation["Narration generation<br/>[app.py]"]
  node_audio_generation["Audio generation<br/>[app.py]"]
  node_audio_cache["Audio cache<br/>[app.py]"]
end

subgraph group_speech["Speech integrations"]
  node_gemini["Google Gemini"]
  node_murf["Murf AI TTS"]
  node_edge_tts["Edge TTS"]
  node_gtts["gTTS"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_destination_ui
node_destination_ui -->|"selects destination"| node_destination_logic
node_visitor -->|"configures guide"| node_guide_controls
node_destination_logic -->|"sets destination"| node_client_flow
node_guide_controls -->|"sets options"| node_client_flow
node_client_flow -->|"posts request"| node_flask_app
node_flask_app -->|"requests text"| node_narration_generation
node_narration_generation -->|"generates narration"| node_gemini
node_flask_app -->|"converts narration"| node_audio_generation
node_audio_generation -.->|"requests speech"| node_murf
node_audio_generation -->|"falls back to"| node_edge_tts
node_audio_generation -->|"falls back to"| node_gtts
node_audio_generation -->|"writes audio"| node_audio_cache
node_flask_app -->|"returns guide"| node_client_flow
node_client_flow -->|"updates playback"| node_audio_transcript
node_client_flow -->|"speaks fallback"| node_browser_speech
node_visitor -->|"plays or reads"| node_audio_transcript
node_visitor -->|"manages keys"| node_api_services
node_api_services -->|"checks status"| node_flask_app
node_destination_ui -->|"styled by"| node_visual_design

click node_destination_ui "https://github.com/hemasagarraju/wandervoice_ai/blob/main/index.html"
click node_destination_logic "https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js"
click node_guide_controls "https://github.com/hemasagarraju/wandervoice_ai/blob/main/index.html"
click node_client_flow "https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js"
click node_audio_transcript "https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js"
click node_visual_design "https://github.com/hemasagarraju/wandervoice_ai/blob/main/style.css"
click node_flask_app "https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py"
click node_narration_generation "https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py"
click node_audio_generation "https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py"
click node_audio_cache "https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py"
click node_api_services "https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js"

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_destination_ui,node_destination_logic toneBlue
class node_guide_controls,node_client_flow,node_audio_transcript,node_browser_speech,node_visual_design,node_api_services toneAmber
class node_flask_app,node_narration_generation,node_audio_generation,node_audio_cache toneMint
class node_gemini,node_murf,node_edge_tts,node_gtts toneRose
class node_visitor toneIndigo
```

## Components

### Destination discovery

- [Destination UI](https://github.com/hemasagarraju/wandervoice_ai/blob/main/index.html): `index.html`
- [Search and selection](https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js): `script.js`

### Guide experience

- [Guide controls](https://github.com/hemasagarraju/wandervoice_ai/blob/main/index.html): `index.html`
- [Guide request flow](https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js): `script.js`
- [Audio and transcript](https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js): `script.js`
- **Device speech synthesis**
- [Guide presentation](https://github.com/hemasagarraju/wandervoice_ai/blob/main/style.css): `style.css`
- [Key and status UI](https://github.com/hemasagarraju/wandervoice_ai/blob/main/script.js): `script.js`

### Guide backend

- [Flask API](https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py): `app.py`
- [Narration generation](https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py): `app.py`
- [Audio generation](https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py): `app.py`
- [Audio cache](https://github.com/hemasagarraju/wandervoice_ai/blob/main/app.py): `app.py`

### Speech integrations

- **Google Gemini**
- **Murf AI TTS**
- **Edge TTS**
- **gTTS**

### Other components

- **Visitor**

## Connections

- Visitor → Destination UI: browses (evidence: `README.md`)
- Destination UI → Search and selection: selects destination (evidence: `README.md`)
- Visitor → Guide controls: configures guide (evidence: `README.md`)
- Search and selection → Guide request flow: sets destination (evidence: `README.md`)
- Guide controls → Guide request flow: sets options (evidence: `README.md`)
- Guide request flow → Flask API: posts request (evidence: `script.js`)
- Flask API → Narration generation: requests text (evidence: `app.py`)
- Narration generation → Google Gemini: generates narration (evidence: `app.py`)
- Flask API → Audio generation: converts narration (evidence: `app.py`)
- Audio generation → Murf AI TTS: requests speech (evidence: `app.py`)
- Audio generation → Edge TTS: falls back to (evidence: `app.py`)
- Audio generation → gTTS: falls back to (evidence: `app.py`)
- Audio generation → Audio cache: writes audio (evidence: `app.py`)
- Flask API → Guide request flow: returns guide (evidence: `script.js`)
- Guide request flow → Audio and transcript: updates playback (evidence: `script.js`)
- Guide request flow → Device speech synthesis: speaks fallback (evidence: `script.js`)
- Visitor → Audio and transcript: plays or reads (evidence: `README.md`)
- Visitor → Key and status UI: manages keys (evidence: `script.js`)
- Key and status UI → Flask API: checks status (evidence: `script.js`)
- Destination UI → Guide presentation: styled by (evidence: `README.md`)
