# abdullahahmeddev-99/restaurant-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/abdullahahmeddev-99/restaurant-management-system
- Repository: https://github.com/abdullahahmeddev-99/restaurant-management-system

## Overview

This is a Qt desktop restaurant-management app. Staff browse configurable meals, build and edit a cart, enter customer/order details, validate stock, complete cash/card-with-simulated-OTP/wallet checkout, and view an invoice or sales dashboard. The GUI shares in-memory restaurant and order state with a UI-independent core for meal offers, totals, inventory, validation, payment, and sales. Edges reflect README statements and shown references/calls; unsampled dialog and dashboard wiring is represented only where documented.

Main entry points: [`gui/new_order_view.cpp`](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/new_order_view.cpp) (Order editor), [`gui/main_window.cpp`](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/main_window.cpp) (Main window), [`gui/menu_view.cpp`](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/menu_view.cpp) (Menu browser), [`core/sales_manager.cpp`](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/sales_manager.cpp) (Payment and sales totals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Qt user interface"]
  node_window["Main window<br/>[main_window.cpp]"]
  node_menu["Menu browser<br/>[menu_view.cpp]"]
  node_meal_dialogs["Meal configurators"]
  node_quantity_spin["Quantity spin control"]
end

subgraph group_checkout["Ordering and checkout"]
  node_order_view["Order editor<br/>[new_order_view.cpp]"]
  node_payment_dialog["Payment dialog<br/>[payment_dialog.cpp]"]
  node_card_details["Card details"]
  node_otp["OTP simulation"]
end

subgraph group_logic["Business logic"]
  node_models["Order and restaurant state<br/>[models.h]"]
  node_validation["Customer validation<br/>[validation.cpp]"]
  node_meal_logic["Meal offers and pricing<br/>[meal_logic.cpp]"]
  node_order_manager["Cart and inventory<br/>[order_manager.cpp]"]
end

subgraph group_records["Sales and records"]
  node_invoice["Invoice preview<br/>[invoice_dialog.cpp]"]
  node_sales_view["Sales dashboard<br/>[sales_view.cpp]"]
  node_sales_manager["Payment and sales totals<br/>[sales_manager.cpp]"]
end

node_staff(("Restaurant staff"))

node_staff -->|"uses"| node_window
node_window -->|"navigates"| node_menu
node_window -->|"navigates"| node_order_view
node_window -->|"navigates"| node_sales_view
node_menu -->|"opens"| node_meal_dialogs
node_menu -->|"adds meals"| node_meal_logic
node_menu -->|"calculates"| node_order_manager
node_meal_dialogs -->|"uses"| node_quantity_spin
node_meal_logic -->|"delegates to"| node_order_manager
node_order_view -->|"validates"| node_validation
node_order_view -->|"edits cart"| node_order_manager
node_order_view -->|"opens"| node_payment_dialog
node_order_view -->|"prepares preview"| node_invoice
node_payment_dialog -->|"opens"| node_card_details
node_payment_dialog -->|"verifies"| node_otp
node_payment_dialog -->|"processes payment"| node_sales_manager
node_sales_manager -->|"checks and deducts stock"| node_order_manager
node_sales_view -->|"shows sales"| node_sales_manager
node_invoice -->|"uses sales data"| node_sales_manager
node_window -->|"owns shared state"| node_models
node_menu -->|"reads and updates"| node_models
node_order_view -->|"reads and updates"| node_models
node_sales_manager -->|"updates totals"| node_models

click node_window "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/main_window.cpp"
click node_menu "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/menu_view.cpp"
click node_meal_dialogs "https://github.com/abdullahahmeddev-99/restaurant-management-system/tree/master/gui/dialogs"
click node_order_view "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/new_order_view.cpp"
click node_payment_dialog "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/payment_dialog.cpp"
click node_card_details "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/card_details_dialog.cpp"
click node_otp "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/otp_verification_dialog.cpp"
click node_invoice "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/invoice_dialog.cpp"
click node_sales_view "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/sales_view.cpp"
click node_models "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/models.h"
click node_validation "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/validation.cpp"
click node_meal_logic "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/meal_logic.cpp"
click node_order_manager "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/order_manager.cpp"
click node_sales_manager "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/sales_manager.cpp"
click node_quantity_spin "https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/quantity_spin_box.cpp"

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_window,node_menu,node_meal_dialogs,node_quantity_spin toneBlue
class node_order_view,node_payment_dialog,node_card_details,node_otp toneAmber
class node_models,node_validation,node_meal_logic,node_order_manager toneMint
class node_invoice,node_sales_view,node_sales_manager toneRose
class node_staff toneIndigo
```

## Components

### Qt user interface

- [Main window](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/main_window.cpp): `gui/main_window.cpp`
- [Menu browser](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/menu_view.cpp): `gui/menu_view.cpp`
- [Meal configurators](https://github.com/abdullahahmeddev-99/restaurant-management-system/tree/master/gui/dialogs): `gui/dialogs`
- [Quantity spin control](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/quantity_spin_box.cpp): `gui/dialogs/quantity_spin_box.cpp`

### Ordering and checkout

- [Order editor](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/new_order_view.cpp): `gui/new_order_view.cpp`
- [Payment dialog](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/payment_dialog.cpp): `gui/dialogs/payment_dialog.cpp`
- [Card details](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/card_details_dialog.cpp): `gui/dialogs/card_details_dialog.cpp`
- [OTP simulation](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/otp_verification_dialog.cpp): `gui/dialogs/otp_verification_dialog.cpp`

### Business logic

- [Order and restaurant state](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/models.h): `core/models.h`
- [Customer validation](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/validation.cpp): `core/validation.cpp`
- [Meal offers and pricing](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/meal_logic.cpp): `core/meal_logic.cpp`
- [Cart and inventory](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/order_manager.cpp): `core/order_manager.cpp`

### Sales and records

- [Invoice preview](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/dialogs/invoice_dialog.cpp): `gui/dialogs/invoice_dialog.cpp`
- [Sales dashboard](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/gui/sales_view.cpp): `gui/sales_view.cpp`
- [Payment and sales totals](https://github.com/abdullahahmeddev-99/restaurant-management-system/blob/master/core/sales_manager.cpp): `core/sales_manager.cpp`

### Other components

- **Restaurant staff**

## Connections

- Restaurant staff → Main window: uses (evidence: `README.md`)
- Main window → Menu browser: navigates
- Main window → Order editor: navigates
- Main window → Sales dashboard: navigates
- Menu browser → Meal configurators: opens (evidence: `gui/menu_view.cpp`)
- Menu browser → Meal offers and pricing: adds meals (evidence: `gui/menu_view.cpp`)
- Menu browser → Cart and inventory: calculates (evidence: `gui/menu_view.cpp`)
- Meal configurators → Quantity spin control: uses (evidence: `gui/dialogs/burger_dialog.cpp`)
- Meal offers and pricing → Cart and inventory: delegates to
- Order editor → Customer validation: validates (evidence: `gui/new_order_view.cpp`)
- Order editor → Cart and inventory: edits cart (evidence: `gui/new_order_view.cpp`)
- Order editor → Payment dialog: opens (evidence: `gui/new_order_view.cpp`)
- Order editor → Invoice preview: prepares preview (evidence: `gui/new_order_view.cpp`)
- Payment dialog → Card details: opens (evidence: `gui/dialogs/payment_dialog.cpp`)
- Payment dialog → OTP simulation: verifies (evidence: `README.md`)
- Payment dialog → Payment and sales totals: processes payment (evidence: `README.md`)
- Payment and sales totals → Cart and inventory: checks and deducts stock (evidence: `core/sales_manager.cpp`)
- Sales dashboard → Payment and sales totals: shows sales
- Invoice preview → Payment and sales totals: uses sales data (evidence: `gui/dialogs/invoice_dialog.cpp`)
- Main window → Order and restaurant state: owns shared state
- Menu browser → Order and restaurant state: reads and updates
- Order editor → Order and restaurant state: reads and updates
- Payment and sales totals → Order and restaurant state: updates totals (evidence: `core/sales_manager.cpp`)
