# mmr-ta/greenest architecture

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

- Interactive diagram: https://gitdiagram.com/mmr-ta/greenest
- Repository: https://github.com/mmr-ta/greenest

## Overview

A small Java console application that asks which named plant to water, then displays its daily fluid amount and fluid type. Main owns the prompt and selection; plant subclasses provide the calculation and fluid type. The excerpts show no persistence or external integrations.

Main entry points: [`src/Main.java`](https://github.com/mmr-ta/greenest/blob/master/src/Main.java) (Prompt and selection), [`src/Plant.java`](https://github.com/mmr-ta/greenest/blob/master/src/Plant.java) (Plant base type), [`src/Carnivorous.java`](https://github.com/mmr-ta/greenest/blob/master/src/Carnivorous.java) (Carnivorous plant), [`src/Cactus.java`](https://github.com/mmr-ta/greenest/blob/master/src/Cactus.java) (Cactus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Console interaction"]
  node_main["Prompt and selection<br/>[Main.java]"]
end

subgraph group_plant_model["Plant model"]
  node_plant["Plant base type<br/>[Plant.java]"]
  node_carnivorous["Carnivorous plant<br/>[Carnivorous.java]"]
  node_cactus["Cactus<br/>[Cactus.java]"]
  node_watering["Watering contract<br/>[Watering.java]"]
  node_fluid_type["Fluid type<br/>[FluidType.java]"]
end

node_user(("User"))

node_user -->|"chooses plant"| node_main
node_main -->|"creates instance"| node_carnivorous
node_main -->|"creates instance"| node_cactus
node_main -->|"requests needs"| node_plant
node_main -->|"displays type"| node_plant
node_carnivorous -->|"extends"| node_plant
node_cactus -->|"extends"| node_plant
node_plant -->|"implements"| node_watering
node_carnivorous -->|"returns type"| node_fluid_type
node_cactus -->|"returns type"| node_fluid_type

click node_main "https://github.com/mmr-ta/greenest/blob/master/src/Main.java"
click node_plant "https://github.com/mmr-ta/greenest/blob/master/src/Plant.java"
click node_carnivorous "https://github.com/mmr-ta/greenest/blob/master/src/Carnivorous.java"
click node_cactus "https://github.com/mmr-ta/greenest/blob/master/src/Cactus.java"
click node_watering "https://github.com/mmr-ta/greenest/blob/master/src/Watering.java"
click node_fluid_type "https://github.com/mmr-ta/greenest/blob/master/src/FluidType.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_user toneBlue
class node_plant,node_carnivorous,node_cactus,node_watering,node_fluid_type toneAmber
```

## Components

### Console interaction

- [Prompt and selection](https://github.com/mmr-ta/greenest/blob/master/src/Main.java): `src/Main.java`

### Plant model

- [Plant base type](https://github.com/mmr-ta/greenest/blob/master/src/Plant.java): `src/Plant.java`
- [Carnivorous plant](https://github.com/mmr-ta/greenest/blob/master/src/Carnivorous.java): `src/Carnivorous.java`
- [Cactus](https://github.com/mmr-ta/greenest/blob/master/src/Cactus.java): `src/Cactus.java`
- [Watering contract](https://github.com/mmr-ta/greenest/blob/master/src/Watering.java): `src/Watering.java`
- [Fluid type](https://github.com/mmr-ta/greenest/blob/master/src/FluidType.java): `src/FluidType.java`

### Other components

- **User**

## Connections

- User → Prompt and selection: chooses plant (evidence: `src/Main.java`)
- Prompt and selection → Carnivorous plant: creates instance (evidence: `src/Main.java`)
- Prompt and selection → Cactus: creates instance (evidence: `src/Main.java`)
- Prompt and selection → Plant base type: requests needs (evidence: `src/Main.java`)
- Prompt and selection → Plant base type: displays type (evidence: `src/Main.java`)
- Carnivorous plant → Plant base type: extends (evidence: `src/Carnivorous.java`)
- Cactus → Plant base type: extends (evidence: `src/Cactus.java`)
- Plant base type → Watering contract: implements (evidence: `src/Plant.java`)
- Carnivorous plant → Fluid type: returns type (evidence: `src/Carnivorous.java`)
- Cactus → Fluid type: returns type (evidence: `src/Cactus.java`)
