# vigneshpulipati/insecdex architecture

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

- Interactive diagram: https://gitdiagram.com/vigneshpulipati/insecdex
- Repository: https://github.com/vigneshpulipati/insecdex

## Overview

InsecDex is a camera-first field identification web app. The user starts from the guide, captures or selects a specimen photo, and the app sends it through its API helper to the Node server, which requests a structured identification from Gemini. The result is shown as a specimen card and can be rendered as a shareable image. The graph covers the documented capture, identification, safety, and sharing capabilities; server behavior is represented by its single source file. Browser and device interactions are external to the repository.

Main entry points: [`src/App.jsx`](https://github.com/vigneshpulipati/insecdex/blob/main/src/App.jsx) (App state), [`src/components/CameraCapture.jsx`](https://github.com/vigneshpulipati/insecdex/blob/main/src/components/CameraCapture.jsx) (Photo capture), [`src/components/ShareResult.jsx`](https://github.com/vigneshpulipati/insecdex/blob/main/src/components/ShareResult.jsx) (Share controls), [`src/components/LandingPage.jsx`](https://github.com/vigneshpulipati/insecdex/blob/main/src/components/LandingPage.jsx) (Field guide)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App state<br/>[App.jsx]"]
  node_landing["Field guide<br/>[LandingPage.jsx]"]
  node_specimen_card["Specimen card<br/>[SpecimenCard.jsx]"]
end

subgraph group_capture["Specimen capture"]
  node_camera["Photo capture<br/>[CameraCapture.jsx]"]
end

subgraph group_identification["Identification"]
  node_api_helper["Identification client<br/>[gemini.js]"]
  node_api_server["Identify API<br/>[server.js]"]
end

subgraph group_sharing["Result sharing"]
  node_share_ui["Share controls<br/>[ShareResult.jsx]"]
  node_share_image["Share image renderer<br/>[shareResult.js]"]
end

node_observer(("Observer"))
node_device_camera["Device camera"]
node_image_file["Image file"]
node_gemini["Gemini service"]
node_browser_sharing["Browser sharing"]

node_observer -->|"opens guide"| node_landing
node_landing -->|"starts identification"| node_app
node_app -->|"renders capture"| node_camera
node_observer -->|"provides photo"| node_camera
node_camera -->|"requests camera"| node_device_camera
node_camera -->|"submits file"| node_app
node_app -->|"identifies photo"| node_api_helper
node_api_helper -->|"posts image"| node_api_server
node_api_server -->|"requests analysis"| node_gemini
node_app -->|"renders result"| node_specimen_card
node_app -->|"renders sharing"| node_share_ui
node_share_ui -->|"creates image"| node_share_image
node_share_ui -->|"shares or downloads"| node_browser_sharing

click node_app "https://github.com/vigneshpulipati/insecdex/blob/main/src/App.jsx"
click node_landing "https://github.com/vigneshpulipati/insecdex/blob/main/src/components/LandingPage.jsx"
click node_camera "https://github.com/vigneshpulipati/insecdex/blob/main/src/components/CameraCapture.jsx"
click node_api_helper "https://github.com/vigneshpulipati/insecdex/blob/main/src/lib/gemini.js"
click node_api_server "https://github.com/vigneshpulipati/insecdex/blob/main/server.js"
click node_specimen_card "https://github.com/vigneshpulipati/insecdex/blob/main/src/components/SpecimenCard.jsx"
click node_share_ui "https://github.com/vigneshpulipati/insecdex/blob/main/src/components/ShareResult.jsx"
click node_share_image "https://github.com/vigneshpulipati/insecdex/blob/main/src/lib/shareResult.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_app,node_landing,node_specimen_card,node_browser_sharing toneBlue
class node_camera toneAmber
class node_api_helper,node_api_server,node_observer toneMint
class node_share_ui,node_share_image toneRose
class node_device_camera,node_image_file,node_gemini toneIndigo
```

## Components

### App experience

- [App state](https://github.com/vigneshpulipati/insecdex/blob/main/src/App.jsx): `src/App.jsx`
- [Field guide](https://github.com/vigneshpulipati/insecdex/blob/main/src/components/LandingPage.jsx): `src/components/LandingPage.jsx`
- [Specimen card](https://github.com/vigneshpulipati/insecdex/blob/main/src/components/SpecimenCard.jsx): `src/components/SpecimenCard.jsx`

### Specimen capture

- [Photo capture](https://github.com/vigneshpulipati/insecdex/blob/main/src/components/CameraCapture.jsx): `src/components/CameraCapture.jsx`

### Identification

- [Identification client](https://github.com/vigneshpulipati/insecdex/blob/main/src/lib/gemini.js): `src/lib/gemini.js`
- [Identify API](https://github.com/vigneshpulipati/insecdex/blob/main/server.js): `server.js`

### Result sharing

- [Share controls](https://github.com/vigneshpulipati/insecdex/blob/main/src/components/ShareResult.jsx): `src/components/ShareResult.jsx`
- [Share image renderer](https://github.com/vigneshpulipati/insecdex/blob/main/src/lib/shareResult.js): `src/lib/shareResult.js`

### Other components

- **Observer**
- **Device camera**
- **Image file**
- **Gemini service**
- **Browser sharing**

## Connections

- Observer → Field guide: opens guide (evidence: `src/components/LandingPage.jsx`)
- Field guide → App state: starts identification (evidence: `src/App.jsx`)
- App state → Photo capture: renders capture (evidence: `src/App.jsx`)
- Observer → Photo capture: provides photo (evidence: `src/components/CameraCapture.jsx`)
- Photo capture → Device camera: requests camera (evidence: `src/components/CameraCapture.jsx`)
- Photo capture → App state: submits file (evidence: `src/App.jsx`)
- App state → Identification client: identifies photo (evidence: `src/App.jsx`)
- Identification client → Identify API: posts image (evidence: `src/lib/gemini.js`)
- Identify API → Gemini service: requests analysis (evidence: `server.js`)
- App state → Specimen card: renders result (evidence: `src/App.jsx`)
- App state → Share controls: renders sharing (evidence: `src/App.jsx`)
- Share controls → Share image renderer: creates image (evidence: `src/components/ShareResult.jsx`)
- Share controls → Browser sharing: shares or downloads (evidence: `src/components/ShareResult.jsx`)
