# laykimhoung/smart-order-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/laykimhoung/smart-order-management-system
- Repository: https://github.com/laykimhoung/smart-order-management-system

## Overview

This is a WinForms self-service ordering application backed by centralized SQL Server storage. Customers enter their details, browse products, build and confirm an order, then receive a waiting number and invoice; staff monitor and fulfill orders, while administrators manage users and analyze sales. The README documents QR/PDF generation, report exports, and cross-computer updates. The sampled source confirms the application entry point and database access helper; most form-to-form and order-processing wiring is inferred only from documented capabilities, so uncertain links are omitted.

Main entry points: [`SmartOrderManagementSystem/Forms/Staff/StaffDashboard.cs`](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/StaffDashboard.cs) (Order monitoring), [`SmartOrderManagementSystem/Database/DatabaseConnection.cs`](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Database/DatabaseConnection.cs) (Database access), [`SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs`](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs) (Order confirmation), [`SmartOrderManagementSystem/Forms/Admin/AdminDashboard.cs`](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/AdminDashboard.cs) (Admin overview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access"]
  node_app["Application entry<br/>[Program.cs]"]
  node_login_choice["Role selection<br/>[LoginChoiceForm.cs]"]
  node_staff_login["Staff login<br/>[LoginForm.cs]"]
  node_admin_login["Admin login<br/>[AdminLoginForm.cs]"]
end

subgraph group_customer["Customer ordering"]
  node_customer_ordering["Product and cart ordering"]
  node_order_confirmation["Order confirmation"]
  node_order_receipt["Order details and QR"]
  node_invoice["Invoice viewing<br/>[InvoiceForm.cs]"]
end

subgraph group_staff["Staff operations"]
  node_staff_dashboard["Order monitoring<br/>[StaffDashboard.cs]"]
  node_staff_home["Activity overview<br/>[StaffHome.cs]"]
  node_staff_orders["Order handling<br/>[OrderForm.cs]"]
  node_customer_records["Customer records"]
  node_staff_activity["Activity feed<br/>[Activity_Feed.cs]"]
  node_staff_messages["Staff messages<br/>[MessageForm.cs]"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Admin overview<br/>[AdminDashboard.cs]"]
  node_user_management["User management<br/>[ManageUsersForm.cs]"]
  node_order_history["Order history"]
  node_analysis["Revenue analytics<br/>[AnalysisForm.cs]"]
  node_reports["Reports and exports<br/>[ReportsForm.cs]"]
end

subgraph group_data["Persistence and outputs"]
  node_db_helper["Database access"]
  node_sql_server[("SQL Server")]
  node_qr_generator["QR generation"]
  node_pdf_export["PDF generation"]
  node_excel_export["Excel generation"]
end

node_customer_actor(("Customer"))
node_staff_actor(("Staff"))
node_admin_actor(("Administrator"))

node_app -->|"starts"| node_login_choice
node_staff_actor -->|"opens"| node_login_choice
node_admin_actor -->|"opens"| node_login_choice
node_login_choice -->|"selects staff"| node_staff_login
node_login_choice -->|"selects admin"| node_admin_login
node_staff_login -->|"authenticates to"| node_staff_dashboard
node_admin_login -->|"authenticates to"| node_admin_dashboard
node_staff_dashboard -->|"opens ordering"| node_customer_ordering
node_customer_actor -->|"enters order"| node_customer_ordering
node_customer_ordering -->|"confirms"| node_order_confirmation
node_order_confirmation -->|"saves order"| node_db_helper
node_db_helper -->|"queries and writes"| node_sql_server
node_order_confirmation -->|"returns order details"| node_order_receipt
node_order_confirmation -.->|"generates QR"| node_qr_generator
node_order_confirmation -.->|"creates invoice"| node_invoice
node_invoice -.->|"exports PDF"| node_pdf_export
node_sql_server -->|"shares new orders"| node_staff_dashboard
node_staff_dashboard -->|"shows overview"| node_staff_home
node_staff_dashboard -->|"opens orders"| node_staff_orders
node_staff_orders -->|"updates orders"| node_db_helper
node_staff_dashboard -->|"opens records"| node_customer_records
node_staff_dashboard -->|"opens activity"| node_staff_activity
node_staff_dashboard -->|"opens messages"| node_staff_messages
node_admin_dashboard -->|"opens users"| node_user_management
node_user_management -->|"manages accounts"| node_db_helper
node_admin_dashboard -->|"opens history"| node_order_history
node_order_history -->|"reads orders"| node_db_helper
node_admin_dashboard -->|"opens analytics"| node_analysis
node_analysis -->|"reads sales"| node_db_helper
node_admin_dashboard -->|"opens reports"| node_reports
node_reports -->|"loads report data"| node_db_helper
node_reports -.->|"exports PDF"| node_pdf_export
node_reports -.->|"exports Excel"| node_excel_export

click node_app "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Program.cs"
click node_login_choice "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Login/LoginChoiceForm.cs"
click node_staff_login "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Login/LoginForm.cs"
click node_admin_login "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Login/AdminLoginForm.cs"
click node_customer_ordering "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs"
click node_order_confirmation "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs"
click node_order_receipt "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/OrderDetailsForm.cs"
click node_invoice "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/InvoiceForm.cs"
click node_staff_dashboard "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/StaffDashboard.cs"
click node_staff_home "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/StaffHome.cs"
click node_staff_orders "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/OrderForm.cs"
click node_customer_records "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/CustomerRecordForm.cs"
click node_staff_activity "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/Activity_Feed.cs"
click node_staff_messages "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/MessageForm.cs"
click node_admin_dashboard "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/AdminDashboard.cs"
click node_user_management "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/ManageUsersForm.cs"
click node_order_history "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/OrderHistoryForm.cs"
click node_analysis "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/AnalysisForm.cs"
click node_reports "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/ReportsForm.cs"
click node_db_helper "https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Database/DatabaseConnection.cs"

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_app,node_login_choice,node_staff_login,node_admin_login toneBlue
class node_customer_ordering,node_order_confirmation,node_order_receipt,node_invoice toneAmber
class node_staff_dashboard,node_staff_home,node_staff_orders,node_customer_records,node_staff_activity,node_staff_messages toneMint
class node_admin_dashboard,node_user_management,node_order_history,node_analysis,node_reports toneRose
class node_db_helper,node_sql_server,node_qr_generator,node_pdf_export,node_excel_export,node_customer_actor,node_staff_actor,node_admin_actor toneIndigo
```

## Components

### Access

- [Application entry](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Program.cs): `SmartOrderManagementSystem/Program.cs`
- [Role selection](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Login/LoginChoiceForm.cs): `SmartOrderManagementSystem/Forms/Login/LoginChoiceForm.cs`
- [Staff login](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Login/LoginForm.cs): `SmartOrderManagementSystem/Forms/Login/LoginForm.cs`
- [Admin login](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Login/AdminLoginForm.cs): `SmartOrderManagementSystem/Forms/Login/AdminLoginForm.cs`

### Customer ordering

- [Product and cart ordering](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs): `SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs`
- [Order confirmation](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs): `SmartOrderManagementSystem/Forms/Customer/CustomerDashboard.cs`
- [Order details and QR](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/OrderDetailsForm.cs): `SmartOrderManagementSystem/Forms/Customer/OrderDetailsForm.cs`
- [Invoice viewing](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Customer/InvoiceForm.cs): `SmartOrderManagementSystem/Forms/Customer/InvoiceForm.cs`

### Staff operations

- [Order monitoring](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/StaffDashboard.cs): `SmartOrderManagementSystem/Forms/Staff/StaffDashboard.cs`
- [Activity overview](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/StaffHome.cs): `SmartOrderManagementSystem/Forms/Staff/StaffHome.cs`
- [Order handling](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/OrderForm.cs): `SmartOrderManagementSystem/Forms/Staff/OrderForm.cs`
- [Customer records](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/CustomerRecordForm.cs): `SmartOrderManagementSystem/Forms/Staff/CustomerRecordForm.cs`
- [Activity feed](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/Activity_Feed.cs): `SmartOrderManagementSystem/Forms/Staff/Activity_Feed.cs`
- [Staff messages](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Staff/MessageForm.cs): `SmartOrderManagementSystem/Forms/Staff/MessageForm.cs`

### Administration

- [Admin overview](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/AdminDashboard.cs): `SmartOrderManagementSystem/Forms/Admin/AdminDashboard.cs`
- [User management](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/ManageUsersForm.cs): `SmartOrderManagementSystem/Forms/Admin/ManageUsersForm.cs`
- [Order history](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/OrderHistoryForm.cs): `SmartOrderManagementSystem/Forms/Admin/OrderHistoryForm.cs`
- [Revenue analytics](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/AnalysisForm.cs): `SmartOrderManagementSystem/Forms/Admin/AnalysisForm.cs`
- [Reports and exports](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Forms/Admin/ReportsForm.cs): `SmartOrderManagementSystem/Forms/Admin/ReportsForm.cs`

### Persistence and outputs

- [Database access](https://github.com/laykimhoung/smart-order-management-system/blob/master/SmartOrderManagementSystem/Database/DatabaseConnection.cs): `SmartOrderManagementSystem/Database/DatabaseConnection.cs`
- **SQL Server**
- **QR generation**
- **PDF generation**
- **Excel generation**

### Other components

- **Customer**
- **Staff**
- **Administrator**

## Connections

- Application entry → Role selection: starts
- Staff → Role selection: opens
- Administrator → Role selection: opens
- Role selection → Staff login: selects staff
- Role selection → Admin login: selects admin
- Staff login → Order monitoring: authenticates to
- Admin login → Admin overview: authenticates to
- Order monitoring → Product and cart ordering: opens ordering
- Customer → Product and cart ordering: enters order
- Product and cart ordering → Order confirmation: confirms
- Order confirmation → Database access: saves order
- Database access → SQL Server: queries and writes
- Order confirmation → Order details and QR: returns order details
- Order confirmation → QR generation: generates QR
- Order confirmation → Invoice viewing: creates invoice
- Invoice viewing → PDF generation: exports PDF
- SQL Server → Order monitoring: shares new orders
- Order monitoring → Activity overview: shows overview
- Order monitoring → Order handling: opens orders
- Order handling → Database access: updates orders
- Order monitoring → Customer records: opens records
- Order monitoring → Activity feed: opens activity
- Order monitoring → Staff messages: opens messages
- Admin overview → User management: opens users
- User management → Database access: manages accounts
- Admin overview → Order history: opens history
- Order history → Database access: reads orders
- Admin overview → Revenue analytics: opens analytics
- Revenue analytics → Database access: reads sales
- Admin overview → Reports and exports: opens reports
- Reports and exports → Database access: loads report data
- Reports and exports → PDF generation: exports PDF
- Reports and exports → Excel generation: exports Excel
