# avinaashv23/flora architecture

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

- Interactive diagram: https://gitdiagram.com/avinaashv23/flora
- Repository: https://github.com/avinaashv23/flora

## Overview

FloraVeda is a plant-care web app whose main user journey moves from onboarding or sign-in into plant browsing, scanning a leaf, and viewing a disease report; signed-in users can also manage care tasks and favorites. The React app coordinates screens and state, with feature hooks and libraries connecting to Supabase, weather services, and AI diagnosis. The README documents major capabilities and integrations; sampled source confirms several service calls, but unsampled screen wiring and some backend details are represented only where documented.

Main entry points: [`src/App.tsx`](https://github.com/avinaashv23/flora/blob/main/src/App.tsx) (App coordinator), [`src/lib/supabase.ts`](https://github.com/avinaashv23/flora/blob/main/src/lib/supabase.ts) (Supabase client), [`src/components/CategoryList.tsx`](https://github.com/avinaashv23/flora/blob/main/src/components/CategoryList.tsx) (Plant catalog), [`src/lib/diagnosis.ts`](https://github.com/avinaashv23/flora/blob/main/src/lib/diagnosis.ts) (Diagnosis service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_onboarding["Onboarding"]
  node_navigation["Navigation<br/>[Navigation.tsx]"]
  node_home["Home dashboard<br/>[HomeDashboard.tsx]"]
end

subgraph group_plant["Plant knowledge"]
  node_catalog["Plant catalog<br/>[CategoryList.tsx]"]
  node_plantdetail["Plant details<br/>[PlantDetail.tsx]"]
  node_plantdata["Plant fallback data<br/>[plantData.ts]"]
  node_scanner["Leaf scanner<br/>[ScanCamera.tsx]"]
  node_report["Diagnosis report"]
  node_plantslib["Plant and favorites service<br/>[plants.ts]"]
  node_staticdata["Static plant data<br/>[plantData.ts]"]
end

subgraph group_care["Care and alerts"]
  node_careui["Care schedule"]
  node_carelib["Care task service<br/>[careTasks.ts]"]
  node_weatherhook["Weather state<br/>[useWeather.ts]"]
  node_weatherlib["Weather service<br/>[weather.ts]"]
  node_notifications["Notification service<br/>[notifications.ts]"]
  node_notificationui["Notification view"]
end

subgraph group_identity["Identity and preferences"]
  node_authui["Authentication screens<br/>[AuthScreens.tsx]"]
  node_authhook["Authentication state<br/>[useAuth.ts]"]
  node_authlib["Auth service<br/>[auth.ts]"]
  node_profile["Profile screen<br/>[ProfileScreen.tsx]"]
  node_profilelib["Profile service<br/>[profile.ts]"]
  node_settings["Settings<br/>[SettingsScreen.tsx]"]
  node_language["Language hook<br/>[useLanguage.ts]"]
  node_translations["Translations<br/>[translations.ts]"]
end

subgraph group_backend["Data and diagnosis"]
  node_diagnosis["Diagnosis service<br/>[diagnosis.ts]"]
  node_diagnosefn["Diagnosis Edge Function<br/>[index.ts]"]
  node_storage["Image storage service<br/>[storage.ts]"]
  node_supabase["Supabase client<br/>[supabase.ts]"]
  node_database[("Supabase database")]
end

node_gardener(("Gardener"))
node_gemini["Gemini Vision"]
node_weatherapi["Weather and geocoding"]

node_gardener -->|"uses"| node_app
node_app -->|"routes to"| node_onboarding
node_app -->|"renders"| node_navigation
node_app -->|"routes to"| node_home
node_app -->|"renders"| node_catalog
node_catalog -->|"opens"| node_plantdetail
node_catalog -->|"fetches plants"| node_plantslib
node_catalog -->|"falls back to"| node_plantdata
node_home -->|"starts scan"| node_scanner
node_scanner -->|"requests diagnosis"| node_diagnosis
node_diagnosis -->|"invokes"| node_diagnosefn
node_diagnosefn -->|"analyzes image"| node_gemini
node_scanner -->|"shows result"| node_report
node_home -->|"displays weather"| node_weatherhook
node_settings -->|"controls weather"| node_weatherhook
node_weatherhook -->|"fetches and caches"| node_weatherlib
node_weatherlib -->|"requests conditions"| node_weatherapi
node_weatherhook -->|"adds alerts"| node_notifications
node_app -->|"routes to"| node_careui
node_careui -->|"manages tasks"| node_carelib
node_carelib -->|"reads and writes"| node_supabase
node_app -->|"loads notifications"| node_notifications
node_notificationui -->|"manages notifications"| node_notifications
node_notifications -->|"reads and writes"| node_supabase
node_authui -->|"submits credentials"| node_authhook
node_authhook -->|"calls auth actions"| node_authlib
node_authhook -->|"loads profile"| node_profilelib
node_authlib -->|"uses auth"| node_supabase
node_profile -->|"reads and updates"| node_profilelib
node_profilelib -->|"uploads avatar"| node_storage
node_settings -->|"changes language"| node_language
node_language -->|"selects strings"| node_translations
node_plantslib -->|"reads and writes"| node_supabase
node_diagnosis -->|"uses fallback results"| node_plantdata
node_diagnosis -->|"uses client"| node_supabase
node_storage -->|"uploads images"| node_supabase
node_supabase -->|"accesses tables"| node_database

click node_app "https://github.com/avinaashv23/flora/blob/main/src/App.tsx"
click node_onboarding "https://github.com/avinaashv23/flora/blob/main/src/components/OnboardingScreens.tsx"
click node_navigation "https://github.com/avinaashv23/flora/blob/main/src/components/Navigation.tsx"
click node_home "https://github.com/avinaashv23/flora/blob/main/src/components/HomeDashboard.tsx"
click node_catalog "https://github.com/avinaashv23/flora/blob/main/src/components/CategoryList.tsx"
click node_plantdetail "https://github.com/avinaashv23/flora/blob/main/src/components/PlantDetail.tsx"
click node_plantdata "https://github.com/avinaashv23/flora/blob/main/src/data/plantData.ts"
click node_scanner "https://github.com/avinaashv23/flora/blob/main/src/components/ScanCamera.tsx"
click node_diagnosis "https://github.com/avinaashv23/flora/blob/main/src/lib/diagnosis.ts"
click node_diagnosefn "https://github.com/avinaashv23/flora/blob/main/supabase/functions/diagnose-plant/index.ts"
click node_report "https://github.com/avinaashv23/flora/blob/main/src/components/DiagnosisDetail.tsx"
click node_careui "https://github.com/avinaashv23/flora/blob/main/src/components/CareScheduleModal.tsx"
click node_carelib "https://github.com/avinaashv23/flora/blob/main/src/lib/careTasks.ts"
click node_weatherhook "https://github.com/avinaashv23/flora/blob/main/src/hooks/useWeather.ts"
click node_weatherlib "https://github.com/avinaashv23/flora/blob/main/src/lib/weather.ts"
click node_notifications "https://github.com/avinaashv23/flora/blob/main/src/lib/notifications.ts"
click node_notificationui "https://github.com/avinaashv23/flora/blob/main/src/components/NotificationModal.tsx"
click node_authui "https://github.com/avinaashv23/flora/blob/main/src/components/AuthScreens.tsx"
click node_authhook "https://github.com/avinaashv23/flora/blob/main/src/hooks/useAuth.ts"
click node_authlib "https://github.com/avinaashv23/flora/blob/main/src/lib/auth.ts"
click node_profile "https://github.com/avinaashv23/flora/blob/main/src/components/ProfileScreen.tsx"
click node_profilelib "https://github.com/avinaashv23/flora/blob/main/src/lib/profile.ts"
click node_settings "https://github.com/avinaashv23/flora/blob/main/src/components/SettingsScreen.tsx"
click node_language "https://github.com/avinaashv23/flora/blob/main/src/i18n/useLanguage.ts"
click node_translations "https://github.com/avinaashv23/flora/blob/main/src/i18n/translations.ts"
click node_plantslib "https://github.com/avinaashv23/flora/blob/main/src/lib/plants.ts"
click node_storage "https://github.com/avinaashv23/flora/blob/main/src/lib/storage.ts"
click node_supabase "https://github.com/avinaashv23/flora/blob/main/src/lib/supabase.ts"
click node_database "https://github.com/avinaashv23/flora/tree/main/supabase/migrations"
click node_staticdata "https://github.com/avinaashv23/flora/blob/main/src/data/plantData.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_onboarding,node_navigation,node_home toneBlue
class node_catalog,node_plantdetail,node_plantdata,node_scanner,node_report,node_plantslib,node_staticdata toneAmber
class node_careui,node_carelib,node_weatherhook,node_weatherlib,node_notifications,node_notificationui toneMint
class node_authui,node_authhook,node_authlib,node_profile,node_profilelib,node_settings,node_language,node_translations toneRose
class node_diagnosis,node_diagnosefn,node_storage,node_supabase,node_database,node_gardener,node_gemini,node_weatherapi toneIndigo
```

## Components

### App experience

- [App coordinator](https://github.com/avinaashv23/flora/blob/main/src/App.tsx): `src/App.tsx`
- [Onboarding](https://github.com/avinaashv23/flora/blob/main/src/components/OnboardingScreens.tsx): `src/components/OnboardingScreens.tsx`
- [Navigation](https://github.com/avinaashv23/flora/blob/main/src/components/Navigation.tsx): `src/components/Navigation.tsx`
- [Home dashboard](https://github.com/avinaashv23/flora/blob/main/src/components/HomeDashboard.tsx): `src/components/HomeDashboard.tsx`

### Plant knowledge

- [Plant catalog](https://github.com/avinaashv23/flora/blob/main/src/components/CategoryList.tsx): `src/components/CategoryList.tsx`
- [Plant details](https://github.com/avinaashv23/flora/blob/main/src/components/PlantDetail.tsx): `src/components/PlantDetail.tsx`
- [Plant fallback data](https://github.com/avinaashv23/flora/blob/main/src/data/plantData.ts): `src/data/plantData.ts`
- [Leaf scanner](https://github.com/avinaashv23/flora/blob/main/src/components/ScanCamera.tsx): `src/components/ScanCamera.tsx`
- [Diagnosis report](https://github.com/avinaashv23/flora/blob/main/src/components/DiagnosisDetail.tsx): `src/components/DiagnosisDetail.tsx`
- [Plant and favorites service](https://github.com/avinaashv23/flora/blob/main/src/lib/plants.ts): `src/lib/plants.ts`
- [Static plant data](https://github.com/avinaashv23/flora/blob/main/src/data/plantData.ts): `src/data/plantData.ts`

### Care and alerts

- [Care schedule](https://github.com/avinaashv23/flora/blob/main/src/components/CareScheduleModal.tsx): `src/components/CareScheduleModal.tsx`
- [Care task service](https://github.com/avinaashv23/flora/blob/main/src/lib/careTasks.ts): `src/lib/careTasks.ts`
- [Weather state](https://github.com/avinaashv23/flora/blob/main/src/hooks/useWeather.ts): `src/hooks/useWeather.ts`
- [Weather service](https://github.com/avinaashv23/flora/blob/main/src/lib/weather.ts): `src/lib/weather.ts`
- [Notification service](https://github.com/avinaashv23/flora/blob/main/src/lib/notifications.ts): `src/lib/notifications.ts`
- [Notification view](https://github.com/avinaashv23/flora/blob/main/src/components/NotificationModal.tsx): `src/components/NotificationModal.tsx`

### Identity and preferences

- [Authentication screens](https://github.com/avinaashv23/flora/blob/main/src/components/AuthScreens.tsx): `src/components/AuthScreens.tsx`
- [Authentication state](https://github.com/avinaashv23/flora/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Auth service](https://github.com/avinaashv23/flora/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Profile screen](https://github.com/avinaashv23/flora/blob/main/src/components/ProfileScreen.tsx): `src/components/ProfileScreen.tsx`
- [Profile service](https://github.com/avinaashv23/flora/blob/main/src/lib/profile.ts): `src/lib/profile.ts`
- [Settings](https://github.com/avinaashv23/flora/blob/main/src/components/SettingsScreen.tsx): `src/components/SettingsScreen.tsx`
- [Language hook](https://github.com/avinaashv23/flora/blob/main/src/i18n/useLanguage.ts): `src/i18n/useLanguage.ts`
- [Translations](https://github.com/avinaashv23/flora/blob/main/src/i18n/translations.ts): `src/i18n/translations.ts`

### Data and diagnosis

- [Diagnosis service](https://github.com/avinaashv23/flora/blob/main/src/lib/diagnosis.ts): `src/lib/diagnosis.ts`
- [Diagnosis Edge Function](https://github.com/avinaashv23/flora/blob/main/supabase/functions/diagnose-plant/index.ts): `supabase/functions/diagnose-plant/index.ts`
- [Image storage service](https://github.com/avinaashv23/flora/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Supabase client](https://github.com/avinaashv23/flora/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Supabase database](https://github.com/avinaashv23/flora/tree/main/supabase/migrations): `supabase/migrations`

### Other components

- **Gardener**
- **Gemini Vision**
- **Weather and geocoding**

## Connections

- Gardener → App coordinator: uses (evidence: `README.md`)
- App coordinator → Onboarding: routes to (evidence: `src/App.tsx`)
- App coordinator → Navigation: renders (evidence: `src/App.tsx`)
- App coordinator → Home dashboard: routes to (evidence: `README.md`)
- App coordinator → Plant catalog: renders (evidence: `src/App.tsx`)
- Plant catalog → Plant details: opens (evidence: `README.md`)
- Plant catalog → Plant and favorites service: fetches plants (evidence: `src/components/CategoryList.tsx`)
- Plant catalog → Plant fallback data: falls back to (evidence: `src/components/CategoryList.tsx`)
- Home dashboard → Leaf scanner: starts scan (evidence: `README.md`)
- Leaf scanner → Diagnosis service: requests diagnosis (evidence: `src/components/ScanCamera.tsx`)
- Diagnosis service → Diagnosis Edge Function: invokes (evidence: `README.md`)
- Diagnosis Edge Function → Gemini Vision: analyzes image (evidence: `README.md`)
- Leaf scanner → Diagnosis report: shows result (evidence: `README.md`)
- Home dashboard → Weather state: displays weather (evidence: `src/components/HomeDashboard.tsx`)
- Settings → Weather state: controls weather (evidence: `src/components/SettingsScreen.tsx`)
- Weather state → Weather service: fetches and caches (evidence: `src/hooks/useWeather.ts`)
- Weather service → Weather and geocoding: requests conditions (evidence: `README.md`)
- Weather state → Notification service: adds alerts (evidence: `src/hooks/useWeather.ts`)
- App coordinator → Care schedule: routes to (evidence: `README.md`)
- Care schedule → Care task service: manages tasks (evidence: `README.md`)
- Care task service → Supabase client: reads and writes (evidence: `src/lib/careTasks.ts`)
- App coordinator → Notification service: loads notifications (evidence: `src/App.tsx`)
- Notification view → Notification service: manages notifications (evidence: `README.md`)
- Notification service → Supabase client: reads and writes (evidence: `src/lib/notifications.ts`)
- Authentication screens → Authentication state: submits credentials (evidence: `README.md`)
- Authentication state → Auth service: calls auth actions (evidence: `src/hooks/useAuth.ts`)
- Authentication state → Profile service: loads profile (evidence: `src/hooks/useAuth.ts`)
- Auth service → Supabase client: uses auth (evidence: `src/lib/auth.ts`)
- Profile screen → Profile service: reads and updates (evidence: `src/components/ProfileScreen.tsx`)
- Profile service → Image storage service: uploads avatar (evidence: `src/lib/profile.ts`)
- Settings → Language hook: changes language (evidence: `README.md`)
- Language hook → Translations: selects strings (evidence: `src/i18n/useLanguage.ts`)
- Plant and favorites service → Supabase client: reads and writes (evidence: `src/lib/plants.ts`)
- Diagnosis service → Plant fallback data: uses fallback results (evidence: `src/lib/diagnosis.ts`)
- Diagnosis service → Supabase client: uses client (evidence: `src/lib/diagnosis.ts`)
- Image storage service → Supabase client: uploads images (evidence: `src/lib/storage.ts`)
- Supabase client → Supabase database: accesses tables (evidence: `README.md`)
