# imgooglyeyes/22project architecture

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

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

## Overview

ShopeeFarm is a JavaFX farm-to-market store with customer-facing browsing and purchase requests plus staff back-office workflows. A customer browses the shelf and submits a request; staff review, confirm, or void it, with FarmSystem enforcing stock and transaction rules. Managers also maintain products, inventory, and staff accounts. The README documents plain-text persistence and role-specific screens. Some page implementations were not excerpted, so their documented capabilities are included without inferring unshown call paths.

Main entry points: [`fxtest2/src/application/FarmSystem.java`](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/FarmSystem.java) (Business rules), [`fxtest2/src/shell/SceneManager.java`](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/shell/SceneManager.java) (Role-aware navigation), [`fxtest2/src/pages/MarketplacePage.java`](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/MarketplacePage.java) (Marketplace), [`fxtest2/src/application/TransactionContainer.java`](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/TransactionContainer.java) (Transaction records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App Navigation"]
  node_main["Application startup<br/>[Main.java]"]
  node_scene["Role-aware navigation<br/>[SceneManager.java]"]
  node_home["Home dashboards<br/>[HomePage.java]"]
  node_staff_home["Staff dashboard<br/>[StaffHomePage.java]"]
  node_auth["Authentication and signup<br/>[AuthPage.java]"]
end

subgraph group_commerce["Storefront and Sales"]
  node_market["Marketplace"]
  node_request_popup["Purchase request"]
  node_transactions_page["Transaction handling"]
  node_requests_page["My requests"]
  node_cash_history["Cash and history<br/>[CashPage.java]"]
end

subgraph group_operations["Staff Operations"]
  node_inventory_page["Inventory management<br/>[InventoryPage.java]"]
  node_products_page["Product management<br/>[ProductsPage.java]"]
  node_staff_page["Staff administration<br/>[StaffPage.java]"]
  node_add_stock["Add shelf stock"]
  node_move_stock["Return shelf stock"]
end

subgraph group_domain["Business Domain"]
  node_farm_system["Business rules<br/>[FarmSystem.java]"]
  node_product["Product model<br/>[Product.java]"]
  node_transaction["Sale transaction model"]
  node_user["Account model<br/>[User.java]"]
end

subgraph group_persistence["Data Persistence"]
  node_product_data[("Product and stock containers")]
  node_transaction_data[("Transaction records")]
  node_user_data[("User records<br/>[UserContainer.java]")]
  node_product_files["Product file handler"]
  node_transaction_files["Transaction file handler"]
  node_user_files["User file handler"]
  node_product_images["Product images<br/>[ProductImages.java]"]
end

node_guest_customer(("Guest / Customer"))
node_staff(("Clerk / Manager"))

node_guest_customer -->|"browses"| node_market
node_guest_customer -->|"signs in"| node_auth
node_guest_customer -->|"requests product"| node_request_popup
node_staff -->|"handles sales"| node_transactions_page
node_staff -->|"views stock"| node_inventory_page
node_staff -->|"views dashboard"| node_staff_home
node_main -->|"opens home"| node_scene
node_main -->|"loads products"| node_product_files
node_main -->|"loads transactions"| node_transaction_files
node_main -->|"loads users"| node_user_files
node_scene -->|"opens home"| node_home
node_scene -->|"opens staff home"| node_staff_home
node_scene -->|"opens authentication"| node_auth
node_scene -->|"opens marketplace"| node_market
node_scene -->|"opens transactions"| node_transactions_page
node_scene -->|"creates rules service"| node_farm_system
node_market -->|"opens request"| node_request_popup
node_market -->|"reads shelf"| node_farm_system
node_market -->|"renders products"| node_product
node_request_popup -.->|"submits request"| node_farm_system
node_farm_system -->|"changes stock"| node_product_data
node_farm_system -.->|"records sales"| node_transaction_data
node_farm_system -->|"saves products"| node_product_files
node_farm_system -->|"removes images"| node_product_images
node_farm_system -.->|"persists transactions"| node_transaction_files
node_transactions_page -->|"confirms or voids"| node_farm_system
node_requests_page -->|"shows own requests"| node_transaction_data
node_cash_history -->|"derives cash history"| node_transaction_data
node_inventory_page -->|"manages stock"| node_farm_system
node_products_page -->|"maintains products"| node_farm_system
node_products_page -.->|"selects images"| node_product_images
node_staff_page -->|"reviews signups"| node_user_data
node_staff_page -->|"saves accounts"| node_user_files
node_add_stock -->|"adds shelf stock"| node_farm_system
node_move_stock -->|"moves stock back"| node_farm_system
node_product_files -->|"loads and saves"| node_product_data
node_product_data -->|"stores copies"| node_product
node_transaction_files -->|"loads and saves"| node_transaction_data
node_transaction_data -->|"stores records"| node_transaction
node_user_files -->|"loads and saves"| node_user_data
node_user_data -->|"stores accounts"| node_user

click node_main "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/Main.java"
click node_scene "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/shell/SceneManager.java"
click node_home "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/HomePage.java"
click node_staff_home "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/StaffHomePage.java"
click node_auth "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/AuthPage.java"
click node_market "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/MarketplacePage.java"
click node_request_popup "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/popup/RequestToBuyWindow.java"
click node_transactions_page "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/TransactionsPage.java"
click node_requests_page "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/MyRequestsPage.java"
click node_cash_history "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/CashPage.java"
click node_inventory_page "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/InventoryPage.java"
click node_products_page "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/ProductsPage.java"
click node_staff_page "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/StaffPage.java"
click node_add_stock "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/popup/AddProductWindow.java"
click node_move_stock "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/popup/MoveProductWindow.java"
click node_farm_system "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/FarmSystem.java"
click node_product "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/Product.java"
click node_transaction "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/SaleTransaction.java"
click node_user "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/User.java"
click node_product_data "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/ProductContainer.java"
click node_transaction_data "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/TransactionContainer.java"
click node_user_data "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/UserContainer.java"
click node_product_files "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/ProductsFileHandler.java"
click node_transaction_files "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/TransactionFilesHandler.java"
click node_user_files "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/UsersFileHandler.java"
click node_product_images "https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/ProductImages.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_scene,node_home,node_staff_home,node_auth toneBlue
class node_market,node_request_popup,node_transactions_page,node_requests_page,node_cash_history toneAmber
class node_inventory_page,node_products_page,node_staff_page,node_add_stock,node_move_stock toneMint
class node_farm_system,node_product,node_transaction,node_user toneRose
class node_product_data,node_transaction_data,node_user_data,node_product_files,node_transaction_files,node_user_files,node_product_images,node_guest_customer,node_staff toneIndigo
```

## Components

### App Navigation

- [Application startup](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/Main.java): `fxtest2/src/application/Main.java`
- [Role-aware navigation](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/shell/SceneManager.java): `fxtest2/src/shell/SceneManager.java`
- [Home dashboards](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/HomePage.java): `fxtest2/src/pages/HomePage.java`
- [Staff dashboard](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/StaffHomePage.java): `fxtest2/src/pages/StaffHomePage.java`
- [Authentication and signup](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/AuthPage.java): `fxtest2/src/pages/AuthPage.java`

### Storefront and Sales

- [Marketplace](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/MarketplacePage.java): `fxtest2/src/pages/MarketplacePage.java`
- [Purchase request](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/popup/RequestToBuyWindow.java): `fxtest2/src/popup/RequestToBuyWindow.java`
- [Transaction handling](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/TransactionsPage.java): `fxtest2/src/pages/TransactionsPage.java`
- [My requests](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/MyRequestsPage.java): `fxtest2/src/pages/MyRequestsPage.java`
- [Cash and history](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/CashPage.java): `fxtest2/src/pages/CashPage.java`

### Staff Operations

- [Inventory management](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/InventoryPage.java): `fxtest2/src/pages/InventoryPage.java`
- [Product management](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/ProductsPage.java): `fxtest2/src/pages/ProductsPage.java`
- [Staff administration](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/pages/StaffPage.java): `fxtest2/src/pages/StaffPage.java`
- [Add shelf stock](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/popup/AddProductWindow.java): `fxtest2/src/popup/AddProductWindow.java`
- [Return shelf stock](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/popup/MoveProductWindow.java): `fxtest2/src/popup/MoveProductWindow.java`

### Business Domain

- [Business rules](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/FarmSystem.java): `fxtest2/src/application/FarmSystem.java`
- [Product model](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/Product.java): `fxtest2/src/application/Product.java`
- [Sale transaction model](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/SaleTransaction.java): `fxtest2/src/application/SaleTransaction.java`
- [Account model](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/User.java): `fxtest2/src/application/User.java`

### Data Persistence

- [Product and stock containers](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/ProductContainer.java): `fxtest2/src/application/ProductContainer.java`
- [Transaction records](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/TransactionContainer.java): `fxtest2/src/application/TransactionContainer.java`
- [User records](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/UserContainer.java): `fxtest2/src/application/UserContainer.java`
- [Product file handler](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/ProductsFileHandler.java): `fxtest2/src/application/ProductsFileHandler.java`
- [Transaction file handler](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/TransactionFilesHandler.java): `fxtest2/src/application/TransactionFilesHandler.java`
- [User file handler](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/UsersFileHandler.java): `fxtest2/src/application/UsersFileHandler.java`
- [Product images](https://github.com/imgooglyeyes/22project/blob/master/fxtest2/src/application/ProductImages.java): `fxtest2/src/application/ProductImages.java`

### Other components

- **Guest / Customer**
- **Clerk / Manager**

## Connections

- Guest / Customer → Marketplace: browses (evidence: `README.md`)
- Guest / Customer → Authentication and signup: signs in (evidence: `README.md`)
- Guest / Customer → Purchase request: requests product (evidence: `README.md`)
- Clerk / Manager → Transaction handling: handles sales (evidence: `README.md`)
- Clerk / Manager → Inventory management: views stock (evidence: `README.md`)
- Clerk / Manager → Staff dashboard: views dashboard (evidence: `README.md`)
- Application startup → Role-aware navigation: opens home (evidence: `fxtest2/src/application/Main.java`)
- Application startup → Product file handler: loads products (evidence: `fxtest2/src/application/Main.java`)
- Application startup → Transaction file handler: loads transactions (evidence: `fxtest2/src/application/Main.java`)
- Application startup → User file handler: loads users (evidence: `fxtest2/src/application/Main.java`)
- Role-aware navigation → Home dashboards: opens home (evidence: `fxtest2/src/shell/SceneManager.java`)
- Role-aware navigation → Staff dashboard: opens staff home (evidence: `fxtest2/src/shell/SceneManager.java`)
- Role-aware navigation → Authentication and signup: opens authentication (evidence: `fxtest2/src/shell/SceneManager.java`)
- Role-aware navigation → Marketplace: opens marketplace (evidence: `fxtest2/src/shell/SceneManager.java`)
- Role-aware navigation → Transaction handling: opens transactions (evidence: `fxtest2/src/shell/SceneManager.java`)
- Role-aware navigation → Business rules: creates rules service (evidence: `fxtest2/src/shell/SceneManager.java`)
- Marketplace → Purchase request: opens request (evidence: `fxtest2/src/pages/MarketplacePage.java`)
- Marketplace → Business rules: reads shelf (evidence: `fxtest2/src/pages/MarketplacePage.java`)
- Marketplace → Product model: renders products (evidence: `fxtest2/src/pages/MarketplacePage.java`)
- Purchase request → Business rules: submits request
- Business rules → Product and stock containers: changes stock (evidence: `README.md`)
- Business rules → Transaction records: records sales (evidence: `fxtest2/src/application/FarmSystem.java`)
- Business rules → Product file handler: saves products (evidence: `fxtest2/src/application/FarmSystem.java`)
- Business rules → Product images: removes images (evidence: `fxtest2/src/application/FarmSystem.java`)
- Business rules → Transaction file handler: persists transactions (evidence: `fxtest2/src/application/FarmSystem.java`)
- Transaction handling → Business rules: confirms or voids (evidence: `README.md`)
- My requests → Transaction records: shows own requests (evidence: `README.md`)
- Cash and history → Transaction records: derives cash history (evidence: `README.md`)
- Inventory management → Business rules: manages stock (evidence: `README.md`)
- Product management → Business rules: maintains products (evidence: `fxtest2/src/pages/ProductsPage.java`)
- Product management → Product images: selects images
- Staff administration → User records: reviews signups (evidence: `README.md`)
- Staff administration → User file handler: saves accounts (evidence: `fxtest2/src/pages/StaffPage.java`)
- Add shelf stock → Business rules: adds shelf stock (evidence: `fxtest2/src/popup/AddProductWindow.java`)
- Return shelf stock → Business rules: moves stock back (evidence: `README.md`)
- Product file handler → Product and stock containers: loads and saves (evidence: `fxtest2/src/application/ProductsFileHandler.java`)
- Product and stock containers → Product model: stores copies (evidence: `fxtest2/src/application/ProductContainer.java`)
- Transaction file handler → Transaction records: loads and saves (evidence: `fxtest2/src/application/TransactionFilesHandler.java`)
- Transaction records → Sale transaction model: stores records (evidence: `fxtest2/src/application/TransactionContainer.java`)
- User file handler → User records: loads and saves (evidence: `fxtest2/src/application/UsersFileHandler.java`)
- User records → Account model: stores accounts (evidence: `fxtest2/src/application/UserContainer.java`)
