# developer-rahul-mandal/sonali-chicken architecture

> Architecture diagram of the GitHub repository developer-rahul-mandal/sonali-chicken, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/developer-rahul-mandal/sonali-chicken
- Repository: https://github.com/developer-rahul-mandal/sonali-chicken

## Overview

Sonali Chicken is a PHP/MySQL shop for browsing fresh products, placing delivery orders, and administering shop operations. The customer path runs from product discovery through cart and checkout to order creation; customers can later submit product reviews for moderation and public display. Admin pages manage products, banners, coupons, orders, reviews, and settings. The README documents email and WhatsApp order/status alerts. Some pages and integrations were not sampled, so links for documented capabilities are included only where the tree and documented workflow support them; detailed wiring for unsampled code is not inferred.

Main entry points: [`api/place-order.php`](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/place-order.php) (Order creation), [`config/database.php`](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/config/database.php) (Shared PHP services), [`api/submit-review.php`](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/submit-review.php) (Review submission), [`admin/orders.php`](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/orders.php) (Order management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Shopping storefront"]
  node_home["Home and banners<br/>[index.php]"]
  node_catalog["Product catalog<br/>[products.php]"]
  node_product["Product detail<br/>[product.php]"]
  node_cart["Shopping cart<br/>[cart.php]"]
  node_checkout["Checkout<br/>[checkout.php]"]
end

subgraph group_orders["Orders and reviews"]
  node_coupon["Coupon validation<br/>[verify-coupon.php]"]
  node_place_order["Order creation<br/>[place-order.php]"]
  node_success["Order confirmation<br/>[order-success.php]"]
  node_review_form["Review form<br/>[review.php]"]
  node_review_submit["Review submission<br/>[submit-review.php]"]
  node_review_public["Public reviews<br/>[reviews.php]"]
end

subgraph group_admin["Shop administration"]
  node_admin_orders["Order management<br/>[orders.php]"]
  node_admin_history["Order history<br/>[order-history.php]"]
  node_admin_products["Product management<br/>[products.php]"]
  node_admin_banners["Banner management<br/>[banners.php]"]
  node_admin_coupons["Coupon management<br/>[coupons.php]"]
  node_admin_reviews["Review moderation<br/>[reviews.php]"]
  node_admin_settings["Shop settings<br/>[settings.php]"]
  node_admin_qr["QR codes<br/>[qr-codes.php]"]
end

subgraph group_services["Data and notifications"]
  node_config["Shared PHP services<br/>[database.php]"]
  node_db[("MySQL database")]
  node_uploads["Uploaded media"]
  node_email["SMTP email"]
  node_whatsapp["WhatsApp API"]
end

node_customer(("Customer"))
node_admin_user(("Shop admin"))

node_customer -->|"browses"| node_home
node_customer -->|"browses"| node_catalog
node_customer -->|"views"| node_product
node_customer -->|"manages cart"| node_cart
node_customer -->|"checks out"| node_checkout
node_home -->|"loads settings"| node_config
node_home -->|"reads banners/products"| node_db
node_catalog -->|"reads products"| node_db
node_product -->|"reads product"| node_db
node_checkout -->|"checks coupon"| node_coupon
node_checkout -->|"submits order"| node_place_order
node_place_order -->|"writes order"| node_db
node_place_order -->|"uses helpers"| node_config
node_place_order -->|"returns confirmation"| node_success
node_place_order -.->|"sends alerts"| node_email
node_place_order -.->|"sends alerts"| node_whatsapp
node_customer -->|"rates purchase"| node_review_form
node_review_form -->|"submits review"| node_review_submit
node_review_submit -->|"checks order; saves review"| node_db
node_review_submit -->|"stores review image"| node_uploads
node_review_submit -.->|"notifies admin"| node_email
node_customer -->|"views reviews"| node_review_public
node_review_public -->|"reads approved reviews"| node_db
node_admin_user -->|"manages orders"| node_admin_orders
node_admin_user -->|"manages products"| node_admin_products
node_admin_user -->|"manages banners"| node_admin_banners
node_admin_user -->|"manages coupons"| node_admin_coupons
node_admin_user -->|"moderates reviews"| node_admin_reviews
node_admin_user -->|"configures shop"| node_admin_settings
node_admin_user -->|"manages QR codes"| node_admin_qr
node_admin_orders -->|"updates order status"| node_db
node_admin_orders -.->|"sends status alert"| node_email
node_admin_orders -.->|"sends status alert"| node_whatsapp
node_admin_history -->|"reads past orders"| node_db
node_admin_products -->|"updates products"| node_db
node_admin_products -->|"stores product images"| node_uploads
node_admin_banners -->|"updates banners"| node_db
node_admin_banners -->|"stores banner images"| node_uploads
node_admin_coupons -->|"updates coupons"| node_db
node_admin_reviews -->|"moderates reviews"| node_db
node_admin_reviews -.->|"notifies customer"| node_email
node_admin_reviews -.->|"notifies customer"| node_whatsapp
node_admin_settings -->|"saves settings"| node_db
node_admin_qr -->|"reads QR data"| node_db
node_config -->|"connects"| node_db
node_config -.->|"sends via SMTP"| node_email
node_config -.->|"sends messages"| node_whatsapp

click node_home "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/index.php"
click node_catalog "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/products.php"
click node_product "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/product.php"
click node_cart "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/cart.php"
click node_checkout "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/checkout.php"
click node_coupon "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/verify-coupon.php"
click node_place_order "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/place-order.php"
click node_success "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/order-success.php"
click node_review_form "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/review.php"
click node_review_submit "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/submit-review.php"
click node_review_public "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/reviews.php"
click node_admin_orders "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/orders.php"
click node_admin_history "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/order-history.php"
click node_admin_products "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/products.php"
click node_admin_banners "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/banners.php"
click node_admin_coupons "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/coupons.php"
click node_admin_reviews "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/reviews.php"
click node_admin_settings "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/settings.php"
click node_admin_qr "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/qr-codes.php"
click node_config "https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/config/database.php"
click node_uploads "https://github.com/developer-rahul-mandal/sonali-chicken/tree/main/uploads"

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_home,node_catalog,node_product,node_cart,node_checkout toneBlue
class node_coupon,node_place_order,node_success,node_review_form,node_review_submit,node_review_public toneAmber
class node_admin_orders,node_admin_history,node_admin_products,node_admin_banners,node_admin_coupons,node_admin_reviews,node_admin_settings,node_admin_qr toneMint
class node_config,node_db,node_uploads,node_email,node_whatsapp toneRose
class node_customer,node_admin_user toneIndigo
```

## Components

### Shopping storefront

- [Home and banners](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/index.php): `index.php`
- [Product catalog](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/products.php): `products.php`
- [Product detail](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/product.php): `product.php`
- [Shopping cart](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/cart.php): `cart.php`
- [Checkout](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/checkout.php): `checkout.php`

### Orders and reviews

- [Coupon validation](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/verify-coupon.php): `api/verify-coupon.php`
- [Order creation](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/place-order.php): `api/place-order.php`
- [Order confirmation](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/order-success.php): `order-success.php`
- [Review form](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/review.php): `review.php`
- [Review submission](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/api/submit-review.php): `api/submit-review.php`
- [Public reviews](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/reviews.php): `reviews.php`

### Shop administration

- [Order management](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/orders.php): `admin/orders.php`
- [Order history](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/order-history.php): `admin/order-history.php`
- [Product management](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/products.php): `admin/products.php`
- [Banner management](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/banners.php): `admin/banners.php`
- [Coupon management](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/coupons.php): `admin/coupons.php`
- [Review moderation](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/reviews.php): `admin/reviews.php`
- [Shop settings](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/settings.php): `admin/settings.php`
- [QR codes](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/admin/qr-codes.php): `admin/qr-codes.php`

### Data and notifications

- [Shared PHP services](https://github.com/developer-rahul-mandal/sonali-chicken/blob/main/config/database.php): `config/database.php`
- **MySQL database**
- [Uploaded media](https://github.com/developer-rahul-mandal/sonali-chicken/tree/main/uploads): `uploads`
- **SMTP email**
- **WhatsApp API**

### Other components

- **Customer**
- **Shop admin**

## Connections

- Customer → Home and banners: browses
- Customer → Product catalog: browses
- Customer → Product detail: views
- Customer → Shopping cart: manages cart
- Customer → Checkout: checks out
- Home and banners → Shared PHP services: loads settings
- Home and banners → MySQL database: reads banners/products
- Product catalog → MySQL database: reads products
- Product detail → MySQL database: reads product
- Checkout → Coupon validation: checks coupon
- Checkout → Order creation: submits order
- Order creation → MySQL database: writes order
- Order creation → Shared PHP services: uses helpers
- Order creation → Order confirmation: returns confirmation
- Order creation → SMTP email: sends alerts
- Order creation → WhatsApp API: sends alerts
- Customer → Review form: rates purchase
- Review form → Review submission: submits review
- Review submission → MySQL database: checks order; saves review
- Review submission → Uploaded media: stores review image
- Review submission → SMTP email: notifies admin
- Customer → Public reviews: views reviews
- Public reviews → MySQL database: reads approved reviews
- Shop admin → Order management: manages orders
- Shop admin → Product management: manages products
- Shop admin → Banner management: manages banners
- Shop admin → Coupon management: manages coupons
- Shop admin → Review moderation: moderates reviews
- Shop admin → Shop settings: configures shop
- Shop admin → QR codes: manages QR codes
- Order management → MySQL database: updates order status
- Order management → SMTP email: sends status alert
- Order management → WhatsApp API: sends status alert
- Order history → MySQL database: reads past orders
- Product management → MySQL database: updates products
- Product management → Uploaded media: stores product images
- Banner management → MySQL database: updates banners
- Banner management → Uploaded media: stores banner images
- Coupon management → MySQL database: updates coupons
- Review moderation → MySQL database: moderates reviews
- Review moderation → SMTP email: notifies customer
- Review moderation → WhatsApp API: notifies customer
- Shop settings → MySQL database: saves settings
- QR codes → MySQL database: reads QR data
- Shared PHP services → MySQL database: connects
- Shared PHP services → SMTP email: sends via SMTP
- Shared PHP services → WhatsApp API: sends messages
