# 4akyz/web-food-drink architecture

> Architecture diagram of the GitHub repository 4akyz/web-food-drink, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/4akyz/web-food-drink
- Repository: https://github.com/4akyz/web-food-drink

## Overview

This is a Laravel food-ordering application with customer, employee, and admin surfaces. Its domain spans product discovery, cart and checkout, order fulfillment, payment, inventory, and customer support such as reviews and complaints; staff and admins also manage catalog, promotions, and operations. The graph emphasizes the source-index-supported customer and operations services, plus documented integrations. Many controllers and routes are listed but unsampled, so their wiring is not inferred.

Main entry points: [`app/Services/PaymentService.php`](https://github.com/4akyz/web-food-drink/blob/main/app/Services/PaymentService.php) (Payment processing), [`app/Http/Controllers/Employee/ReviewController.php`](https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Employee/ReviewController.php) (Review replies), [`app/Services/NotificationService.php`](https://github.com/4akyz/web-food-drink/blob/main/app/Services/NotificationService.php) (Notification delivery), [`app/Services/AuditLogger.php`](https://github.com/4akyz/web-food-drink/blob/main/app/Services/AuditLogger.php) (Audit logging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer commerce"]
  node_browse["Browse products"]
  node_cart["Customer cart<br/>[CustomerCart.php]"]
  node_checkout["Checkout"]
end

subgraph group_operations["Staff operations"]
  node_employee_reviews["Review replies"]
  node_admin_inventory["Inventory management"]
  node_admin_products["Product management"]
  node_employee_payments["Payment review"]
  node_promotions["Coupons and deals<br/>[CouponService.php]"]
  node_complaints["Complaint handling"]
  node_reports["Reports<br/>[ReportService.php]"]
end

subgraph group_domain["Commerce domain"]
  node_catalog[("Product catalog<br/>[Product.php]")]
  node_categories[("Categories<br/>[Category.php]")]
  node_orders[("Orders<br/>[Order.php]")]
  node_payments[("Payment records<br/>[Payment.php]")]
  node_inventory[("Inventory<br/>[Inventory.php]")]
  node_notifications[("Notifications<br/>[Notification.php]")]
  node_reviews[("Reviews<br/>[Review.php]")]
end

subgraph group_services["Application services"]
  node_order_status["Order status"]
  node_payment_service["Payment processing<br/>[PaymentService.php]"]
  node_gateway["Payment gateways<br/>[MomoService.php]"]
  node_vnpay["VNPay integration<br/>[VnpayService.php]"]
  node_inventory_deduction["Inventory deduction"]
  node_notification_service["Notification delivery"]
  node_audit["Audit logging<br/>[AuditLogger.php]"]
end

node_customer(("Customer"))
node_staff(("Employee"))
node_admin(("Administrator"))

node_browse -->|"queries"| node_catalog
node_browse -->|"queries"| node_categories
node_customer -.->|"browses"| node_browse
node_customer -.->|"manages cart"| node_cart
node_customer -.->|"checks out"| node_checkout
node_checkout -.->|"creates order"| node_orders
node_employee_reviews -->|"reads reviews"| node_reviews
node_employee_reviews -->|"sends reply notice"| node_notification_service
node_employee_reviews -->|"records action"| node_audit
node_staff -.->|"replies"| node_employee_reviews
node_admin -.->|"manages stock"| node_admin_inventory
node_admin -.->|"manages catalog"| node_admin_products
node_admin_inventory -->|"updates"| node_inventory
node_admin_inventory -->|"records action"| node_audit
node_admin_products -->|"manages"| node_catalog
node_employee_payments -->|"confirms payments"| node_payment_service
node_gateway -->|"settles gateway payment"| node_payment_service
node_vnpay -->|"settles gateway payment"| node_payment_service
node_order_status -->|"restocks on cancellation"| node_inventory_deduction
node_order_status -->|"records transitions"| node_audit
node_order_status -->|"notifies customer"| node_notification_service
node_payment_service -->|"records payment"| node_audit
node_payment_service -->|"sends payment notices"| node_notification_service
node_notification_service -->|"persists notices"| node_notifications

click node_catalog "https://github.com/4akyz/web-food-drink/blob/main/app/Models/Product.php"
click node_categories "https://github.com/4akyz/web-food-drink/blob/main/app/Models/Category.php"
click node_browse "https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/CustomerPageController.php"
click node_cart "https://github.com/4akyz/web-food-drink/blob/main/app/Services/CustomerCart.php"
click node_checkout "https://github.com/4akyz/web-food-drink/blob/main/app/Services/CustomerCheckout.php"
click node_orders "https://github.com/4akyz/web-food-drink/blob/main/app/Models/Order.php"
click node_order_status "https://github.com/4akyz/web-food-drink/blob/main/app/Services/OrderStatusService.php"
click node_payments "https://github.com/4akyz/web-food-drink/blob/main/app/Models/Payment.php"
click node_payment_service "https://github.com/4akyz/web-food-drink/blob/main/app/Services/PaymentService.php"
click node_gateway "https://github.com/4akyz/web-food-drink/blob/main/app/Services/MomoService.php"
click node_vnpay "https://github.com/4akyz/web-food-drink/blob/main/app/Services/VnpayService.php"
click node_inventory "https://github.com/4akyz/web-food-drink/blob/main/app/Models/Inventory.php"
click node_inventory_deduction "https://github.com/4akyz/web-food-drink/blob/main/app/Services/InventoryDeductionService.php"
click node_notifications "https://github.com/4akyz/web-food-drink/blob/main/app/Models/Notification.php"
click node_notification_service "https://github.com/4akyz/web-food-drink/blob/main/app/Services/NotificationService.php"
click node_reviews "https://github.com/4akyz/web-food-drink/blob/main/app/Models/Review.php"
click node_employee_reviews "https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Employee/ReviewController.php"
click node_audit "https://github.com/4akyz/web-food-drink/blob/main/app/Services/AuditLogger.php"
click node_admin_inventory "https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Admin/InventoryController.php"
click node_admin_products "https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Admin/ProductController.php"
click node_employee_payments "https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Employee/PaymentController.php"
click node_promotions "https://github.com/4akyz/web-food-drink/blob/main/app/Services/CouponService.php"
click node_complaints "https://github.com/4akyz/web-food-drink/blob/main/app/Services/ComplaintService.php"
click node_reports "https://github.com/4akyz/web-food-drink/blob/main/app/Services/ReportService.php"

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_browse,node_cart,node_checkout toneBlue
class node_employee_reviews,node_admin_inventory,node_admin_products,node_employee_payments,node_promotions,node_complaints,node_reports toneAmber
class node_catalog,node_categories,node_orders,node_payments,node_inventory,node_notifications,node_reviews toneMint
class node_order_status,node_payment_service,node_gateway,node_vnpay,node_inventory_deduction,node_notification_service,node_audit toneRose
class node_customer,node_staff,node_admin toneIndigo
```

## Components

### Customer commerce

- [Browse products](https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/CustomerPageController.php): `app/Http/Controllers/CustomerPageController.php`
- [Customer cart](https://github.com/4akyz/web-food-drink/blob/main/app/Services/CustomerCart.php): `app/Services/CustomerCart.php`
- [Checkout](https://github.com/4akyz/web-food-drink/blob/main/app/Services/CustomerCheckout.php): `app/Services/CustomerCheckout.php`

### Staff operations

- [Review replies](https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Employee/ReviewController.php): `app/Http/Controllers/Employee/ReviewController.php`
- [Inventory management](https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Admin/InventoryController.php): `app/Http/Controllers/Admin/InventoryController.php`
- [Product management](https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Admin/ProductController.php): `app/Http/Controllers/Admin/ProductController.php`
- [Payment review](https://github.com/4akyz/web-food-drink/blob/main/app/Http/Controllers/Employee/PaymentController.php): `app/Http/Controllers/Employee/PaymentController.php`
- [Coupons and deals](https://github.com/4akyz/web-food-drink/blob/main/app/Services/CouponService.php): `app/Services/CouponService.php`
- [Complaint handling](https://github.com/4akyz/web-food-drink/blob/main/app/Services/ComplaintService.php): `app/Services/ComplaintService.php`
- [Reports](https://github.com/4akyz/web-food-drink/blob/main/app/Services/ReportService.php): `app/Services/ReportService.php`

### Commerce domain

- [Product catalog](https://github.com/4akyz/web-food-drink/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Categories](https://github.com/4akyz/web-food-drink/blob/main/app/Models/Category.php): `app/Models/Category.php`
- [Orders](https://github.com/4akyz/web-food-drink/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Payment records](https://github.com/4akyz/web-food-drink/blob/main/app/Models/Payment.php): `app/Models/Payment.php`
- [Inventory](https://github.com/4akyz/web-food-drink/blob/main/app/Models/Inventory.php): `app/Models/Inventory.php`
- [Notifications](https://github.com/4akyz/web-food-drink/blob/main/app/Models/Notification.php): `app/Models/Notification.php`
- [Reviews](https://github.com/4akyz/web-food-drink/blob/main/app/Models/Review.php): `app/Models/Review.php`

### Application services

- [Order status](https://github.com/4akyz/web-food-drink/blob/main/app/Services/OrderStatusService.php): `app/Services/OrderStatusService.php`
- [Payment processing](https://github.com/4akyz/web-food-drink/blob/main/app/Services/PaymentService.php): `app/Services/PaymentService.php`
- [Payment gateways](https://github.com/4akyz/web-food-drink/blob/main/app/Services/MomoService.php): `app/Services/MomoService.php`
- [VNPay integration](https://github.com/4akyz/web-food-drink/blob/main/app/Services/VnpayService.php): `app/Services/VnpayService.php`
- [Inventory deduction](https://github.com/4akyz/web-food-drink/blob/main/app/Services/InventoryDeductionService.php): `app/Services/InventoryDeductionService.php`
- [Notification delivery](https://github.com/4akyz/web-food-drink/blob/main/app/Services/NotificationService.php): `app/Services/NotificationService.php`
- [Audit logging](https://github.com/4akyz/web-food-drink/blob/main/app/Services/AuditLogger.php): `app/Services/AuditLogger.php`

### Other components

- **Customer**
- **Employee**
- **Administrator**

## Connections

- Browse products → Product catalog: queries (evidence: `app/Http/Controllers/CustomerPageController.php`)
- Browse products → Categories: queries (evidence: `app/Http/Controllers/CustomerPageController.php`)
- Customer → Browse products: browses
- Customer → Customer cart: manages cart
- Customer → Checkout: checks out
- Checkout → Orders: creates order
- Review replies → Reviews: reads reviews (evidence: `app/Http/Controllers/Employee/ReviewController.php`)
- Review replies → Notification delivery: sends reply notice (evidence: `app/Http/Controllers/Employee/ReviewController.php`)
- Review replies → Audit logging: records action (evidence: `app/Http/Controllers/Employee/ReviewController.php`)
- Employee → Review replies: replies
- Administrator → Inventory management: manages stock
- Administrator → Product management: manages catalog
- Inventory management → Inventory: updates (evidence: `app/Http/Controllers/Admin/InventoryController.php`)
- Inventory management → Audit logging: records action (evidence: `app/Http/Controllers/Admin/InventoryController.php`)
- Product management → Product catalog: manages (evidence: `app/Http/Controllers/Admin/ProductController.php`)
- Payment review → Payment processing: confirms payments (evidence: `app/Http/Controllers/Employee/PaymentController.php`)
- Payment gateways → Payment processing: settles gateway payment (evidence: `app/Services/MomoService.php`)
- VNPay integration → Payment processing: settles gateway payment (evidence: `app/Services/VnpayService.php`)
- Order status → Inventory deduction: restocks on cancellation (evidence: `app/Services/OrderStatusService.php`)
- Order status → Audit logging: records transitions (evidence: `app/Services/OrderStatusService.php`)
- Order status → Notification delivery: notifies customer (evidence: `app/Services/OrderStatusService.php`)
- Payment processing → Audit logging: records payment (evidence: `app/Services/PaymentService.php`)
- Payment processing → Notification delivery: sends payment notices (evidence: `app/Services/PaymentService.php`)
- Notification delivery → Notifications: persists notices (evidence: `app/Services/NotificationService.php`)
