# iamrellzera/ecommercesystem architecture

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

- Interactive diagram: https://gitdiagram.com/iamrellzera/ecommercesystem
- Repository: https://github.com/iamrellzera/ecommercesystem

## Overview

EcommerceSystem is a PHP/MySQL catalog with a customer storefront and an admin CRUD/order-management area. Customers browse and filter products, add items to a session cart, submit delivery details, and receive an order confirmation; administrators manage catalog data and orders. The graph includes shared helpers, page layouts, and persistence. Some admin capabilities are documented or named in the source index but were not sampled in full, so their internal links are omitted where evidence is unavailable.

Main entry points: [`checkout.php`](https://github.com/iamrellzera/ecommercesystem/blob/main/checkout.php) (Checkout and order creation), [`index.php`](https://github.com/iamrellzera/ecommercesystem/blob/main/index.php) (Catalog and search), [`cart.php`](https://github.com/iamrellzera/ecommercesystem/blob/main/cart.php) (Session cart), [`db_connect.php`](https://github.com/iamrellzera/ecommercesystem/blob/main/db_connect.php) (PDO connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store["Customer storefront"]
  node_catalog["Catalog and search<br/>[index.php]"]
  node_product_detail["Product details<br/>[product.php]"]
end

subgraph group_orders["Cart and orders"]
  node_cart["Session cart<br/>[cart.php]"]
  node_checkout["Checkout and order creation<br/>[checkout.php]"]
  node_confirmation["Order confirmation<br/>[order_success.php]"]
end

subgraph group_admin["Administration"]
  node_category_admin["Category management<br/>[categories.php]"]
  node_category_edit["Category editing<br/>[edit_category.php]"]
  node_category_delete["Category deletion"]
  node_product_admin["Product management<br/>[admin_products.php]"]
  node_product_add["Product creation<br/>[add_product.php]"]
  node_product_edit["Product editing<br/>[edit_product.php]"]
  node_product_delete["Product deletion<br/>[delete_product.php]"]
  node_product_form["Product form<br/>[product_form.php]"]
  node_admin_auth["Admin access<br/>[admin_login.php]"]
  node_admin_dashboard["Admin dashboard"]
  node_order_list["Order list<br/>[admin_orders.php]"]
  node_order_detail["Order review"]
end

subgraph group_shared["Shared runtime"]
  node_db[("MySQL database<br/>[database.sql.sql]")]
  node_db_connection["PDO connection<br/>[db_connect.php]"]
  node_helpers["Session and validation helpers<br/>[functions.php]"]
  node_store_layout["Store layout<br/>[store_header.php]"]
  node_store_footer["Store footer<br/>[store_footer.php]"]
  node_admin_layout["Admin layout<br/>[header.php]"]
  node_admin_footer["Admin footer<br/>[footer.php]"]
end

node_customer(("Customer"))
node_admin_user(("Administrator"))

node_customer -->|"browses and filters"| node_catalog
node_catalog -->|"queries through"| node_db_connection
node_catalog -->|"reads products and categories"| node_db
node_catalog -->|"opens product"| node_product_detail
node_catalog -->|"adds item"| node_cart
node_customer -.->|"views product"| node_product_detail
node_customer -->|"manages cart"| node_cart
node_cart -->|"loads products through"| node_db_connection
node_cart -->|"loads cart items"| node_helpers
node_cart -.->|"continues to checkout"| node_checkout
node_customer -->|"submits order"| node_checkout
node_checkout -->|"loads cart items"| node_helpers
node_checkout -->|"writes transaction through"| node_db_connection
node_checkout -->|"saves order and stock changes"| node_db
node_checkout -->|"redirects after commit"| node_confirmation
node_admin_user -.->|"signs in"| node_admin_auth
node_admin_user -.->|"manages store"| node_admin_dashboard
node_admin_dashboard -->|"queries through"| node_db_connection
node_admin_user -->|"manages categories"| node_category_admin
node_category_admin -->|"queries through"| node_db_connection
node_category_admin -->|"opens edit"| node_category_edit
node_category_admin -->|"submits deletion"| node_category_delete
node_admin_user -.->|"manages products"| node_product_admin
node_product_add -->|"renders"| node_product_form
node_product_edit -->|"renders"| node_product_form
node_admin_user -.->|"reviews orders"| node_order_list
node_order_list -.->|"opens order"| node_order_detail
node_order_detail -->|"updates through"| node_db_connection
node_db_connection -->|"loads"| node_helpers
node_catalog -->|"renders with"| node_store_layout
node_catalog -->|"renders with"| node_store_footer
node_cart -->|"renders with"| node_store_layout
node_cart -->|"renders with"| node_store_footer
node_checkout -->|"renders with"| node_store_layout
node_checkout -->|"renders with"| node_store_footer
node_admin_dashboard -->|"renders with"| node_admin_layout
node_admin_dashboard -->|"renders with"| node_admin_footer

click node_catalog "https://github.com/iamrellzera/ecommercesystem/blob/main/index.php"
click node_product_detail "https://github.com/iamrellzera/ecommercesystem/blob/main/product.php"
click node_category_admin "https://github.com/iamrellzera/ecommercesystem/blob/main/categories.php"
click node_category_edit "https://github.com/iamrellzera/ecommercesystem/blob/main/edit_category.php"
click node_category_delete "https://github.com/iamrellzera/ecommercesystem/blob/main/delete_category.php"
click node_product_admin "https://github.com/iamrellzera/ecommercesystem/blob/main/admin_products.php"
click node_product_add "https://github.com/iamrellzera/ecommercesystem/blob/main/add_product.php"
click node_product_edit "https://github.com/iamrellzera/ecommercesystem/blob/main/edit_product.php"
click node_product_delete "https://github.com/iamrellzera/ecommercesystem/blob/main/delete_product.php"
click node_product_form "https://github.com/iamrellzera/ecommercesystem/blob/main/product_form.php"
click node_admin_auth "https://github.com/iamrellzera/ecommercesystem/blob/main/admin_login.php"
click node_admin_dashboard "https://github.com/iamrellzera/ecommercesystem/blob/main/admin_dashboard.php"
click node_order_list "https://github.com/iamrellzera/ecommercesystem/blob/main/admin_orders.php"
click node_order_detail "https://github.com/iamrellzera/ecommercesystem/blob/main/admin_order_view.php"
click node_cart "https://github.com/iamrellzera/ecommercesystem/blob/main/cart.php"
click node_checkout "https://github.com/iamrellzera/ecommercesystem/blob/main/checkout.php"
click node_confirmation "https://github.com/iamrellzera/ecommercesystem/blob/main/order_success.php"
click node_db "https://github.com/iamrellzera/ecommercesystem/blob/main/database.sql.sql"
click node_db_connection "https://github.com/iamrellzera/ecommercesystem/blob/main/db_connect.php"
click node_helpers "https://github.com/iamrellzera/ecommercesystem/blob/main/functions.php"
click node_store_layout "https://github.com/iamrellzera/ecommercesystem/blob/main/store_header.php"
click node_store_footer "https://github.com/iamrellzera/ecommercesystem/blob/main/store_footer.php"
click node_admin_layout "https://github.com/iamrellzera/ecommercesystem/blob/main/header.php"
click node_admin_footer "https://github.com/iamrellzera/ecommercesystem/blob/main/footer.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_catalog,node_product_detail toneBlue
class node_cart,node_checkout,node_confirmation toneAmber
class node_category_admin,node_category_edit,node_category_delete,node_product_admin,node_product_add,node_product_edit,node_product_delete,node_product_form,node_admin_auth,node_admin_dashboard,node_order_list,node_order_detail toneMint
class node_db,node_db_connection,node_helpers,node_store_layout,node_store_footer,node_admin_layout,node_admin_footer toneRose
class node_customer,node_admin_user toneIndigo
```

## Components

### Customer storefront

- [Catalog and search](https://github.com/iamrellzera/ecommercesystem/blob/main/index.php): `index.php`
- [Product details](https://github.com/iamrellzera/ecommercesystem/blob/main/product.php): `product.php`

### Cart and orders

- [Session cart](https://github.com/iamrellzera/ecommercesystem/blob/main/cart.php): `cart.php`
- [Checkout and order creation](https://github.com/iamrellzera/ecommercesystem/blob/main/checkout.php): `checkout.php`
- [Order confirmation](https://github.com/iamrellzera/ecommercesystem/blob/main/order_success.php): `order_success.php`

### Administration

- [Category management](https://github.com/iamrellzera/ecommercesystem/blob/main/categories.php): `categories.php`
- [Category editing](https://github.com/iamrellzera/ecommercesystem/blob/main/edit_category.php): `edit_category.php`
- [Category deletion](https://github.com/iamrellzera/ecommercesystem/blob/main/delete_category.php): `delete_category.php`
- [Product management](https://github.com/iamrellzera/ecommercesystem/blob/main/admin_products.php): `admin_products.php`
- [Product creation](https://github.com/iamrellzera/ecommercesystem/blob/main/add_product.php): `add_product.php`
- [Product editing](https://github.com/iamrellzera/ecommercesystem/blob/main/edit_product.php): `edit_product.php`
- [Product deletion](https://github.com/iamrellzera/ecommercesystem/blob/main/delete_product.php): `delete_product.php`
- [Product form](https://github.com/iamrellzera/ecommercesystem/blob/main/product_form.php): `product_form.php`
- [Admin access](https://github.com/iamrellzera/ecommercesystem/blob/main/admin_login.php): `admin_login.php`
- [Admin dashboard](https://github.com/iamrellzera/ecommercesystem/blob/main/admin_dashboard.php): `admin_dashboard.php`
- [Order list](https://github.com/iamrellzera/ecommercesystem/blob/main/admin_orders.php): `admin_orders.php`
- [Order review](https://github.com/iamrellzera/ecommercesystem/blob/main/admin_order_view.php): `admin_order_view.php`

### Shared runtime

- [MySQL database](https://github.com/iamrellzera/ecommercesystem/blob/main/database.sql.sql): `database.sql.sql`
- [PDO connection](https://github.com/iamrellzera/ecommercesystem/blob/main/db_connect.php): `db_connect.php`
- [Session and validation helpers](https://github.com/iamrellzera/ecommercesystem/blob/main/functions.php): `functions.php`
- [Store layout](https://github.com/iamrellzera/ecommercesystem/blob/main/store_header.php): `store_header.php`
- [Store footer](https://github.com/iamrellzera/ecommercesystem/blob/main/store_footer.php): `store_footer.php`
- [Admin layout](https://github.com/iamrellzera/ecommercesystem/blob/main/header.php): `header.php`
- [Admin footer](https://github.com/iamrellzera/ecommercesystem/blob/main/footer.php): `footer.php`

### Other components

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

## Connections

- Customer → Catalog and search: browses and filters (evidence: `index.php`)
- Catalog and search → PDO connection: queries through (evidence: `index.php`)
- Catalog and search → MySQL database: reads products and categories (evidence: `index.php`)
- Catalog and search → Product details: opens product (evidence: `index.php`)
- Catalog and search → Session cart: adds item (evidence: `index.php`)
- Customer → Product details: views product
- Customer → Session cart: manages cart (evidence: `cart.php`)
- Session cart → PDO connection: loads products through (evidence: `cart.php`)
- Session cart → Session and validation helpers: loads cart items (evidence: `cart.php`)
- Session cart → Checkout and order creation: continues to checkout
- Customer → Checkout and order creation: submits order (evidence: `checkout.php`)
- Checkout and order creation → Session and validation helpers: loads cart items (evidence: `checkout.php`)
- Checkout and order creation → PDO connection: writes transaction through (evidence: `checkout.php`)
- Checkout and order creation → MySQL database: saves order and stock changes (evidence: `checkout.php`)
- Checkout and order creation → Order confirmation: redirects after commit (evidence: `checkout.php`)
- Administrator → Admin access: signs in
- Administrator → Admin dashboard: manages store
- Admin dashboard → PDO connection: queries through (evidence: `admin_dashboard.php`)
- Administrator → Category management: manages categories (evidence: `categories.php`)
- Category management → PDO connection: queries through (evidence: `categories.php`)
- Category management → Category editing: opens edit (evidence: `categories.php`)
- Category management → Category deletion: submits deletion (evidence: `categories.php`)
- Administrator → Product management: manages products
- Product creation → Product form: renders (evidence: `add_product.php`)
- Product editing → Product form: renders (evidence: `edit_product.php`)
- Administrator → Order list: reviews orders
- Order list → Order review: opens order
- Order review → PDO connection: updates through (evidence: `admin_order_view.php`)
- PDO connection → Session and validation helpers: loads (evidence: `db_connect.php`)
- Catalog and search → Store layout: renders with (evidence: `index.php`)
- Catalog and search → Store footer: renders with (evidence: `index.php`)
- Session cart → Store layout: renders with (evidence: `cart.php`)
- Session cart → Store footer: renders with (evidence: `cart.php`)
- Checkout and order creation → Store layout: renders with (evidence: `checkout.php`)
- Checkout and order creation → Store footer: renders with (evidence: `checkout.php`)
- Admin dashboard → Admin layout: renders with (evidence: `admin_dashboard.php`)
- Admin dashboard → Admin footer: renders with (evidence: `admin_dashboard.php`)
