# kaowri48/plant_care architecture

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

- Interactive diagram: https://gitdiagram.com/kaowri48/plant_care
- Repository: https://github.com/kaowri48/plant_care

## Overview

PlantCare is a desktop plant-care manager. The user launches the Qt application into a dashboard, then adds or edits plants, reviews the collection and watering schedule, records watering, and consults care history; data is persisted in a JSON file. The graph follows observed module calls and imports from the excerpts and source index. Dashboard routing to subsidiary windows is only partly visible, so uncertain navigation links are omitted; schedule, history, and settings remain represented as documented UI modules.

Main entry points: [`01_Source_Code/dashboard.py`](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/dashboard.py) (Dashboard), [`01_Source_Code/database.py`](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/database.py) (Care data operations), [`01_Source_Code/my_plants.py`](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/my_plants.py) (My plants), [`01_Source_Code/schedule.py`](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/schedule.py) (Watering schedule)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_launch["App launcher<br/>[main.py]"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
end

subgraph group_care["Plant care workflows"]
  node_add["Add plant dialog<br/>[add_plant.py]"]
  node_edit["Edit plant dialog<br/>[edit_plant.py]"]
end

subgraph group_views["Tracking views"]
  node_collection["My plants<br/>[my_plants.py]"]
  node_schedule["Watering schedule<br/>[schedule.py]"]
  node_history["Care history<br/>[history.py]"]
  node_settings["Settings<br/>[settings.py]"]
end

subgraph group_persistence["Local persistence"]
  node_plant_api["Plant data access<br/>[plants.py]"]
  node_database["Care data operations<br/>[database.py]"]
  node_json[("Plant care JSON")]
end

node_user(("PlantCare user"))

node_user -->|"launches"| node_launch
node_launch -->|"opens"| node_dashboard
node_dashboard -->|"loads plants"| node_plant_api
node_dashboard -->|"loads stats"| node_database
node_dashboard -->|"opens dialog"| node_add
node_dashboard -->|"opens dialog"| node_edit
node_dashboard -.->|"imports view"| node_collection
node_dashboard -.->|"imports view"| node_history
node_dashboard -.->|"imports view"| node_schedule
node_dashboard -.->|"imports view"| node_settings
node_collection -->|"loads plants"| node_plant_api
node_collection -->|"opens dialog"| node_add
node_add -->|"adds plant"| node_database
node_edit -->|"updates plant"| node_database
node_schedule -->|"loads schedule"| node_database
node_schedule -->|"records watering"| node_database
node_history -->|"loads history"| node_database
node_plant_api -->|"delegates reads"| node_database
node_database -.->|"reads and writes"| node_json

click node_launch "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/main.py"
click node_dashboard "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/dashboard.py"
click node_collection "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/my_plants.py"
click node_add "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/add_plant.py"
click node_edit "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/edit_plant.py"
click node_schedule "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/schedule.py"
click node_history "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/history.py"
click node_settings "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/settings.py"
click node_plant_api "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/plants.py"
click node_database "https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/database.py"
click node_json "https://github.com/kaowri48/plant_care/blob/main/02_Data/plantcare_data.json"

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_launch,node_dashboard,node_user toneBlue
class node_add,node_edit toneAmber
class node_collection,node_schedule,node_history,node_settings toneMint
class node_plant_api,node_database,node_json toneRose
```

## Components

### Application shell

- [App launcher](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/main.py): `01_Source_Code/main.py`
- [Dashboard](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/dashboard.py): `01_Source_Code/dashboard.py`

### Plant care workflows

- [Add plant dialog](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/add_plant.py): `01_Source_Code/add_plant.py`
- [Edit plant dialog](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/edit_plant.py): `01_Source_Code/edit_plant.py`

### Tracking views

- [My plants](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/my_plants.py): `01_Source_Code/my_plants.py`
- [Watering schedule](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/schedule.py): `01_Source_Code/schedule.py`
- [Care history](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/history.py): `01_Source_Code/history.py`
- [Settings](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/settings.py): `01_Source_Code/settings.py`

### Local persistence

- [Plant data access](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/plants.py): `01_Source_Code/plants.py`
- [Care data operations](https://github.com/kaowri48/plant_care/blob/main/01_Source_Code/database.py): `01_Source_Code/database.py`
- [Plant care JSON](https://github.com/kaowri48/plant_care/blob/main/02_Data/plantcare_data.json): `02_Data/plantcare_data.json`

### Other components

- **PlantCare user**

## Connections

- PlantCare user → App launcher: launches (evidence: `01_Source_Code/main.py`)
- App launcher → Dashboard: opens (evidence: `01_Source_Code/main.py`)
- Dashboard → Plant data access: loads plants (evidence: `01_Source_Code/dashboard.py`)
- Dashboard → Care data operations: loads stats (evidence: `01_Source_Code/dashboard.py`)
- Dashboard → Add plant dialog: opens dialog (evidence: `01_Source_Code/dashboard.py`)
- Dashboard → Edit plant dialog: opens dialog (evidence: `01_Source_Code/dashboard.py`)
- Dashboard → My plants: imports view (evidence: `01_Source_Code/dashboard.py`)
- Dashboard → Care history: imports view (evidence: `01_Source_Code/dashboard.py`)
- Dashboard → Watering schedule: imports view (evidence: `01_Source_Code/dashboard.py`)
- Dashboard → Settings: imports view (evidence: `01_Source_Code/dashboard.py`)
- My plants → Plant data access: loads plants (evidence: `01_Source_Code/my_plants.py`)
- My plants → Add plant dialog: opens dialog (evidence: `01_Source_Code/my_plants.py`)
- Add plant dialog → Care data operations: adds plant (evidence: `01_Source_Code/add_plant.py`)
- Edit plant dialog → Care data operations: updates plant (evidence: `01_Source_Code/edit_plant.py`)
- Watering schedule → Care data operations: loads schedule (evidence: `01_Source_Code/schedule.py`)
- Watering schedule → Care data operations: records watering (evidence: `01_Source_Code/schedule.py`)
- Care history → Care data operations: loads history (evidence: `01_Source_Code/history.py`)
- Plant data access → Care data operations: delegates reads (evidence: `01_Source_Code/plants.py`)
- Care data operations → Plant care JSON: reads and writes
