# hemanthvsp1/describeit architecture

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

- Interactive diagram: https://gitdiagram.com/hemanthvsp1/describeit
- Repository: https://github.com/hemanthvsp1/describeit

## Overview

DescribeIt offers web and native-mobile clients for capturing or selecting an image, requesting a mode-specific explanation, and presenting it visually and through speech. The Express service exposes `/api/describe`, selects general, reading, safety, navigation, or PDF prompts, and calls Anthropic; both clients submit to that route. The web client also supports history and demo/upload flows, while the mobile app provides camera capture, mode selection, speech, and haptic feedback. README describes a different Next.js layout and `/api/analyze`; the graph follows the supplied tree and sampled implementation, so unsampled feature wiring is omitted.

Main entry points: [`mobile/app/index.tsx`](https://github.com/hemanthvsp1/describeit/blob/main/mobile/app/index.tsx) (Mobile capture flow), [`server.js`](https://github.com/hemanthvsp1/describeit/blob/main/server.js) (Image analysis route), [`public/js/app.js`](https://github.com/hemanthvsp1/describeit/blob/main/public/js/app.js) (Web capture and modes), [`mobile/utils/api.ts`](https://github.com/hemanthvsp1/describeit/blob/main/mobile/utils/api.ts) (Mobile API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_ui["Web capture and modes<br/>[app.js]"]
  node_web_results["Results and history<br/>[app.js]"]
  node_web_shell["Web app shell<br/>[index.html]"]
end

subgraph group_native["Mobile experience"]
  node_mobile_screen["Mobile capture flow<br/>[index.tsx]"]
  node_mobile_camera["Camera controls<br/>[CaptureButton.tsx]"]
  node_mobile_modes["Mode selector<br/>[ModeToggle.tsx]"]
  node_mobile_result["Result card<br/>[ResultCard.tsx]"]
  node_mobile_api["Mobile API client<br/>[api.ts]"]
end

subgraph group_service["Analysis service"]
  node_server["Express service<br/>[server.js]"]
  node_analysis_route["Image analysis route<br/>[server.js]"]
  node_prompt_modes["Analysis prompts<br/>[server.js]"]
end

subgraph group_access["Accessibility and delivery"]
  node_web_speech["Browser speech<br/>[app.js]"]
  node_mobile_speech["Mobile speech<br/>[useSpeech.ts]"]
  node_voice_commands["Voice command stub<br/>[useVoiceCommand.ts]"]
  node_pwa_worker["Offline shell worker<br/>[sw.js]"]
end

node_web_user(("Web user"))
node_mobile_user(("Mobile user"))
node_vision_model["Anthropic vision model"]
node_browser_camera(("Device camera"))

node_web_user -->|"captures or uploads"| node_web_ui
node_web_ui -->|"captures image"| node_browser_camera
node_web_ui -->|"posts image"| node_analysis_route
node_analysis_route -->|"selects prompt"| node_prompt_modes
node_analysis_route -->|"submits image"| node_vision_model
node_vision_model -->|"returns description"| node_analysis_route
node_analysis_route -->|"returns description"| node_web_ui
node_web_ui -->|"displays and records"| node_web_results
node_web_results -->|"speaks result"| node_web_speech
node_web_user -->|"captures photo"| node_mobile_screen
node_mobile_screen -->|"invokes capture"| node_mobile_camera
node_mobile_screen -->|"selects mode"| node_mobile_modes
node_mobile_screen -->|"sends photo and mode"| node_mobile_api
node_mobile_api -->|"posts image"| node_analysis_route
node_analysis_route -->|"returns description"| node_mobile_api
node_mobile_api -->|"returns description"| node_mobile_screen
node_mobile_screen -->|"shows result"| node_mobile_result
node_mobile_screen -->|"speaks result"| node_mobile_speech
node_mobile_screen -->|"checks support"| node_voice_commands
node_server -->|"serves web assets"| node_web_shell
node_web_ui -->|"registers worker"| node_pwa_worker

click node_web_ui "https://github.com/hemanthvsp1/describeit/blob/main/public/js/app.js"
click node_web_results "https://github.com/hemanthvsp1/describeit/blob/main/public/js/app.js"
click node_web_shell "https://github.com/hemanthvsp1/describeit/blob/main/public/index.html"
click node_mobile_screen "https://github.com/hemanthvsp1/describeit/blob/main/mobile/app/index.tsx"
click node_mobile_camera "https://github.com/hemanthvsp1/describeit/blob/main/mobile/components/CaptureButton.tsx"
click node_mobile_modes "https://github.com/hemanthvsp1/describeit/blob/main/mobile/components/ModeToggle.tsx"
click node_mobile_result "https://github.com/hemanthvsp1/describeit/blob/main/mobile/components/ResultCard.tsx"
click node_mobile_api "https://github.com/hemanthvsp1/describeit/blob/main/mobile/utils/api.ts"
click node_server "https://github.com/hemanthvsp1/describeit/blob/main/server.js"
click node_analysis_route "https://github.com/hemanthvsp1/describeit/blob/main/server.js"
click node_prompt_modes "https://github.com/hemanthvsp1/describeit/blob/main/server.js"
click node_web_speech "https://github.com/hemanthvsp1/describeit/blob/main/public/js/app.js"
click node_mobile_speech "https://github.com/hemanthvsp1/describeit/blob/main/mobile/hooks/useSpeech.ts"
click node_voice_commands "https://github.com/hemanthvsp1/describeit/blob/main/mobile/hooks/useVoiceCommand.ts"
click node_pwa_worker "https://github.com/hemanthvsp1/describeit/blob/main/public/sw.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_web_ui,node_web_results,node_web_shell,node_web_user,node_mobile_user toneBlue
class node_mobile_screen,node_mobile_camera,node_mobile_modes,node_mobile_result,node_mobile_api toneAmber
class node_server,node_analysis_route,node_prompt_modes toneMint
class node_web_speech,node_mobile_speech,node_voice_commands,node_pwa_worker toneRose
class node_vision_model,node_browser_camera toneIndigo
```

## Components

### Web experience

- [Web capture and modes](https://github.com/hemanthvsp1/describeit/blob/main/public/js/app.js): `public/js/app.js`
- [Results and history](https://github.com/hemanthvsp1/describeit/blob/main/public/js/app.js): `public/js/app.js`
- [Web app shell](https://github.com/hemanthvsp1/describeit/blob/main/public/index.html): `public/index.html`

### Mobile experience

- [Mobile capture flow](https://github.com/hemanthvsp1/describeit/blob/main/mobile/app/index.tsx): `mobile/app/index.tsx`
- [Camera controls](https://github.com/hemanthvsp1/describeit/blob/main/mobile/components/CaptureButton.tsx): `mobile/components/CaptureButton.tsx`
- [Mode selector](https://github.com/hemanthvsp1/describeit/blob/main/mobile/components/ModeToggle.tsx): `mobile/components/ModeToggle.tsx`
- [Result card](https://github.com/hemanthvsp1/describeit/blob/main/mobile/components/ResultCard.tsx): `mobile/components/ResultCard.tsx`
- [Mobile API client](https://github.com/hemanthvsp1/describeit/blob/main/mobile/utils/api.ts): `mobile/utils/api.ts`

### Analysis service

- [Express service](https://github.com/hemanthvsp1/describeit/blob/main/server.js): `server.js`
- [Image analysis route](https://github.com/hemanthvsp1/describeit/blob/main/server.js): `server.js`
- [Analysis prompts](https://github.com/hemanthvsp1/describeit/blob/main/server.js): `server.js`

### Accessibility and delivery

- [Browser speech](https://github.com/hemanthvsp1/describeit/blob/main/public/js/app.js): `public/js/app.js`
- [Mobile speech](https://github.com/hemanthvsp1/describeit/blob/main/mobile/hooks/useSpeech.ts): `mobile/hooks/useSpeech.ts`
- [Voice command stub](https://github.com/hemanthvsp1/describeit/blob/main/mobile/hooks/useVoiceCommand.ts): `mobile/hooks/useVoiceCommand.ts`
- [Offline shell worker](https://github.com/hemanthvsp1/describeit/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Web user**
- **Mobile user**
- **Anthropic vision model**
- **Device camera**

## Connections

- Web user → Web capture and modes: captures or uploads
- Web capture and modes → Device camera: captures image
- Web capture and modes → Image analysis route: posts image
- Image analysis route → Analysis prompts: selects prompt
- Image analysis route → Anthropic vision model: submits image
- Anthropic vision model → Image analysis route: returns description
- Image analysis route → Web capture and modes: returns description
- Web capture and modes → Results and history: displays and records
- Results and history → Browser speech: speaks result
- Web user → Mobile capture flow: captures photo
- Mobile capture flow → Camera controls: invokes capture
- Mobile capture flow → Mode selector: selects mode
- Mobile capture flow → Mobile API client: sends photo and mode
- Mobile API client → Image analysis route: posts image
- Image analysis route → Mobile API client: returns description
- Mobile API client → Mobile capture flow: returns description
- Mobile capture flow → Result card: shows result
- Mobile capture flow → Mobile speech: speaks result
- Mobile capture flow → Voice command stub: checks support
- Express service → Web app shell: serves web assets
- Web capture and modes → Offline shell worker: registers worker
