# veerapeetha7/test-ai-image-read architecture

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

- Interactive diagram: https://gitdiagram.com/veerapeetha7/test-ai-image-read
- Repository: https://github.com/veerapeetha7/test-ai-image-read

## Overview

FloraGuide AI is a React gardening assistant with two user workflows: identify a plant from an uploaded photo and receive care guidance, or ask a botanist chatbot gardening questions. The app shell selects and renders these workflows; both call a Gemini service that formats requests and returns responses. The typed data contracts are a small internal layer. Edges reflect the shown component calls and rendering; no persistence layer is present.

Main entry points: [`services/geminiService.ts`](https://github.com/veerapeetha7/test-ai-image-read/blob/main/services/geminiService.ts) (Gemini service), [`App.tsx`](https://github.com/veerapeetha7/test-ai-image-read/blob/main/App.tsx) (Mode shell), [`components/PlantAnalyzer.tsx`](https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/PlantAnalyzer.tsx) (Plant analyzer), [`components/ChatBot.tsx`](https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/ChatBot.tsx) (Garden chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_mount["React mount<br/>[index.tsx]"]
  node_app["Mode shell<br/>[App.tsx]"]
  node_header["Mode navigation<br/>[Header.tsx]"]
  node_analyzer["Plant analyzer<br/>[PlantAnalyzer.tsx]"]
  node_chat["Garden chat<br/>[ChatBot.tsx]"]
end

subgraph group_ai["AI services"]
  node_gemini["Gemini service<br/>[geminiService.ts]"]
  node_gemini_api["Gemini API"]
end

subgraph group_contracts["Domain contracts"]
  node_contracts["Typed contracts<br/>[types.ts]"]
end

node_gardener(("Gardener"))

node_gardener -->|"uses app"| node_mount
node_mount -->|"renders"| node_app
node_app -->|"renders"| node_header
node_header -->|"sets mode"| node_app
node_app -->|"renders identify"| node_analyzer
node_app -->|"renders chat"| node_chat
node_analyzer -->|"requests analysis"| node_gemini
node_gemini -->|"generates content"| node_gemini_api
node_gemini -->|"returns care data"| node_analyzer
node_chat -->|"sends chat"| node_gemini
node_gemini -->|"generates reply"| node_gemini_api
node_gemini -->|"returns reply"| node_chat
node_analyzer -->|"uses care type"| node_contracts
node_chat -->|"uses message type"| node_contracts
node_app -->|"uses mode type"| node_contracts
node_gemini -->|"returns care type"| node_contracts

click node_mount "https://github.com/veerapeetha7/test-ai-image-read/blob/main/index.tsx"
click node_app "https://github.com/veerapeetha7/test-ai-image-read/blob/main/App.tsx"
click node_header "https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/Header.tsx"
click node_analyzer "https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/PlantAnalyzer.tsx"
click node_chat "https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/ChatBot.tsx"
click node_gemini "https://github.com/veerapeetha7/test-ai-image-read/blob/main/services/geminiService.ts"
click node_contracts "https://github.com/veerapeetha7/test-ai-image-read/blob/main/types.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_mount,node_app,node_header,node_analyzer,node_chat toneBlue
class node_gemini,node_gemini_api toneAmber
class node_contracts toneMint
class node_gardener toneIndigo
```

## Components

### User interface

- [React mount](https://github.com/veerapeetha7/test-ai-image-read/blob/main/index.tsx): `index.tsx`
- [Mode shell](https://github.com/veerapeetha7/test-ai-image-read/blob/main/App.tsx): `App.tsx`
- [Mode navigation](https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/Header.tsx): `components/Header.tsx`
- [Plant analyzer](https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/PlantAnalyzer.tsx): `components/PlantAnalyzer.tsx`
- [Garden chat](https://github.com/veerapeetha7/test-ai-image-read/blob/main/components/ChatBot.tsx): `components/ChatBot.tsx`

### AI services

- [Gemini service](https://github.com/veerapeetha7/test-ai-image-read/blob/main/services/geminiService.ts): `services/geminiService.ts`
- **Gemini API**

### Domain contracts

- [Typed contracts](https://github.com/veerapeetha7/test-ai-image-read/blob/main/types.ts): `types.ts`

### Other components

- **Gardener**

## Connections

- Gardener → React mount: uses app
- React mount → Mode shell: renders (evidence: `index.tsx`)
- Mode shell → Mode navigation: renders (evidence: `App.tsx`)
- Mode navigation → Mode shell: sets mode (evidence: `App.tsx`)
- Mode shell → Plant analyzer: renders identify (evidence: `App.tsx`)
- Mode shell → Garden chat: renders chat (evidence: `App.tsx`)
- Plant analyzer → Gemini service: requests analysis (evidence: `components/PlantAnalyzer.tsx`)
- Gemini service → Gemini API: generates content (evidence: `services/geminiService.ts`)
- Gemini service → Plant analyzer: returns care data (evidence: `components/PlantAnalyzer.tsx`)
- Garden chat → Gemini service: sends chat (evidence: `components/ChatBot.tsx`)
- Gemini service → Gemini API: generates reply (evidence: `services/geminiService.ts`)
- Gemini service → Garden chat: returns reply (evidence: `components/ChatBot.tsx`)
- Plant analyzer → Typed contracts: uses care type (evidence: `components/PlantAnalyzer.tsx`)
- Garden chat → Typed contracts: uses message type (evidence: `components/ChatBot.tsx`)
- Mode shell → Typed contracts: uses mode type (evidence: `App.tsx`)
- Gemini service → Typed contracts: returns care type (evidence: `services/geminiService.ts`)
