# ryanlowry1/restaurant-ordering-system architecture

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

- Interactive diagram: https://gitdiagram.com/ryanlowry1/restaurant-ordering-system
- Repository: https://github.com/ryanlowry1/restaurant-ordering-system

## Overview

This is a Java Swing restaurant ordering and administration application backed by MySQL. A customer starts at login or registration, then browses products, manages a cart, and checks out into an invoice with invoice items and reduced stock. Administrators manage the product catalog and review or update order status. The graph reflects the shown calls and SOURCE INDEX references; some DAO behavior and GUI sections were not excerpted, so uncertain connections are omitted.

Main entry points: [`src/gui/LoginFrame.java`](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/LoginFrame.java) (Login and routing), [`src/gui/UserProductFrame.java`](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/UserProductFrame.java) (Product and checkout UI), [`src/gui/AdminFrame.java`](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/AdminFrame.java) (Admin catalog and orders), [`src/database/ProductDAO.java`](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/ProductDAO.java) (Product persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and accounts"]
  node_main["Application start<br/>[Main.java]"]
  node_login["Login and routing<br/>[LoginFrame.java]"]
  node_register["Account registration<br/>[RegisterFrame.java]"]
end

subgraph group_customer["Customer ordering"]
  node_customer_ui["Product and checkout UI"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin catalog and orders<br/>[AdminFrame.java]"]
end

subgraph group_data["Persistence and models"]
  node_product_dao["Product persistence<br/>[ProductDAO.java]"]
  node_user_dao["User persistence<br/>[UserDAO.java]"]
  node_invoice_dao["Invoice persistence<br/>[InvoiceDAO.java]"]
  node_item_dao["Invoice item persistence"]
  node_connection["JDBC connection"]
  node_user_model["User model<br/>[User.java]"]
  node_product_model["Product model<br/>[Product.java]"]
  node_invoice_model["Invoice model<br/>[Invoice.java]"]
end

node_customer_actor(("Customer"))
node_admin_actor(("Administrator"))
node_mysql[("MySQL database")]

node_main -->|"opens"| node_login
node_customer_actor -.->|"starts at"| node_login
node_admin_actor -.->|"starts at"| node_login
node_login -->|"authenticates with"| node_user_dao
node_login -->|"routes admin"| node_admin_ui
node_login -->|"routes customer"| node_customer_ui
node_login -->|"opens registration"| node_register
node_register -->|"creates account"| node_user_dao
node_register -->|"returns to"| node_login
node_customer_ui -->|"loads products"| node_product_dao
node_customer_ui -->|"creates and updates invoice"| node_invoice_dao
node_customer_ui -->|"adds invoice items"| node_item_dao
node_customer_ui -->|"reduces stock"| node_product_dao
node_admin_ui -->|"manages catalog"| node_product_dao
node_admin_ui -->|"manages orders"| node_invoice_dao
node_product_dao -->|"gets connection"| node_connection
node_user_dao -->|"gets connection"| node_connection
node_invoice_dao -->|"gets connection"| node_connection
node_item_dao -->|"gets connection"| node_connection
node_connection -->|"connects to"| node_mysql
node_product_dao -->|"builds products"| node_product_model
node_user_dao -->|"builds users"| node_user_model
node_invoice_dao -->|"builds invoices"| node_invoice_model
node_customer_ui -->|"displays products"| node_product_model
node_customer_ui -->|"uses current user"| node_user_model
node_admin_ui -->|"displays products"| node_product_model
node_admin_ui -->|"displays orders"| node_invoice_model

click node_main "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/Main.java"
click node_login "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/LoginFrame.java"
click node_register "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/RegisterFrame.java"
click node_customer_ui "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/UserProductFrame.java"
click node_admin_ui "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/AdminFrame.java"
click node_product_dao "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/ProductDAO.java"
click node_user_dao "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/UserDAO.java"
click node_invoice_dao "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/InvoiceDAO.java"
click node_item_dao "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/InvoiceItemDAO.java"
click node_connection "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/DatabaseConnection.java"
click node_user_model "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/model/User.java"
click node_product_model "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/model/Product.java"
click node_invoice_model "https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/model/Invoice.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_login,node_register toneBlue
class node_customer_ui,node_mysql toneAmber
class node_admin_ui toneMint
class node_product_dao,node_user_dao,node_invoice_dao,node_item_dao,node_connection,node_user_model,node_product_model,node_invoice_model toneRose
class node_customer_actor,node_admin_actor toneIndigo
```

## Components

### Entry and accounts

- [Application start](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/Main.java): `src/Main.java`
- [Login and routing](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/LoginFrame.java): `src/gui/LoginFrame.java`
- [Account registration](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/RegisterFrame.java): `src/gui/RegisterFrame.java`

### Customer ordering

- [Product and checkout UI](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/UserProductFrame.java): `src/gui/UserProductFrame.java`

### Administration

- [Admin catalog and orders](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/gui/AdminFrame.java): `src/gui/AdminFrame.java`

### Persistence and models

- [Product persistence](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/ProductDAO.java): `src/database/ProductDAO.java`
- [User persistence](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/UserDAO.java): `src/database/UserDAO.java`
- [Invoice persistence](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/InvoiceDAO.java): `src/database/InvoiceDAO.java`
- [Invoice item persistence](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/InvoiceItemDAO.java): `src/database/InvoiceItemDAO.java`
- [JDBC connection](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/database/DatabaseConnection.java): `src/database/DatabaseConnection.java`
- [User model](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/model/User.java): `src/model/User.java`
- [Product model](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/model/Product.java): `src/model/Product.java`
- [Invoice model](https://github.com/ryanlowry1/restaurant-ordering-system/blob/main/src/model/Invoice.java): `src/model/Invoice.java`

### Other components

- **Customer**
- **Administrator**
- **MySQL database**

## Connections

- Application start → Login and routing: opens (evidence: `src/Main.java`)
- Customer → Login and routing: starts at
- Administrator → Login and routing: starts at
- Login and routing → User persistence: authenticates with (evidence: `src/gui/LoginFrame.java`)
- Login and routing → Admin catalog and orders: routes admin (evidence: `src/gui/LoginFrame.java`)
- Login and routing → Product and checkout UI: routes customer (evidence: `src/gui/LoginFrame.java`)
- Login and routing → Account registration: opens registration (evidence: `src/gui/LoginFrame.java`)
- Account registration → User persistence: creates account (evidence: `src/gui/RegisterFrame.java`)
- Account registration → Login and routing: returns to (evidence: `src/gui/RegisterFrame.java`)
- Product and checkout UI → Product persistence: loads products (evidence: `src/gui/UserProductFrame.java`)
- Product and checkout UI → Invoice persistence: creates and updates invoice (evidence: `src/gui/UserProductFrame.java`)
- Product and checkout UI → Invoice item persistence: adds invoice items (evidence: `src/gui/UserProductFrame.java`)
- Product and checkout UI → Product persistence: reduces stock (evidence: `src/gui/UserProductFrame.java`)
- Admin catalog and orders → Product persistence: manages catalog (evidence: `src/gui/AdminFrame.java`)
- Admin catalog and orders → Invoice persistence: manages orders (evidence: `src/gui/AdminFrame.java`)
- Product persistence → JDBC connection: gets connection (evidence: `src/database/ProductDAO.java`)
- User persistence → JDBC connection: gets connection (evidence: `src/database/UserDAO.java`)
- Invoice persistence → JDBC connection: gets connection (evidence: `src/database/InvoiceDAO.java`)
- Invoice item persistence → JDBC connection: gets connection (evidence: `src/database/InvoiceItemDAO.java`)
- JDBC connection → MySQL database: connects to (evidence: `src/database/DatabaseConnection.java`)
- Product persistence → Product model: builds products (evidence: `src/database/ProductDAO.java`)
- User persistence → User model: builds users (evidence: `src/database/UserDAO.java`)
- Invoice persistence → Invoice model: builds invoices (evidence: `src/database/InvoiceDAO.java`)
- Product and checkout UI → Product model: displays products (evidence: `src/gui/UserProductFrame.java`)
- Product and checkout UI → User model: uses current user (evidence: `src/gui/UserProductFrame.java`)
- Admin catalog and orders → Product model: displays products (evidence: `src/gui/AdminFrame.java`)
- Admin catalog and orders → Invoice model: displays orders (evidence: `src/gui/AdminFrame.java`)
