# nareshchandu17/floravia architecture

> Architecture diagram of the GitHub repository nareshchandu17/floravia, 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/nareshchandu17/floravia
- Repository: https://github.com/nareshchandu17/floravia

## Overview

Floravia is a plant-care SPA with authenticated gardeners as its primary users. The central journey is account access, image-based identification or diagnosis, then saving plants and managing care over time; parallel workflows provide Sage AI guidance, localized weather, community exchange, and reminders. The graph combines sampled call sites with README-documented capabilities. Several App and service excerpts are partial, so uncertain internal wiring is omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/nareshchandu17/floravia/blob/main/src/App.tsx) (App router), [`src/services/firebase.ts`](https://github.com/nareshchandu17/floravia/blob/main/src/services/firebase.ts) (Firebase client), [`src/services/gemini.ts`](https://github.com/nareshchandu17/floravia/blob/main/src/services/gemini.ts) (Gemini AI), [`server.ts`](https://github.com/nareshchandu17/floravia/blob/main/server.ts) (Reminder dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["App and access"]
  node_app["App router<br/>[App.tsx]"]
  node_authui["Sign-in<br/>[AuthModal.tsx]"]
  node_authhook["Auth state<br/>[useAuth.ts]"]
end

subgraph group_plant["Plant intelligence"]
  node_identify["Plant identification<br/>[PlantAnalysis.tsx]"]
  node_diagnose["Disease diagnosis"]
  node_upload["Image input<br/>[ImageUploader.tsx]"]
  node_gemini["Gemini AI<br/>[gemini.ts]"]
  node_chatui["Sage chat<br/>[ChatBot.tsx]"]
  node_chathook["Chat orchestration<br/>[useChatBot.ts]"]
  node_voice["Voice interface<br/>[useVoice.ts]"]
end

subgraph group_care["Garden and care"]
  node_gardenui["Garden view<br/>[MyGarden.tsx]"]
  node_gardenhook["Garden state<br/>[useGarden.ts]"]
  node_carecalendar["Care calendar<br/>[CareCalendar.tsx]"]
  node_weatherui["Weather advice<br/>[WeatherWidget.tsx]"]
  node_weather["Weather service<br/>[weather.ts]"]
end

subgraph group_social["Community"]
  node_forumui["Community forum<br/>[CommunityForum.tsx]"]
  node_forumhook["Forum state<br/>[useForum.ts]"]
  node_forumservice["Forum service<br/>[forum.ts]"]
  node_tips["Community tips<br/>[communityTips.ts]"]
end

subgraph group_platform["Services and delivery"]
  node_firebase["Firebase client<br/>[firebase.ts]"]
  node_firestore[("Cloud Firestore")]
  node_server["Reminder dispatcher<br/>[server.ts]"]
  node_admin["Firebase Admin<br/>[firebase-admin.ts]"]
  node_push["Web push"]
end

node_gardener(("Gardener"))
node_weatherapi["OpenWeatherMap"]

node_gardener -->|"uses"| node_app
node_app -->|"opens auth"| node_authui
node_authui -->|"authenticates"| node_firebase
node_authhook -->|"tracks auth"| node_firebase
node_app -->|"accepts image"| node_upload
node_app -->|"shows analysis"| node_identify
node_app -->|"shows diagnosis"| node_diagnose
node_identify -->|"analyzes image"| node_gemini
node_diagnose -->|"diagnoses image"| node_gemini
node_app -->|"saves plants"| node_firebase
node_gardenui -->|"manages garden"| node_gardenhook
node_gardenhook -->|"reads and writes"| node_firebase
node_app -->|"opens care"| node_carecalendar
node_carecalendar -->|"manages reminders"| node_firebase
node_weatherui -->|"requests forecast"| node_weather
node_weather -.->|"fetches conditions"| node_weatherapi
node_gardener -->|"asks Sage"| node_chatui
node_chatui -->|"sends prompt"| node_chathook
node_chathook -->|"generates reply"| node_gemini
node_chathook -->|"loads context and saves chats"| node_firebase
node_chatui -->|"uses voice"| node_voice
node_voice -->|"transcribes and speaks"| node_gemini
node_app -->|"opens community"| node_forumui
node_forumui -->|"browses and posts"| node_forumhook
node_forumhook -->|"runs forum actions"| node_forumservice
node_forumservice -->|"reads and writes"| node_firebase
node_app -->|"loads care tips"| node_tips
node_server -->|"uses admin client"| node_admin
node_server -->|"queries due reminders"| node_firestore
node_server -->|"sends due alerts"| node_push
node_firebase -->|"reads and writes"| node_firestore

click node_app "https://github.com/nareshchandu17/floravia/blob/main/src/App.tsx"
click node_authui "https://github.com/nareshchandu17/floravia/blob/main/src/components/AuthModal.tsx"
click node_authhook "https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useAuth.ts"
click node_identify "https://github.com/nareshchandu17/floravia/blob/main/src/components/PlantAnalysis.tsx"
click node_diagnose "https://github.com/nareshchandu17/floravia/blob/main/src/components/DiseaseAnalysis.tsx"
click node_upload "https://github.com/nareshchandu17/floravia/blob/main/src/components/ImageUploader.tsx"
click node_gemini "https://github.com/nareshchandu17/floravia/blob/main/src/services/gemini.ts"
click node_gardenui "https://github.com/nareshchandu17/floravia/blob/main/src/components/MyGarden.tsx"
click node_gardenhook "https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useGarden.ts"
click node_carecalendar "https://github.com/nareshchandu17/floravia/blob/main/src/components/CareCalendar.tsx"
click node_weatherui "https://github.com/nareshchandu17/floravia/blob/main/src/components/WeatherWidget.tsx"
click node_weather "https://github.com/nareshchandu17/floravia/blob/main/src/services/weather.ts"
click node_chatui "https://github.com/nareshchandu17/floravia/blob/main/src/components/ChatBot.tsx"
click node_chathook "https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useChatBot.ts"
click node_voice "https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useVoice.ts"
click node_forumui "https://github.com/nareshchandu17/floravia/blob/main/src/components/forum/CommunityForum.tsx"
click node_forumhook "https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useForum.ts"
click node_forumservice "https://github.com/nareshchandu17/floravia/blob/main/src/services/forum.ts"
click node_tips "https://github.com/nareshchandu17/floravia/blob/main/src/services/communityTips.ts"
click node_firebase "https://github.com/nareshchandu17/floravia/blob/main/src/services/firebase.ts"
click node_server "https://github.com/nareshchandu17/floravia/blob/main/server.ts"
click node_admin "https://github.com/nareshchandu17/floravia/blob/main/src/services/firebase-admin.ts"
click node_push "https://github.com/nareshchandu17/floravia/blob/main/public/firebase-messaging-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_app,node_authui,node_authhook toneBlue
class node_identify,node_diagnose,node_upload,node_gemini,node_chatui,node_chathook,node_voice toneAmber
class node_gardenui,node_gardenhook,node_carecalendar,node_weatherui,node_weather toneMint
class node_forumui,node_forumhook,node_forumservice,node_tips toneRose
class node_firebase,node_firestore,node_server,node_admin,node_push,node_gardener,node_weatherapi toneIndigo
```

## Components

### App and access

- [App router](https://github.com/nareshchandu17/floravia/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in](https://github.com/nareshchandu17/floravia/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Auth state](https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`

### Plant intelligence

- [Plant identification](https://github.com/nareshchandu17/floravia/blob/main/src/components/PlantAnalysis.tsx): `src/components/PlantAnalysis.tsx`
- [Disease diagnosis](https://github.com/nareshchandu17/floravia/blob/main/src/components/DiseaseAnalysis.tsx): `src/components/DiseaseAnalysis.tsx`
- [Image input](https://github.com/nareshchandu17/floravia/blob/main/src/components/ImageUploader.tsx): `src/components/ImageUploader.tsx`
- [Gemini AI](https://github.com/nareshchandu17/floravia/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [Sage chat](https://github.com/nareshchandu17/floravia/blob/main/src/components/ChatBot.tsx): `src/components/ChatBot.tsx`
- [Chat orchestration](https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useChatBot.ts): `src/hooks/useChatBot.ts`
- [Voice interface](https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useVoice.ts): `src/hooks/useVoice.ts`

### Garden and care

- [Garden view](https://github.com/nareshchandu17/floravia/blob/main/src/components/MyGarden.tsx): `src/components/MyGarden.tsx`
- [Garden state](https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useGarden.ts): `src/hooks/useGarden.ts`
- [Care calendar](https://github.com/nareshchandu17/floravia/blob/main/src/components/CareCalendar.tsx): `src/components/CareCalendar.tsx`
- [Weather advice](https://github.com/nareshchandu17/floravia/blob/main/src/components/WeatherWidget.tsx): `src/components/WeatherWidget.tsx`
- [Weather service](https://github.com/nareshchandu17/floravia/blob/main/src/services/weather.ts): `src/services/weather.ts`

### Community

- [Community forum](https://github.com/nareshchandu17/floravia/blob/main/src/components/forum/CommunityForum.tsx): `src/components/forum/CommunityForum.tsx`
- [Forum state](https://github.com/nareshchandu17/floravia/blob/main/src/hooks/useForum.ts): `src/hooks/useForum.ts`
- [Forum service](https://github.com/nareshchandu17/floravia/blob/main/src/services/forum.ts): `src/services/forum.ts`
- [Community tips](https://github.com/nareshchandu17/floravia/blob/main/src/services/communityTips.ts): `src/services/communityTips.ts`

### Services and delivery

- [Firebase client](https://github.com/nareshchandu17/floravia/blob/main/src/services/firebase.ts): `src/services/firebase.ts`
- **Cloud Firestore**
- [Reminder dispatcher](https://github.com/nareshchandu17/floravia/blob/main/server.ts): `server.ts`
- [Firebase Admin](https://github.com/nareshchandu17/floravia/blob/main/src/services/firebase-admin.ts): `src/services/firebase-admin.ts`
- [Web push](https://github.com/nareshchandu17/floravia/blob/main/public/firebase-messaging-sw.js): `public/firebase-messaging-sw.js`

### Other components

- **Gardener**
- **OpenWeatherMap**

## Connections

- Gardener → App router: uses
- App router → Sign-in: opens auth
- Sign-in → Firebase client: authenticates
- Auth state → Firebase client: tracks auth
- App router → Image input: accepts image
- App router → Plant identification: shows analysis
- App router → Disease diagnosis: shows diagnosis
- Plant identification → Gemini AI: analyzes image
- Disease diagnosis → Gemini AI: diagnoses image
- App router → Firebase client: saves plants
- Garden view → Garden state: manages garden
- Garden state → Firebase client: reads and writes
- App router → Care calendar: opens care
- Care calendar → Firebase client: manages reminders
- Weather advice → Weather service: requests forecast
- Weather service → OpenWeatherMap: fetches conditions
- Gardener → Sage chat: asks Sage
- Sage chat → Chat orchestration: sends prompt
- Chat orchestration → Gemini AI: generates reply
- Chat orchestration → Firebase client: loads context and saves chats
- Sage chat → Voice interface: uses voice
- Voice interface → Gemini AI: transcribes and speaks
- App router → Community forum: opens community
- Community forum → Forum state: browses and posts
- Forum state → Forum service: runs forum actions
- Forum service → Firebase client: reads and writes
- App router → Community tips: loads care tips
- Reminder dispatcher → Firebase Admin: uses admin client
- Reminder dispatcher → Cloud Firestore: queries due reminders
- Reminder dispatcher → Web push: sends due alerts
- Firebase client → Cloud Firestore: reads and writes
