# jaswanth-komatineni/ecommerce-website architecture

> Architecture diagram of the GitHub repository jaswanth-komatineni/ecommerce-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaswanth-komatineni/ecommerce-website
- Repository: https://github.com/jaswanth-komatineni/ecommerce-website

## Overview

This is a procedural PHP/MySQL storefront. Shoppers browse the catalog, register or sign in, manage a session-authenticated cart, review checkout, and reach a success page that clears the cart. Admins authenticate separately and manage the product catalog. The graph reflects source excerpts and README claims; the tree does not contain the README-listed order-history page, and no payment integration or persistent order creation is shown.

Main entry points: [`includes/db.php`](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/includes/db.php) (PDO connection), [`admin/manage_products.php`](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/manage_products.php) (Product inventory), [`pages/cart.php`](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/cart.php) (Cart management), [`index.php`](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/index.php) (Product browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Shopping experience"]
  node_catalog["Product browsing<br/>[index.php]"]
  node_cart["Cart management<br/>[cart.php]"]
  node_checkout["Order summary<br/>[buy.php]"]
  node_success["Order success<br/>[order_success.php]"]
  node_history["Order history"]
end

subgraph group_identity["Account access"]
  node_registration["Registration<br/>[register.php]"]
  node_userlogin["User login<br/>[login.php]"]
  node_userlogout["User logout<br/>[logout.php]"]
end

subgraph group_admin["Administration"]
  node_adminlogin["Admin login<br/>[login.php]"]
  node_dashboard["Admin dashboard<br/>[dashboard.php]"]
  node_productlist["Product inventory"]
  node_productadd["Add product<br/>[add_product.php]"]
  node_productedit["Edit product<br/>[edit_product.php]"]
  node_productdelete["Delete product<br/>[delete_product.php]"]
  node_adminlogout["Admin logout<br/>[logout.php]"]
end

subgraph group_infra["Persistence and assets"]
  node_dbconfig["PDO connection<br/>[db.php]"]
  node_mysql[("MySQL database")]
  node_images["Product images"]
end

node_shopper(("Shopper"))
node_adminactor(("Admin"))

node_shopper -->|"browses"| node_catalog
node_catalog -->|"posts items"| node_cart
node_shopper -->|"registers"| node_registration
node_shopper -->|"signs in"| node_userlogin
node_shopper -->|"manages"| node_cart
node_cart -->|"continues"| node_checkout
node_checkout -->|"places order"| node_success
node_shopper -.->|"views orders"| node_history
node_shopper -.->|"logs out"| node_userlogout
node_adminlogin -->|"redirects"| node_dashboard
node_dashboard -.->|"manages catalog"| node_productlist
node_productlist -->|"links to edit"| node_productedit
node_productlist -->|"links to delete"| node_productdelete
node_adminactor -.->|"adds products"| node_productadd
node_adminactor -.->|"authenticates"| node_adminlogin
node_adminactor -.->|"logs out"| node_adminlogout
node_catalog -->|"queries products"| node_dbconfig
node_cart -->|"reads and writes cart"| node_dbconfig
node_checkout -->|"reads cart"| node_dbconfig
node_success -->|"clears cart"| node_dbconfig
node_registration -->|"creates account"| node_dbconfig
node_userlogin -->|"checks credentials"| node_dbconfig
node_adminlogin -->|"checks admin"| node_dbconfig
node_productlist -->|"loads products"| node_dbconfig
node_productadd -->|"inserts product"| node_dbconfig
node_productedit -->|"updates product"| node_dbconfig
node_productdelete -->|"deletes product"| node_dbconfig
node_dbconfig -->|"connects"| node_mysql
node_productadd -->|"uploads image"| node_images
node_productedit -->|"uploads image"| node_images
node_productdelete -->|"removes image"| node_images

click node_catalog "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/index.php"
click node_cart "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/cart.php"
click node_checkout "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/buy.php"
click node_success "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/order_success.php"
click node_history "https://github.com/jaswanth-komatineni/ecommerce-website/tree/main/pages"
click node_registration "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/register.php"
click node_userlogin "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/login.php"
click node_userlogout "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/logout.php"
click node_adminlogin "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/login.php"
click node_dashboard "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/dashboard.php"
click node_productlist "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/manage_products.php"
click node_productadd "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/add_product.php"
click node_productedit "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/edit_product.php"
click node_productdelete "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/delete_product.php"
click node_adminlogout "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/logout.php"
click node_dbconfig "https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/includes/db.php"
click node_images "https://github.com/jaswanth-komatineni/ecommerce-website/tree/main/images"

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_cart,node_checkout,node_success,node_history toneBlue
class node_registration,node_userlogin,node_userlogout toneAmber
class node_adminlogin,node_dashboard,node_productlist,node_productadd,node_productedit,node_productdelete,node_adminlogout toneMint
class node_dbconfig,node_mysql,node_images toneRose
class node_shopper,node_adminactor toneIndigo
```

## Components

### Shopping experience

- [Product browsing](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/index.php): `index.php`
- [Cart management](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/cart.php): `pages/cart.php`
- [Order summary](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/buy.php): `pages/buy.php`
- [Order success](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/order_success.php): `pages/order_success.php`
- [Order history](https://github.com/jaswanth-komatineni/ecommerce-website/tree/main/pages): `pages`

### Account access

- [Registration](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/register.php): `pages/register.php`
- [User login](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/login.php): `pages/login.php`
- [User logout](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/pages/logout.php): `pages/logout.php`

### Administration

- [Admin login](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/login.php): `admin/login.php`
- [Admin dashboard](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/dashboard.php): `admin/dashboard.php`
- [Product inventory](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/manage_products.php): `admin/manage_products.php`
- [Add product](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/add_product.php): `admin/add_product.php`
- [Edit product](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/edit_product.php): `admin/edit_product.php`
- [Delete product](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/delete_product.php): `admin/delete_product.php`
- [Admin logout](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/admin/logout.php): `admin/logout.php`

### Persistence and assets

- [PDO connection](https://github.com/jaswanth-komatineni/ecommerce-website/blob/main/includes/db.php): `includes/db.php`
- **MySQL database**
- [Product images](https://github.com/jaswanth-komatineni/ecommerce-website/tree/main/images): `images`

### Other components

- **Shopper**
- **Admin**

## Connections

- Shopper → Product browsing: browses (evidence: `index.php`)
- Product browsing → Cart management: posts items (evidence: `index.php`)
- Shopper → Registration: registers (evidence: `README.md`)
- Shopper → User login: signs in
- Shopper → Cart management: manages (evidence: `pages/cart.php`)
- Cart management → Order summary: continues (evidence: `pages/cart.php`)
- Order summary → Order success: places order (evidence: `pages/buy.php`)
- Shopper → Order history: views orders (evidence: `README.md`)
- Shopper → User logout: logs out (evidence: `README.md`)
- Admin login → Admin dashboard: redirects (evidence: `admin/login.php`)
- Admin dashboard → Product inventory: manages catalog (evidence: `README.md`)
- Product inventory → Edit product: links to edit (evidence: `admin/manage_products.php`)
- Product inventory → Delete product: links to delete (evidence: `admin/manage_products.php`)
- Admin → Add product: adds products (evidence: `README.md`)
- Admin → Admin login: authenticates (evidence: `README.md`)
- Admin → Admin logout: logs out (evidence: `README.md`)
- Product browsing → PDO connection: queries products (evidence: `index.php`)
- Cart management → PDO connection: reads and writes cart (evidence: `pages/cart.php`)
- Order summary → PDO connection: reads cart (evidence: `pages/buy.php`)
- Order success → PDO connection: clears cart (evidence: `pages/order_success.php`)
- Registration → PDO connection: creates account (evidence: `pages/register.php`)
- User login → PDO connection: checks credentials (evidence: `pages/login.php`)
- Admin login → PDO connection: checks admin (evidence: `admin/login.php`)
- Product inventory → PDO connection: loads products (evidence: `admin/manage_products.php`)
- Add product → PDO connection: inserts product (evidence: `admin/add_product.php`)
- Edit product → PDO connection: updates product (evidence: `admin/edit_product.php`)
- Delete product → PDO connection: deletes product (evidence: `admin/delete_product.php`)
- PDO connection → MySQL database: connects (evidence: `includes/db.php`)
- Add product → Product images: uploads image (evidence: `admin/add_product.php`)
- Edit product → Product images: uploads image (evidence: `admin/edit_product.php`)
- Delete product → Product images: removes image (evidence: `admin/delete_product.php`)
