# shawneetz/22project architecture

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

- Interactive diagram: https://gitdiagram.com/shawneetz/22project
- Repository: https://github.com/shawneetz/22project

## Overview

This is a JavaFX shop and farm inventory prototype. A user enters the main product view, where manager/clerk actions can add stock to the shelf and managers can open the product database; product creation and stock transfers update in-memory containers. The code also saves database and shelf data to text files. Inventory management is represented, but the main view currently uses the database where inventory is intended. Login and import/export code appear unfinished or leftover. Relationships below are limited to the excerpts and SOURCE INDEX; unsampled data-loading behavior is not inferred.

Main entry points: [`fxtest2/src/application/Main.java`](https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/Main.java) (Main View), [`fxtest2/src/application/ProductContainer.java`](https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/ProductContainer.java) (Product Containers), [`fxtest2/src/ui/ProductCreationWindow.java`](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/ProductCreationWindow.java) (Create Product), [`fxtest2/src/ui/AddProductWindow.java`](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/AddProductWindow.java) (Add Stock)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Main View<br/>[Main.java]"]
  node_import_export["Import Export Handler"]
end

subgraph group_ui["Shop Interface"]
  node_database_scene["Product Database<br/>[DatabaseScene.java]"]
  node_inventory_scene["Inventory View"]
  node_add_window["Add Stock"]
  node_creation_window["Create Product"]
  node_text_field["Text Field"]
  node_login_window["Test Login"]
  node_password_field["Password Field"]
end

subgraph group_domain["Product Domain"]
  node_product["Product<br/>[Product.java]"]
  node_containers["Product Containers"]
  node_user["User Roles<br/>[User.java]"]
end

subgraph group_storage["Text Data"]
  node_products_file["Product Database File<br/>[productsDB.txt]"]
  node_shelf_file["Shelf File<br/>[shelf.txt]"]
end

node_operator(("Shop User"))

node_operator -->|"uses"| node_main
node_main -->|"opens"| node_database_scene
node_main -->|"references"| node_inventory_scene
node_main -->|"opens"| node_add_window
node_main -->|"references"| node_creation_window
node_main -->|"manages"| node_containers
node_main -->|"creates"| node_product
node_main -->|"checks roles"| node_user
node_main -->|"writes"| node_products_file
node_main -->|"writes"| node_shelf_file
node_database_scene -->|"opens"| node_creation_window
node_database_scene -->|"displays"| node_containers
node_inventory_scene -->|"opens"| node_add_window
node_inventory_scene -->|"displays"| node_containers
node_add_window -->|"transfers stock"| node_containers
node_add_window -->|"selects"| node_product
node_creation_window -->|"adds product"| node_containers
node_creation_window -->|"creates"| node_product
node_creation_window -->|"uses fields"| node_text_field
node_containers -->|"stores"| node_product
node_login_window -->|"checks credentials"| node_user
node_login_window -->|"uses field"| node_text_field
node_login_window -->|"uses field"| node_password_field

click node_main "https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/Main.java"
click node_database_scene "https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/DatabaseScene.java"
click node_inventory_scene "https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/InventoryScene.java"
click node_add_window "https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/AddProductWindow.java"
click node_creation_window "https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/ProductCreationWindow.java"
click node_text_field "https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/LabelledTextField.java"
click node_login_window "https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/TestLoginWindow.java"
click node_password_field "https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/LabelledPasswordField.java"
click node_product "https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/Product.java"
click node_containers "https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/ProductContainer.java"
click node_user "https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/User.java"
click node_import_export "https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/ImportExportHandler.java"
click node_products_file "https://github.com/shawneetz/22project/blob/master/fxtest2/src/data/productsDB.txt"
click node_shelf_file "https://github.com/shawneetz/22project/blob/master/fxtest2/src/data/shelf.txt"

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_import_export,node_operator toneBlue
class node_database_scene,node_inventory_scene,node_add_window,node_creation_window,node_text_field,node_login_window,node_password_field toneAmber
class node_product,node_containers,node_user toneMint
class node_products_file,node_shelf_file toneRose
```

## Components

### Application

- [Main View](https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/Main.java): `fxtest2/src/application/Main.java`
- [Import Export Handler](https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/ImportExportHandler.java): `fxtest2/src/application/ImportExportHandler.java`

### Shop Interface

- [Product Database](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/DatabaseScene.java): `fxtest2/src/ui/DatabaseScene.java`
- [Inventory View](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/InventoryScene.java): `fxtest2/src/ui/InventoryScene.java`
- [Add Stock](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/AddProductWindow.java): `fxtest2/src/ui/AddProductWindow.java`
- [Create Product](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/ProductCreationWindow.java): `fxtest2/src/ui/ProductCreationWindow.java`
- [Text Field](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/LabelledTextField.java): `fxtest2/src/ui/LabelledTextField.java`
- [Test Login](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/TestLoginWindow.java): `fxtest2/src/ui/TestLoginWindow.java`
- [Password Field](https://github.com/shawneetz/22project/blob/master/fxtest2/src/ui/LabelledPasswordField.java): `fxtest2/src/ui/LabelledPasswordField.java`

### Product Domain

- [Product](https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/Product.java): `fxtest2/src/application/Product.java`
- [Product Containers](https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/ProductContainer.java): `fxtest2/src/application/ProductContainer.java`
- [User Roles](https://github.com/shawneetz/22project/blob/master/fxtest2/src/application/User.java): `fxtest2/src/application/User.java`

### Text Data

- [Product Database File](https://github.com/shawneetz/22project/blob/master/fxtest2/src/data/productsDB.txt): `fxtest2/src/data/productsDB.txt`
- [Shelf File](https://github.com/shawneetz/22project/blob/master/fxtest2/src/data/shelf.txt): `fxtest2/src/data/shelf.txt`

### Other components

- **Shop User**

## Connections

- Shop User → Main View: uses
- Main View → Product Database: opens (evidence: `fxtest2/src/application/Main.java`)
- Main View → Inventory View: references (evidence: `fxtest2/src/application/Main.java`)
- Main View → Add Stock: opens (evidence: `fxtest2/src/application/Main.java`)
- Main View → Create Product: references (evidence: `fxtest2/src/application/Main.java`)
- Main View → Product Containers: manages (evidence: `fxtest2/src/application/Main.java`)
- Main View → Product: creates (evidence: `fxtest2/src/application/Main.java`)
- Main View → User Roles: checks roles (evidence: `fxtest2/src/application/Main.java`)
- Main View → Product Database File: writes (evidence: `fxtest2/src/application/Main.java`)
- Main View → Shelf File: writes (evidence: `fxtest2/src/application/Main.java`)
- Product Database → Create Product: opens (evidence: `fxtest2/src/ui/DatabaseScene.java`)
- Product Database → Product Containers: displays (evidence: `fxtest2/src/ui/DatabaseScene.java`)
- Inventory View → Add Stock: opens (evidence: `fxtest2/src/ui/InventoryScene.java`)
- Inventory View → Product Containers: displays (evidence: `fxtest2/src/ui/InventoryScene.java`)
- Add Stock → Product Containers: transfers stock (evidence: `fxtest2/src/ui/AddProductWindow.java`)
- Add Stock → Product: selects (evidence: `fxtest2/src/ui/AddProductWindow.java`)
- Create Product → Product Containers: adds product (evidence: `fxtest2/src/ui/ProductCreationWindow.java`)
- Create Product → Product: creates (evidence: `fxtest2/src/ui/ProductCreationWindow.java`)
- Create Product → Text Field: uses fields (evidence: `fxtest2/src/ui/ProductCreationWindow.java`)
- Product Containers → Product: stores (evidence: `fxtest2/src/application/ProductContainer.java`)
- Test Login → User Roles: checks credentials (evidence: `fxtest2/src/ui/TestLoginWindow.java`)
- Test Login → Text Field: uses field (evidence: `fxtest2/src/ui/TestLoginWindow.java`)
- Test Login → Password Field: uses field (evidence: `fxtest2/src/ui/TestLoginWindow.java`)
