# sophiasaks/greenest-greenhouse architecture

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

- Interactive diagram: https://gitdiagram.com/sophiasaks/greenest-greenhouse
- Repository: https://github.com/sophiasaks/greenest-greenhouse

## Overview

This is a small console plant-watering calculator. The user enters a plant’s name; the menu looks it up in the hotel’s in-memory collection and prints that plant type’s daily watering instruction. Plant subclasses provide type-specific calculations, using watering constants from PlantType. The excerpts show this flow and the domain model; there is no README or evidence of persistence or external integrations.

Main entry points: [`src/ui/Meny.java`](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/ui/Meny.java) (Plant menu), [`src/model/Plant.java`](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Plant.java) (Plant base class), [`src/model/PlantType.java`](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/PlantType.java) (Plant type constants), [`src/model/Cactus.java`](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Cactus.java) (Cactus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Console interface"]
  node_main["Application entry<br/>[Main.java]"]
  node_menu["Plant menu<br/>[Meny.java]"]
end

subgraph group_domain["Plant domain"]
  node_hotel["Plant collection<br/>[Hotel.java]"]
  node_plant["Plant base class<br/>[Plant.java]"]
  node_cactus["Cactus<br/>[Cactus.java]"]
  node_palm["Palmtree<br/>[Palmtree.java]"]
  node_carnivorous["Carnivorous plant"]
end

subgraph group_rules["Watering rules"]
  node_watering["Watering contract<br/>[DailyWatering.java]"]
  node_planttype["Plant type constants<br/>[PlantType.java]"]
end

node_user(("User"))

node_user -->|"enters name"| node_menu
node_main -->|"starts"| node_menu
node_menu -->|"adds and finds"| node_hotel
node_menu -->|"creates"| node_cactus
node_menu -->|"creates"| node_palm
node_menu -->|"creates"| node_carnivorous
node_hotel -->|"stores and returns"| node_plant
node_menu -->|"requests watering"| node_plant
node_cactus -->|"extends"| node_plant
node_palm -->|"extends"| node_plant
node_carnivorous -->|"extends"| node_plant
node_plant -->|"implements"| node_watering
node_plant -->|"uses type"| node_planttype
node_cactus -->|"reads constants"| node_planttype
node_palm -->|"reads constants"| node_planttype
node_carnivorous -->|"reads constants"| node_planttype

click node_main "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/ui/Main.java"
click node_menu "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/ui/Meny.java"
click node_hotel "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Hotel.java"
click node_plant "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Plant.java"
click node_cactus "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Cactus.java"
click node_palm "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Palmtree.java"
click node_carnivorous "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/CarnivorousPlant.java"
click node_watering "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/DailyWatering.java"
click node_planttype "https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/PlantType.java"

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_main,node_menu,node_user toneBlue
class node_hotel,node_plant,node_cactus,node_palm,node_carnivorous toneAmber
class node_watering,node_planttype toneMint
```

## Components

### Console interface

- [Application entry](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/ui/Main.java): `src/ui/Main.java`
- [Plant menu](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/ui/Meny.java): `src/ui/Meny.java`

### Plant domain

- [Plant collection](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Hotel.java): `src/model/Hotel.java`
- [Plant base class](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Plant.java): `src/model/Plant.java`
- [Cactus](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Cactus.java): `src/model/Cactus.java`
- [Palmtree](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/Palmtree.java): `src/model/Palmtree.java`
- [Carnivorous plant](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/CarnivorousPlant.java): `src/model/CarnivorousPlant.java`

### Watering rules

- [Watering contract](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/DailyWatering.java): `src/model/DailyWatering.java`
- [Plant type constants](https://github.com/sophiasaks/greenest-greenhouse/blob/main/src/model/PlantType.java): `src/model/PlantType.java`

### Other components

- **User**

## Connections

- User → Plant menu: enters name (evidence: `src/ui/Meny.java`)
- Application entry → Plant menu: starts (evidence: `src/ui/Main.java`)
- Plant menu → Plant collection: adds and finds (evidence: `src/ui/Meny.java`)
- Plant menu → Cactus: creates (evidence: `src/ui/Meny.java`)
- Plant menu → Palmtree: creates (evidence: `src/ui/Meny.java`)
- Plant menu → Carnivorous plant: creates (evidence: `src/ui/Meny.java`)
- Plant collection → Plant base class: stores and returns (evidence: `src/model/Hotel.java`)
- Plant menu → Plant base class: requests watering (evidence: `src/ui/Meny.java`)
- Cactus → Plant base class: extends (evidence: `src/model/Cactus.java`)
- Palmtree → Plant base class: extends (evidence: `src/model/Palmtree.java`)
- Carnivorous plant → Plant base class: extends (evidence: `src/model/CarnivorousPlant.java`)
- Plant base class → Watering contract: implements (evidence: `src/model/Plant.java`)
- Plant base class → Plant type constants: uses type (evidence: `src/model/Plant.java`)
- Cactus → Plant type constants: reads constants (evidence: `src/model/Cactus.java`)
- Palmtree → Plant type constants: reads constants (evidence: `src/model/Palmtree.java`)
- Carnivorous plant → Plant type constants: reads constants (evidence: `src/model/CarnivorousPlant.java`)
