# lucasmonichonsmoove/flora-app architecture

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

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

## Overview

Flora is a responsive plant-identification and care app. The main journey is photo upload → server-side Pl@ntNet identification → enriched result display, with signed-in users’ identifications saved to history. Separate branches support account access, favorites, plant search, and an owned collection with image uploads and watering tracking. The README documents the broader capabilities; some page and helper implementations were not sampled, so their internal links are shown only where supported by the README or source index.

Main entry points: [`src/lib/favorites.ts`](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/favorites.ts) (Favorites, collection, history), [`src/lib/supabase.ts`](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/supabase.ts) (Supabase client), [`src/app/page.tsx`](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/page.tsx) (Identify plant), [`src/components/ResultCard.tsx`](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/ResultCard.tsx) (Identification result)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identify["Identification"]
  node_home["Identify plant<br/>[page.tsx]"]
  node_upload["Photo upload<br/>[UploadZone.tsx]"]
  node_identify_api["Identification API<br/>[route.ts]"]
  node_result["Identification result<br/>[ResultCard.tsx]"]
end

subgraph group_garden["Plant management"]
  node_collection["Plant collection<br/>[page.tsx]"]
  node_collection_form["Collection editor"]
  node_add_plant["Manual plant entry"]
  node_search_input["Plant search"]
  node_search_api["Plant search API<br/>[route.ts]"]
  node_image_storage["Plant image storage<br/>[storage.ts]"]
end

subgraph group_account["Accounts and records"]
  node_history["Identification history<br/>[page.tsx]"]
  node_login["Email sign-in<br/>[page.tsx]"]
  node_account_page["Account page<br/>[page.tsx]"]
  node_header["Navigation and session<br/>[Header.tsx]"]
  node_favorites_page["Favorites<br/>[page.tsx]"]
  node_plant_records["Favorites, collection, history<br/>[favorites.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_supabase_db[("Supabase database<br/>[schema.sql]")]
  node_proxy["Session refresh proxy<br/>[proxy.ts]"]
end

subgraph group_knowledge["Plant knowledge"]
  node_care_card["Care guide display<br/>[PlantCareCard.tsx]"]
  node_care_data["Care guidance<br/>[plant-care.ts]"]
  node_local_plants["Local plant data<br/>[plants.ts]"]
end

node_visitor(("Plant enthusiast"))
node_plantnet{{"Pl@ntNet API"}}
node_wikipedia{{"Wikipedia"}}
node_supabase_storage[("Supabase Storage")]

node_visitor -->|"starts identification"| node_home
node_home -->|"selects photo"| node_upload
node_home -->|"posts image"| node_identify_api
node_identify_api -->|"requests identification"| node_plantnet
node_identify_api -->|"gets plant details"| node_wikipedia
node_home -->|"renders result"| node_result
node_result -->|"shows care"| node_care_card
node_care_card -->|"loads guidance"| node_care_data
node_home -->|"saves identification"| node_history
node_visitor -->|"signs in"| node_login
node_login -->|"authenticates"| node_supabase_client
node_header -->|"reads session"| node_supabase_client
node_proxy -->|"refreshes session"| node_supabase_client
node_visitor -->|"views favorites"| node_favorites_page
node_result -->|"adds favorite"| node_plant_records
node_history -->|"loads history"| node_plant_records
node_favorites_page -->|"loads favorites"| node_plant_records
node_collection -->|"loads and updates plants"| node_plant_records
node_collection -->|"opens editor"| node_collection_form
node_visitor -->|"adds plant"| node_add_plant
node_add_plant -->|"searches suggestions"| node_search_input
node_search_input -->|"searches user plants"| node_plant_records
node_search_input -->|"searches local data"| node_local_plants
node_search_api -->|"searches plant topics"| node_wikipedia
node_plant_records -->|"queries records"| node_supabase_client
node_supabase_client -->|"reads and writes"| node_supabase_db
node_collection_form -->|"uploads images"| node_image_storage
node_collection -->|"deletes images"| node_image_storage
node_image_storage -->|"uses client"| node_supabase_client
node_image_storage -->|"stores images"| node_supabase_storage
node_result -->|"opens plant entry"| node_collection_form

click node_home "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/page.tsx"
click node_upload "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/UploadZone.tsx"
click node_identify_api "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/api/identify/route.ts"
click node_result "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/ResultCard.tsx"
click node_history "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/history/page.tsx"
click node_login "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/login/page.tsx"
click node_account_page "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/account/page.tsx"
click node_header "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/Header.tsx"
click node_favorites_page "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/favorites/page.tsx"
click node_collection "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/collection/page.tsx"
click node_collection_form "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/CollectionPlantForm.tsx"
click node_add_plant "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/ManualPlantForm.tsx"
click node_search_input "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/PlantSearchInput.tsx"
click node_search_api "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/api/plants/search/route.ts"
click node_care_card "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/PlantCareCard.tsx"
click node_care_data "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/plant-care.ts"
click node_local_plants "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/data/plants.ts"
click node_plant_records "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/favorites.ts"
click node_supabase_client "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/supabase.ts"
click node_supabase_db "https://github.com/lucasmonichonsmoove/flora-app/blob/main/supabase/schema.sql"
click node_image_storage "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/storage.ts"
click node_proxy "https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/proxy.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_home,node_upload,node_identify_api,node_result toneBlue
class node_collection,node_collection_form,node_add_plant,node_search_input,node_search_api,node_image_storage,node_supabase_storage toneAmber
class node_history,node_login,node_account_page,node_header,node_favorites_page,node_plant_records,node_supabase_client,node_supabase_db,node_proxy,node_plantnet toneMint
class node_care_card,node_care_data,node_local_plants toneRose
class node_visitor,node_wikipedia toneIndigo
```

## Components

### Identification

- [Identify plant](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Photo upload](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/UploadZone.tsx): `src/components/UploadZone.tsx`
- [Identification API](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/api/identify/route.ts): `src/app/api/identify/route.ts`
- [Identification result](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/ResultCard.tsx): `src/components/ResultCard.tsx`

### Plant management

- [Plant collection](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/collection/page.tsx): `src/app/collection/page.tsx`
- [Collection editor](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/CollectionPlantForm.tsx): `src/components/CollectionPlantForm.tsx`
- [Manual plant entry](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/ManualPlantForm.tsx): `src/components/ManualPlantForm.tsx`
- [Plant search](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/PlantSearchInput.tsx): `src/components/PlantSearchInput.tsx`
- [Plant search API](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/api/plants/search/route.ts): `src/app/api/plants/search/route.ts`
- [Plant image storage](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/storage.ts): `src/lib/storage.ts`

### Accounts and records

- [Identification history](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/history/page.tsx): `src/app/history/page.tsx`
- [Email sign-in](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Account page](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/account/page.tsx): `src/app/account/page.tsx`
- [Navigation and session](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Favorites](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/app/favorites/page.tsx): `src/app/favorites/page.tsx`
- [Favorites, collection, history](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/favorites.ts): `src/lib/favorites.ts`
- [Supabase client](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Supabase database](https://github.com/lucasmonichonsmoove/flora-app/blob/main/supabase/schema.sql): `supabase/schema.sql`
- [Session refresh proxy](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/proxy.ts): `src/proxy.ts`

### Plant knowledge

- [Care guide display](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/components/PlantCareCard.tsx): `src/components/PlantCareCard.tsx`
- [Care guidance](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/lib/plant-care.ts): `src/lib/plant-care.ts`
- [Local plant data](https://github.com/lucasmonichonsmoove/flora-app/blob/main/src/data/plants.ts): `src/data/plants.ts`

### Other components

- **Plant enthusiast**
- **Pl@ntNet API**
- **Wikipedia**
- **Supabase Storage**

## Connections

- Plant enthusiast → Identify plant: starts identification (evidence: `README.md`)
- Identify plant → Photo upload: selects photo (evidence: `src/app/page.tsx`)
- Identify plant → Identification API: posts image (evidence: `src/app/page.tsx`)
- Identification API → Pl@ntNet API: requests identification (evidence: `src/app/api/identify/route.ts`)
- Identification API → Wikipedia: gets plant details (evidence: `src/app/api/identify/route.ts`)
- Identify plant → Identification result: renders result (evidence: `src/app/page.tsx`)
- Identification result → Care guide display: shows care (evidence: `src/components/ResultCard.tsx`)
- Care guide display → Care guidance: loads guidance (evidence: `src/components/PlantCareCard.tsx`)
- Identify plant → Identification history: saves identification (evidence: `README.md`)
- Plant enthusiast → Email sign-in: signs in (evidence: `README.md`)
- Email sign-in → Supabase client: authenticates (evidence: `src/app/login/page.tsx`)
- Navigation and session → Supabase client: reads session (evidence: `src/components/Header.tsx`)
- Session refresh proxy → Supabase client: refreshes session (evidence: `README.md`)
- Plant enthusiast → Favorites: views favorites (evidence: `README.md`)
- Identification result → Favorites, collection, history: adds favorite (evidence: `src/components/ResultCard.tsx`)
- Identification history → Favorites, collection, history: loads history (evidence: `src/app/history/page.tsx`)
- Favorites → Favorites, collection, history: loads favorites (evidence: `src/app/favorites/page.tsx`)
- Plant collection → Favorites, collection, history: loads and updates plants (evidence: `src/app/collection/page.tsx`)
- Plant collection → Collection editor: opens editor (evidence: `src/app/collection/page.tsx`)
- Plant enthusiast → Manual plant entry: adds plant (evidence: `README.md`)
- Manual plant entry → Plant search: searches suggestions (evidence: `src/components/ManualPlantForm.tsx`)
- Plant search → Favorites, collection, history: searches user plants (evidence: `src/components/PlantSearchInput.tsx`)
- Plant search → Local plant data: searches local data (evidence: `src/components/PlantSearchInput.tsx`)
- Plant search API → Wikipedia: searches plant topics (evidence: `src/app/api/plants/search/route.ts`)
- Favorites, collection, history → Supabase client: queries records (evidence: `src/lib/favorites.ts`)
- Supabase client → Supabase database: reads and writes
- Collection editor → Plant image storage: uploads images (evidence: `src/components/CollectionPlantForm.tsx`)
- Plant collection → Plant image storage: deletes images (evidence: `src/app/collection/page.tsx`)
- Plant image storage → Supabase client: uses client (evidence: `src/lib/storage.ts`)
- Plant image storage → Supabase Storage: stores images (evidence: `README.md`)
- Identification result → Collection editor: opens plant entry (evidence: `README.md`)
