# dhrupad-05/wisprflow-hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/dhrupad-05/wisprflow-hackathon
- Repository: https://github.com/dhrupad-05/wisprflow-hackathon

## Overview

Bolo Sahayak is a multilingual, voice-first assistant for routing service requests and guiding users through demo portal forms while keeping authentication secrets with the user. The main workflow runs from consent and typed or spoken input through session turns, service routing, portal actions, and a reviewable summary. Voice processing, localization, privacy controls, and health reporting support that flow; mock portals and the browser extension provide separate demo/form-assistance capabilities. Edges reflect shown calls and documented behavior; unsampled subsystems are included without guessed internal wiring.

Main entry points: [`frontend/src/features/assistant/AssistantProvider.tsx`](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/assistant/AssistantProvider.tsx) (Assistant state), [`frontend/src/app/App.tsx`](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/app/App.tsx) (App shell), [`services/api/main.py`](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/main.py) (FastAPI app), [`services/api/dialog.py`](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/dialog.py) (Dialog engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Assistant experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_assistant["Assistant state"]
  node_conversation["Conversation UI"]
  node_consent["Consent gate<br/>[ConsentGate.tsx]"]
  node_privacy["Privacy controls"]
  node_review["Review summary<br/>[ReviewCard.tsx]"]
  node_localization["Localization<br/>[useLocalization.ts]"]
end

subgraph group_voice["Voice interaction"]
  node_voice_engine["Voice engine<br/>[useVoiceEngine.ts]"]
  node_runtime_modules["Voice modules<br/>[runtimeModules.ts]"]
  node_speech_service["Speech service<br/>[speechService.ts]"]
  node_voice_api["Speech endpoints<br/>[stt.py]"]
  node_tts["Text-to-speech<br/>[tts.py]"]
  node_stt_providers["STT providers<br/>[stt.py]"]
end

subgraph group_service["Session and routing"]
  node_session_service["Session client<br/>[sessionService.ts]"]
  node_dialog["Dialog engine<br/>[dialog.py]"]
  node_router["Service router<br/>[router.py]"]
  node_llm_router["LLM routing<br/>[llm_router.py]"]
  node_entities["Entity detection<br/>[entities.py]"]
  node_llm_providers["LLM providers<br/>[llm_router.py]"]
end

subgraph group_portal["Portal assistance"]
  node_portal_controller["Portal controller"]
  node_portal_preview["Portal preview<br/>[PortalPreview.tsx]"]
  node_mock_portal["Mock portal<br/>[portal.js]"]
  node_portal_bridge["Portal bridge<br/>[portal-bridge.js]"]
  node_extension["Browser extension<br/>[content.js]"]
end

subgraph group_platform["Runtime services"]
  node_api_transport["API transport<br/>[apiClient.ts]"]
  node_api["FastAPI app<br/>[main.py]"]
  node_health["Health and locales<br/>[main.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"provides state"| node_assistant
node_app -->|"renders"| node_consent
node_app -->|"renders"| node_conversation
node_app -->|"renders"| node_portal_preview
node_app -->|"renders"| node_review
node_assistant -->|"sends turns"| node_session_service
node_assistant -->|"uses"| node_voice_engine
node_assistant -->|"uses"| node_portal_controller
node_assistant -->|"masks input"| node_privacy
node_assistant -->|"uses"| node_localization
node_voice_engine -->|"loads"| node_runtime_modules
node_voice_engine -->|"transcribes"| node_speech_service
node_speech_service -->|"posts audio"| node_api_transport
node_session_service -->|"sends requests"| node_api_transport
node_api_transport -->|"calls routes"| node_api
node_api -->|"handles sessions"| node_dialog
node_dialog -->|"routes requests"| node_router
node_dialog -->|"resolves entities"| node_entities
node_dialog -.->|"uses routing"| node_llm_router
node_llm_router -->|"calls providers"| node_llm_providers
node_api -->|"handles STT"| node_voice_api
node_voice_api -.->|"selects adapters"| node_stt_providers
node_api -->|"serves speech"| node_tts
node_portal_controller -->|"fetches portal"| node_session_service
node_portal_preview -->|"uses"| node_portal_controller
node_portal_controller -.->|"posts field actions"| node_mock_portal
node_portal_bridge -.->|"bridges messages"| node_mock_portal
node_user -.->|"uses"| node_extension
node_review -->|"reads summary state"| node_assistant
node_user -.->|"speaks"| node_voice_engine
node_api -->|"reports readiness"| node_health

click node_app "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/app/App.tsx"
click node_assistant "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/assistant/AssistantProvider.tsx"
click node_conversation "https://github.com/dhrupad-05/wisprflow-hackathon/tree/main/frontend/src/features/conversation"
click node_consent "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/consent/ConsentGate.tsx"
click node_privacy "https://github.com/dhrupad-05/wisprflow-hackathon/tree/main/frontend/src/features/privacy"
click node_review "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/summary/ReviewCard.tsx"
click node_localization "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/hooks/useLocalization.ts"
click node_voice_engine "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/voice/useVoiceEngine.ts"
click node_runtime_modules "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/runtimeModules.ts"
click node_speech_service "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/speechService.ts"
click node_voice_api "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/stt.py"
click node_tts "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/tts.py"
click node_session_service "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/sessionService.ts"
click node_api_transport "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/apiClient.ts"
click node_api "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/main.py"
click node_dialog "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/dialog.py"
click node_router "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/router.py"
click node_llm_router "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/llm_router.py"
click node_entities "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/entities.py"
click node_portal_controller "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/portal/usePortalController.ts"
click node_portal_preview "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/portal/PortalPreview.tsx"
click node_mock_portal "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/apps/mock-portals/portal.js"
click node_portal_bridge "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/apps/mock-portals/portal-bridge.js"
click node_extension "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/apps/extension/content.js"
click node_health "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/main.py"
click node_stt_providers "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/stt.py"
click node_llm_providers "https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/llm_router.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_assistant,node_conversation,node_consent,node_privacy,node_review,node_localization,node_user toneBlue
class node_voice_engine,node_runtime_modules,node_speech_service,node_voice_api,node_tts,node_stt_providers toneAmber
class node_session_service,node_dialog,node_router,node_llm_router,node_entities,node_llm_providers toneMint
class node_portal_controller,node_portal_preview,node_mock_portal,node_portal_bridge,node_extension toneRose
class node_api_transport,node_api,node_health toneIndigo
```

## Components

### Assistant experience

- [App shell](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Assistant state](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/assistant/AssistantProvider.tsx): `frontend/src/features/assistant/AssistantProvider.tsx`
- [Conversation UI](https://github.com/dhrupad-05/wisprflow-hackathon/tree/main/frontend/src/features/conversation): `frontend/src/features/conversation`
- [Consent gate](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/consent/ConsentGate.tsx): `frontend/src/features/consent/ConsentGate.tsx`
- [Privacy controls](https://github.com/dhrupad-05/wisprflow-hackathon/tree/main/frontend/src/features/privacy): `frontend/src/features/privacy`
- [Review summary](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/summary/ReviewCard.tsx): `frontend/src/features/summary/ReviewCard.tsx`
- [Localization](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/hooks/useLocalization.ts): `frontend/src/hooks/useLocalization.ts`

### Voice interaction

- [Voice engine](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/voice/useVoiceEngine.ts): `frontend/src/features/voice/useVoiceEngine.ts`
- [Voice modules](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/runtimeModules.ts): `frontend/src/services/runtimeModules.ts`
- [Speech service](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/speechService.ts): `frontend/src/services/speechService.ts`
- [Speech endpoints](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/stt.py): `services/api/stt.py`
- [Text-to-speech](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/tts.py): `services/api/tts.py`
- [STT providers](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/stt.py): `services/api/stt.py`

### Session and routing

- [Session client](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/sessionService.ts): `frontend/src/services/sessionService.ts`
- [Dialog engine](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/dialog.py): `services/api/dialog.py`
- [Service router](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/router.py): `services/api/router.py`
- [LLM routing](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/llm_router.py): `services/api/llm_router.py`
- [Entity detection](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/entities.py): `services/api/entities.py`
- [LLM providers](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/llm_router.py): `services/api/llm_router.py`

### Portal assistance

- [Portal controller](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/portal/usePortalController.ts): `frontend/src/features/portal/usePortalController.ts`
- [Portal preview](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/features/portal/PortalPreview.tsx): `frontend/src/features/portal/PortalPreview.tsx`
- [Mock portal](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/apps/mock-portals/portal.js): `apps/mock-portals/portal.js`
- [Portal bridge](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/apps/mock-portals/portal-bridge.js): `apps/mock-portals/portal-bridge.js`
- [Browser extension](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/apps/extension/content.js): `apps/extension/content.js`

### Runtime services

- [API transport](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/frontend/src/services/apiClient.ts): `frontend/src/services/apiClient.ts`
- [FastAPI app](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/main.py): `services/api/main.py`
- [Health and locales](https://github.com/dhrupad-05/wisprflow-hackathon/blob/main/services/api/main.py): `services/api/main.py`

### Other components

- **User**

## Connections

- User → App shell: uses (evidence: `frontend/src/app/App.tsx`)
- App shell → Assistant state: provides state (evidence: `frontend/src/app/App.tsx`)
- App shell → Consent gate: renders (evidence: `frontend/src/app/App.tsx`)
- App shell → Conversation UI: renders (evidence: `frontend/src/app/App.tsx`)
- App shell → Portal preview: renders (evidence: `frontend/src/app/App.tsx`)
- App shell → Review summary: renders (evidence: `frontend/src/app/App.tsx`)
- Assistant state → Session client: sends turns (evidence: `frontend/src/features/assistant/AssistantProvider.tsx`)
- Assistant state → Voice engine: uses (evidence: `frontend/src/features/assistant/AssistantProvider.tsx`)
- Assistant state → Portal controller: uses (evidence: `frontend/src/features/assistant/AssistantProvider.tsx`)
- Assistant state → Privacy controls: masks input (evidence: `frontend/src/features/assistant/AssistantProvider.tsx`)
- Assistant state → Localization: uses (evidence: `frontend/src/features/assistant/AssistantProvider.tsx`)
- Voice engine → Voice modules: loads (evidence: `frontend/src/features/voice/useVoiceEngine.ts`)
- Voice engine → Speech service: transcribes (evidence: `frontend/src/features/voice/useVoiceEngine.ts`)
- Speech service → API transport: posts audio (evidence: `frontend/src/services/speechService.ts`)
- Session client → API transport: sends requests (evidence: `frontend/src/services/sessionService.ts`)
- API transport → FastAPI app: calls routes (evidence: `frontend/src/services/apiClient.ts`)
- FastAPI app → Dialog engine: handles sessions (evidence: `services/api/main.py`)
- Dialog engine → Service router: routes requests (evidence: `services/api/dialog.py`)
- Dialog engine → Entity detection: resolves entities (evidence: `services/api/dialog.py`)
- Dialog engine → LLM routing: uses routing
- LLM routing → LLM providers: calls providers (evidence: `services/api/llm_router.py`)
- FastAPI app → Speech endpoints: handles STT (evidence: `services/api/main.py`)
- Speech endpoints → STT providers: selects adapters (evidence: `services/api/stt.py`)
- FastAPI app → Text-to-speech: serves speech (evidence: `services/api/main.py`)
- Portal controller → Session client: fetches portal (evidence: `frontend/src/features/portal/usePortalController.ts`)
- Portal preview → Portal controller: uses (evidence: `frontend/src/features/portal/PortalPreview.tsx`)
- Portal controller → Mock portal: posts field actions
- Portal bridge → Mock portal: bridges messages
- User → Browser extension: uses
- Review summary → Assistant state: reads summary state (evidence: `frontend/src/features/summary/ReviewCard.tsx`)
- User → Voice engine: speaks
- FastAPI app → Health and locales: reports readiness (evidence: `services/api/main.py`)
