# zaheer-r/visionmate architecture

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

- Interactive diagram: https://gitdiagram.com/zaheer-r/visionmate
- Repository: https://github.com/zaheer-r/visionmate

## Overview

VisionMate is an installable, voice-first accessibility web app. Users enter through its browser interface, then request spoken assistance, camera-based image help or text reading, translation, route estimates, or everyday tools; the app returns visual and spoken results. Guest data remains on-device, while configured account and AI features use Firebase/Supabase services. The graph reflects README capabilities and indexed imports/calls; unsampled feature implementations and some dynamic wiring are shown only where documented, so uncertain links are omitted.

Main entry points: [`js/app.js`](https://github.com/zaheer-r/visionmate/blob/main/js/app.js) (VisionMate UI), [`js/supabase.js`](https://github.com/zaheer-r/visionmate/blob/main/js/supabase.js) (Supabase data client), [`js/routes.js`](https://github.com/zaheer-r/visionmate/blob/main/js/routes.js) (Route estimates), [`supabase/functions/anuvaadhub-inference/index.ts`](https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/anuvaadhub-inference/index.ts) (Anuvaadhub function)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_webapp["VisionMate UI<br/>[app.js]"]
  node_route["Route estimates<br/>[routes.js]"]
  node_tools["Everyday tools<br/>[app.js]"]
end

subgraph group_accessibility["Voice and vision"]
  node_camera["Camera capture<br/>[camera.js]"]
  node_speech["Speech service<br/>[speech.js]"]
  node_stt["Speech input<br/>[stt.js]"]
  node_intent["Request intent<br/>[intent.js]"]
end

subgraph group_services["Language and AI"]
  node_mt["Translation<br/>[mt.js]"]
  node_anuvaadhub["Anuvaadhub client<br/>[anuvaadhub.js]"]
  node_gemini["Gemini function<br/>[index.ts]"]
  node_inference["Anuvaadhub function<br/>[index.ts]"]
  node_catalog["Model catalog"]
  node_bhashini["Bhashini translation<br/>[index.ts]"]
end

subgraph group_accounts["Accounts and data"]
  node_supabase["Supabase data client<br/>[supabase.js]"]
  node_auth["Auth and guest mode<br/>[auth.js]"]
  node_firebase["Firebase adapter<br/>[firebase.js]"]
  node_browserdata[("Browser-local data")]
  node_clouddata[("Account data")]
end

node_person(("User"))
node_geminiservice{{"Gemini API"}}
node_anuvaadhubservice{{"Anuvaadhub API"}}
node_geocoder{{"Destination geocoder"}}
node_router{{"Pedestrian router"}}
node_firebasecloud{{"Firebase Auth"}}

node_person -->|"uses"| node_webapp
node_webapp -->|"requests capture"| node_camera
node_webapp -->|"uses speech"| node_speech
node_webapp -->|"uses input"| node_stt
node_webapp -->|"classifies requests"| node_intent
node_webapp -->|"requests estimate"| node_route
node_route -->|"looks up destination"| node_geocoder
node_route -->|"calculates route"| node_router
node_webapp -->|"manages tools"| node_tools
node_webapp -->|"loads and saves"| node_supabase
node_webapp -->|"manages session"| node_auth
node_auth -->|"signs in"| node_firebase
node_firebase -->|"authenticates"| node_firebasecloud
node_auth -->|"stores guest profile"| node_browserdata
node_supabase -->|"gets user identity"| node_firebase
node_supabase -->|"reads and writes"| node_clouddata
node_speech -->|"requests cloud speech"| node_supabase
node_supabase -->|"invokes function"| node_gemini
node_gemini -->|"generates speech"| node_geminiservice
node_webapp -->|"translates text"| node_mt
node_mt -->|"uses provider"| node_anuvaadhub
node_anuvaadhub -->|"invokes function"| node_supabase
node_supabase -->|"invokes function"| node_inference
node_inference -->|"selects model route"| node_catalog
node_inference -->|"sends inference"| node_anuvaadhubservice
node_bhashini -.->|"uses translation"| node_anuvaadhubservice

click node_webapp "https://github.com/zaheer-r/visionmate/blob/main/js/app.js"
click node_route "https://github.com/zaheer-r/visionmate/blob/main/js/routes.js"
click node_tools "https://github.com/zaheer-r/visionmate/blob/main/js/app.js"
click node_camera "https://github.com/zaheer-r/visionmate/blob/main/js/camera.js"
click node_speech "https://github.com/zaheer-r/visionmate/blob/main/js/speech.js"
click node_stt "https://github.com/zaheer-r/visionmate/blob/main/js/stt.js"
click node_intent "https://github.com/zaheer-r/visionmate/blob/main/js/intent.js"
click node_mt "https://github.com/zaheer-r/visionmate/blob/main/js/mt.js"
click node_anuvaadhub "https://github.com/zaheer-r/visionmate/blob/main/js/anuvaadhub.js"
click node_gemini "https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/gemini-assist/index.ts"
click node_inference "https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/anuvaadhub-inference/index.ts"
click node_catalog "https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/_shared/anuvaadhub-catalog.ts"
click node_bhashini "https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/bhashini-translate/index.ts"
click node_supabase "https://github.com/zaheer-r/visionmate/blob/main/js/supabase.js"
click node_auth "https://github.com/zaheer-r/visionmate/blob/main/js/auth.js"
click node_firebase "https://github.com/zaheer-r/visionmate/blob/main/js/firebase.js"
click node_clouddata "https://github.com/zaheer-r/visionmate/tree/main/supabase/migrations"

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_webapp,node_route,node_tools,node_person toneBlue
class node_camera,node_speech,node_stt,node_intent toneAmber
class node_mt,node_anuvaadhub,node_gemini,node_inference,node_catalog,node_bhashini,node_geminiservice,node_anuvaadhubservice,node_router toneMint
class node_supabase,node_auth,node_firebase,node_browserdata,node_clouddata toneRose
class node_geocoder,node_firebasecloud toneIndigo
```

## Components

### App experience

- [VisionMate UI](https://github.com/zaheer-r/visionmate/blob/main/js/app.js): `js/app.js`
- [Route estimates](https://github.com/zaheer-r/visionmate/blob/main/js/routes.js): `js/routes.js`
- [Everyday tools](https://github.com/zaheer-r/visionmate/blob/main/js/app.js): `js/app.js`

### Voice and vision

- [Camera capture](https://github.com/zaheer-r/visionmate/blob/main/js/camera.js): `js/camera.js`
- [Speech service](https://github.com/zaheer-r/visionmate/blob/main/js/speech.js): `js/speech.js`
- [Speech input](https://github.com/zaheer-r/visionmate/blob/main/js/stt.js): `js/stt.js`
- [Request intent](https://github.com/zaheer-r/visionmate/blob/main/js/intent.js): `js/intent.js`

### Language and AI

- [Translation](https://github.com/zaheer-r/visionmate/blob/main/js/mt.js): `js/mt.js`
- [Anuvaadhub client](https://github.com/zaheer-r/visionmate/blob/main/js/anuvaadhub.js): `js/anuvaadhub.js`
- [Gemini function](https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/gemini-assist/index.ts): `supabase/functions/gemini-assist/index.ts`
- [Anuvaadhub function](https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/anuvaadhub-inference/index.ts): `supabase/functions/anuvaadhub-inference/index.ts`
- [Model catalog](https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/_shared/anuvaadhub-catalog.ts): `supabase/functions/_shared/anuvaadhub-catalog.ts`
- [Bhashini translation](https://github.com/zaheer-r/visionmate/blob/main/supabase/functions/bhashini-translate/index.ts): `supabase/functions/bhashini-translate/index.ts`

### Accounts and data

- [Supabase data client](https://github.com/zaheer-r/visionmate/blob/main/js/supabase.js): `js/supabase.js`
- [Auth and guest mode](https://github.com/zaheer-r/visionmate/blob/main/js/auth.js): `js/auth.js`
- [Firebase adapter](https://github.com/zaheer-r/visionmate/blob/main/js/firebase.js): `js/firebase.js`
- **Browser-local data**
- [Account data](https://github.com/zaheer-r/visionmate/tree/main/supabase/migrations): `supabase/migrations`

### Other components

- **User**
- **Gemini API**
- **Anuvaadhub API**
- **Destination geocoder**
- **Pedestrian router**
- **Firebase Auth**

## Connections

- User → VisionMate UI: uses (evidence: `README.md`)
- VisionMate UI → Camera capture: requests capture (evidence: `js/app.js`)
- VisionMate UI → Speech service: uses speech (evidence: `js/app.js`)
- VisionMate UI → Speech input: uses input (evidence: `js/app.js`)
- VisionMate UI → Request intent: classifies requests (evidence: `js/app.js`)
- VisionMate UI → Route estimates: requests estimate (evidence: `README.md`)
- Route estimates → Destination geocoder: looks up destination (evidence: `js/routes.js`)
- Route estimates → Pedestrian router: calculates route (evidence: `js/routes.js`)
- VisionMate UI → Everyday tools: manages tools (evidence: `README.md`)
- VisionMate UI → Supabase data client: loads and saves (evidence: `js/app.js`)
- VisionMate UI → Auth and guest mode: manages session (evidence: `js/app.js`)
- Auth and guest mode → Firebase adapter: signs in (evidence: `js/auth.js`)
- Firebase adapter → Firebase Auth: authenticates (evidence: `js/firebase.js`)
- Auth and guest mode → Browser-local data: stores guest profile (evidence: `js/auth.js`)
- Supabase data client → Firebase adapter: gets user identity (evidence: `js/supabase.js`)
- Supabase data client → Account data: reads and writes (evidence: `js/supabase.js`)
- Speech service → Supabase data client: requests cloud speech (evidence: `js/speech.js`)
- Supabase data client → Gemini function: invokes function (evidence: `js/supabase.js`)
- Gemini function → Gemini API: generates speech (evidence: `supabase/functions/gemini-assist/index.ts`)
- VisionMate UI → Translation: translates text (evidence: `js/app.js`)
- Translation → Anuvaadhub client: uses provider (evidence: `js/mt.js`)
- Anuvaadhub client → Supabase data client: invokes function (evidence: `js/anuvaadhub.js`)
- Supabase data client → Anuvaadhub function: invokes function
- Anuvaadhub function → Model catalog: selects model route (evidence: `supabase/functions/anuvaadhub-inference/index.ts`)
- Anuvaadhub function → Anuvaadhub API: sends inference (evidence: `supabase/functions/anuvaadhub-inference/index.ts`)
- Bhashini translation → Anuvaadhub API: uses translation
