# bhavyaa110/boliseva architecture

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

- Interactive diagram: https://gitdiagram.com/bhavyaa110/boliseva
- Repository: https://github.com/bhavyaa110/boliseva

## Overview

BOLISEVA is a voice-first, multilingual loan-lifecycle assistant. Users select a language, sign up or log in with a phone OTP, verify documents, apply for loans, then track loan status and EMIs through the dashboard or ask for voice guidance. Source evidence shows frontend orchestration, service calls, Supabase persistence, and browser storage; the README describes additional AI and offline capabilities, but their full runtime wiring is not shown.

Main entry points: [`src/App.tsx`](https://github.com/bhavyaa110/boliseva/blob/main/src/App.tsx) (Journey router), [`src/services/authService.ts`](https://github.com/bhavyaa110/boliseva/blob/main/src/services/authService.ts) (Authentication service), [`src/components/VoiceChat.tsx`](https://github.com/bhavyaa110/boliseva/blob/main/src/components/VoiceChat.tsx) (Voice assistant), [`src/services/loanService.ts`](https://github.com/bhavyaa110/boliseva/blob/main/src/services/loanService.ts) (Loan and EMI service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journey["User journey"]
  node_app["Journey router<br/>[App.tsx]"]
  node_language["Language selection"]
  node_authform["Phone sign-in<br/>[AuthForm.tsx]"]
  node_signup["Account signup<br/>[SignupForm.tsx]"]
  node_otp["OTP verification"]
  node_documents["Document verification"]
  node_loanform["Loan application<br/>[LoanForm.tsx]"]
  node_dashboard["Loan dashboard<br/>[Dashboard.tsx]"]
  node_admin["Admin dashboard<br/>[AdminDashboard.tsx]"]
end

subgraph group_voice["Voice and language"]
  node_voicechat["Voice assistant<br/>[VoiceChat.tsx]"]
  node_voicebutton["Voice control<br/>[VoiceButton.tsx]"]
  node_voicehook["Voice hook<br/>[useVoice.ts]"]
  node_voiceservice["Speech service<br/>[voice.ts]"]
  node_translations["Translations<br/>[translations.ts]"]
end

subgraph group_services["Application services"]
  node_authservice["Authentication service<br/>[authService.ts]"]
  node_docservice["Document service<br/>[documentService.ts]"]
  node_loanservice["Loan and EMI service<br/>[loanService.ts]"]
  node_sms["SMS provider"]
  node_ratelimiter["OTP rate limiter<br/>[rateLimiter.ts]"]
end

subgraph group_data["Persistence and connectivity"]
  node_offline["Offline handling<br/>[useOffline.ts]"]
  node_storage["Browser storage and queue<br/>[storage.ts]"]
  node_supabaseclient["Supabase client<br/>[supabase.ts]"]
  node_database[("Supabase database")]
end

node_user(("Borrower"))
node_gemini["Gemini API"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_language
node_app -->|"renders"| node_authform
node_app -->|"renders"| node_signup
node_app -->|"renders"| node_otp
node_app -->|"renders"| node_documents
node_app -->|"renders"| node_loanform
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_voicechat
node_app -->|"renders"| node_admin
node_authform -->|"checks account"| node_authservice
node_signup -->|"registers"| node_authservice
node_app -->|"requests OTP"| node_authservice
node_authservice -->|"queries"| node_supabaseclient
node_authservice -->|"checks limit"| node_ratelimiter
node_authservice -->|"sends OTP"| node_sms
node_otp -.->|"submits code"| node_app
node_app -->|"invokes verification"| node_docservice
node_docservice -->|"stores documents"| node_supabaseclient
node_loanform -->|"submits application"| node_loanservice
node_dashboard -->|"loads loan data"| node_loanservice
node_admin -->|"manages loans"| node_loanservice
node_loanservice -->|"reads and writes"| node_supabaseclient
node_supabaseclient -->|"connects"| node_database
node_app -->|"reads saved settings"| node_storage
node_offline -->|"uses"| node_storage
node_storage -->|"replays queued loans"| node_loanservice
node_voicechat -->|"uses voice"| node_voicehook
node_authform -->|"uses voice"| node_voicehook
node_voicebutton -.->|"controls voice"| node_voicehook
node_voicehook -->|"calls"| node_voiceservice
node_voicechat -->|"renders"| node_voicebutton
node_dashboard -->|"uses labels"| node_translations
node_voicechat -->|"uses labels"| node_translations
node_voicechat -.->|"may consult"| node_gemini

click node_app "https://github.com/bhavyaa110/boliseva/blob/main/src/App.tsx"
click node_language "https://github.com/bhavyaa110/boliseva/blob/main/src/components/LanguageSelector.tsx"
click node_authform "https://github.com/bhavyaa110/boliseva/blob/main/src/components/AuthForm.tsx"
click node_signup "https://github.com/bhavyaa110/boliseva/blob/main/src/components/SignupForm.tsx"
click node_otp "https://github.com/bhavyaa110/boliseva/blob/main/src/components/OTPVerification.tsx"
click node_documents "https://github.com/bhavyaa110/boliseva/blob/main/src/components/DocumentVerification.tsx"
click node_loanform "https://github.com/bhavyaa110/boliseva/blob/main/src/components/LoanForm.tsx"
click node_dashboard "https://github.com/bhavyaa110/boliseva/blob/main/src/components/Dashboard.tsx"
click node_admin "https://github.com/bhavyaa110/boliseva/blob/main/src/components/AdminDashboard.tsx"
click node_voicechat "https://github.com/bhavyaa110/boliseva/blob/main/src/components/VoiceChat.tsx"
click node_voicebutton "https://github.com/bhavyaa110/boliseva/blob/main/src/components/VoiceButton.tsx"
click node_voicehook "https://github.com/bhavyaa110/boliseva/blob/main/src/hooks/useVoice.ts"
click node_voiceservice "https://github.com/bhavyaa110/boliseva/blob/main/src/utils/voice.ts"
click node_translations "https://github.com/bhavyaa110/boliseva/blob/main/src/utils/translations.ts"
click node_authservice "https://github.com/bhavyaa110/boliseva/blob/main/src/services/authService.ts"
click node_docservice "https://github.com/bhavyaa110/boliseva/blob/main/src/services/documentService.ts"
click node_loanservice "https://github.com/bhavyaa110/boliseva/blob/main/src/services/loanService.ts"
click node_ratelimiter "https://github.com/bhavyaa110/boliseva/blob/main/src/utils/rateLimiter.ts"
click node_offline "https://github.com/bhavyaa110/boliseva/blob/main/src/hooks/useOffline.ts"
click node_storage "https://github.com/bhavyaa110/boliseva/blob/main/src/utils/storage.ts"
click node_supabaseclient "https://github.com/bhavyaa110/boliseva/blob/main/src/lib/supabase.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_app,node_language,node_authform,node_signup,node_otp,node_documents,node_loanform,node_dashboard,node_admin toneBlue
class node_voicechat,node_voicebutton,node_voicehook,node_voiceservice,node_translations toneAmber
class node_authservice,node_docservice,node_loanservice,node_sms,node_ratelimiter,node_gemini toneMint
class node_offline,node_storage,node_supabaseclient,node_database toneRose
class node_user toneIndigo
```

## Components

### User journey

- [Journey router](https://github.com/bhavyaa110/boliseva/blob/main/src/App.tsx): `src/App.tsx`
- [Language selection](https://github.com/bhavyaa110/boliseva/blob/main/src/components/LanguageSelector.tsx): `src/components/LanguageSelector.tsx`
- [Phone sign-in](https://github.com/bhavyaa110/boliseva/blob/main/src/components/AuthForm.tsx): `src/components/AuthForm.tsx`
- [Account signup](https://github.com/bhavyaa110/boliseva/blob/main/src/components/SignupForm.tsx): `src/components/SignupForm.tsx`
- [OTP verification](https://github.com/bhavyaa110/boliseva/blob/main/src/components/OTPVerification.tsx): `src/components/OTPVerification.tsx`
- [Document verification](https://github.com/bhavyaa110/boliseva/blob/main/src/components/DocumentVerification.tsx): `src/components/DocumentVerification.tsx`
- [Loan application](https://github.com/bhavyaa110/boliseva/blob/main/src/components/LoanForm.tsx): `src/components/LoanForm.tsx`
- [Loan dashboard](https://github.com/bhavyaa110/boliseva/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Admin dashboard](https://github.com/bhavyaa110/boliseva/blob/main/src/components/AdminDashboard.tsx): `src/components/AdminDashboard.tsx`

### Voice and language

- [Voice assistant](https://github.com/bhavyaa110/boliseva/blob/main/src/components/VoiceChat.tsx): `src/components/VoiceChat.tsx`
- [Voice control](https://github.com/bhavyaa110/boliseva/blob/main/src/components/VoiceButton.tsx): `src/components/VoiceButton.tsx`
- [Voice hook](https://github.com/bhavyaa110/boliseva/blob/main/src/hooks/useVoice.ts): `src/hooks/useVoice.ts`
- [Speech service](https://github.com/bhavyaa110/boliseva/blob/main/src/utils/voice.ts): `src/utils/voice.ts`
- [Translations](https://github.com/bhavyaa110/boliseva/blob/main/src/utils/translations.ts): `src/utils/translations.ts`

### Application services

- [Authentication service](https://github.com/bhavyaa110/boliseva/blob/main/src/services/authService.ts): `src/services/authService.ts`
- [Document service](https://github.com/bhavyaa110/boliseva/blob/main/src/services/documentService.ts): `src/services/documentService.ts`
- [Loan and EMI service](https://github.com/bhavyaa110/boliseva/blob/main/src/services/loanService.ts): `src/services/loanService.ts`
- **SMS provider**
- [OTP rate limiter](https://github.com/bhavyaa110/boliseva/blob/main/src/utils/rateLimiter.ts): `src/utils/rateLimiter.ts`

### Persistence and connectivity

- [Offline handling](https://github.com/bhavyaa110/boliseva/blob/main/src/hooks/useOffline.ts): `src/hooks/useOffline.ts`
- [Browser storage and queue](https://github.com/bhavyaa110/boliseva/blob/main/src/utils/storage.ts): `src/utils/storage.ts`
- [Supabase client](https://github.com/bhavyaa110/boliseva/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase database**

### Other components

- **Borrower**
- **Gemini API**

## Connections

- Borrower → Journey router: uses (evidence: `README.md`)
- Journey router → Language selection: renders (evidence: `src/App.tsx`)
- Journey router → Phone sign-in: renders (evidence: `src/App.tsx`)
- Journey router → Account signup: renders (evidence: `src/App.tsx`)
- Journey router → OTP verification: renders (evidence: `src/App.tsx`)
- Journey router → Document verification: renders (evidence: `src/App.tsx`)
- Journey router → Loan application: renders (evidence: `src/App.tsx`)
- Journey router → Loan dashboard: renders (evidence: `src/App.tsx`)
- Journey router → Voice assistant: renders (evidence: `src/App.tsx`)
- Journey router → Admin dashboard: renders (evidence: `src/App.tsx`)
- Phone sign-in → Authentication service: checks account (evidence: `src/components/AuthForm.tsx`)
- Account signup → Authentication service: registers (evidence: `src/components/SignupForm.tsx`)
- Journey router → Authentication service: requests OTP
- Authentication service → Supabase client: queries (evidence: `src/services/authService.ts`)
- Authentication service → OTP rate limiter: checks limit (evidence: `src/services/authService.ts`)
- Authentication service → SMS provider: sends OTP (evidence: `src/services/authService.ts`)
- OTP verification → Journey router: submits code (evidence: `src/App.tsx`)
- Journey router → Document service: invokes verification (evidence: `src/App.tsx`)
- Document service → Supabase client: stores documents (evidence: `src/services/documentService.ts`)
- Loan application → Loan and EMI service: submits application (evidence: `src/components/LoanForm.tsx`)
- Loan dashboard → Loan and EMI service: loads loan data (evidence: `src/components/Dashboard.tsx`)
- Admin dashboard → Loan and EMI service: manages loans (evidence: `src/components/AdminDashboard.tsx`)
- Loan and EMI service → Supabase client: reads and writes (evidence: `src/services/loanService.ts`)
- Supabase client → Supabase database: connects (evidence: `src/lib/supabase.ts`)
- Journey router → Browser storage and queue: reads saved settings (evidence: `src/App.tsx`)
- Offline handling → Browser storage and queue: uses (evidence: `src/hooks/useOffline.ts`)
- Browser storage and queue → Loan and EMI service: replays queued loans (evidence: `src/utils/storage.ts`)
- Voice assistant → Voice hook: uses voice (evidence: `src/components/VoiceChat.tsx`)
- Phone sign-in → Voice hook: uses voice (evidence: `src/components/AuthForm.tsx`)
- Voice control → Voice hook: controls voice
- Voice hook → Speech service: calls (evidence: `src/hooks/useVoice.ts`)
- Voice assistant → Voice control: renders (evidence: `src/components/VoiceChat.tsx`)
- Loan dashboard → Translations: uses labels (evidence: `src/components/Dashboard.tsx`)
- Voice assistant → Translations: uses labels (evidence: `src/components/VoiceChat.tsx`)
- Voice assistant → Gemini API: may consult
