# winston-dsouza/ecommerce-website architecture

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

- Interactive diagram: https://gitdiagram.com/winston-dsouza/ecommerce-website
- Repository: https://github.com/winston-dsouza/ecommerce-website

## Overview

Planet Shopify is a PHP/MySQL storefront for men’s products. Visitors browse the home page and catalog; account forms create or authenticate a session, after which shoppers can add items, review or remove cart entries, and confirm an order. Shared navigation exposes the storefront and account actions, while the About page provides a contact form handled by Formspree. The excerpts show key page calls and SQL; unsampled endpoints and schema details are represented only where the index or README supports them.

Main entry points: [`cart.php`](https://github.com/winston-dsouza/ecommerce-website/blob/master/cart.php) (Cart view), [`includes/header_menu.php`](https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/header_menu.php) (Account navigation and forms), [`includes/common.php`](https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/common.php) (Database connection), [`ecommerce.sql`](https://github.com/winston-dsouza/ecommerce-website/blob/master/ecommerce.sql) (Ecommerce database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home page<br/>[index.php]"]
  node_catalog["Product catalog<br/>[products.php]"]
  node_about["About and contact<br/>[about.php]"]
end

subgraph group_accounts["Accounts"]
  node_authui["Account navigation and forms<br/>[header_menu.php]"]
  node_signup["Sign up<br/>[signup_script.php]"]
  node_login["Log in<br/>[login_script.php]"]
  node_logout["Log out<br/>[logout_script.php]"]
end

subgraph group_commerce["Cart and Orders"]
  node_cartcheck["Cart status check<br/>[check-if-added.php]"]
  node_cartadd["Add to cart<br/>[cart-add.php]"]
  node_cartview["Cart view<br/>[cart.php]"]
  node_cartremove["Remove cart item<br/>[cart-remove.php]"]
  node_order["Order confirmation<br/>[success.php]"]
end

subgraph group_shared["Shared and Integrations"]
  node_dbconn["Database connection<br/>[common.php]"]
  node_database[("Ecommerce database<br/>[ecommerce.sql]")]
  node_footer["Shared footer<br/>[footer.php]"]
end

node_shopper(("Shopper"))
node_formspree["Formspree"]

node_shopper -->|"opens"| node_home
node_home -->|"includes"| node_authui
node_home -->|"includes"| node_cartcheck
node_home -->|"links to"| node_catalog
node_home -->|"includes"| node_footer
node_catalog -->|"includes"| node_authui
node_catalog -->|"checks items"| node_cartcheck
node_catalog -->|"links to"| node_cartadd
node_authui -->|"posts to"| node_login
node_authui -->|"posts to"| node_signup
node_authui -->|"links to"| node_cartview
node_authui -->|"links to"| node_logout
node_signup -->|"uses connection"| node_dbconn
node_signup -->|"queries users"| node_database
node_login -->|"uses connection"| node_dbconn
node_login -->|"queries users"| node_database
node_cartcheck -->|"loads connection"| node_dbconn
node_cartview -->|"loads connection"| node_dbconn
node_cartview -->|"reads cart"| node_database
node_cartview -->|"links to"| node_cartremove
node_cartview -->|"links to"| node_order
node_cartremove -->|"loads connection"| node_dbconn
node_cartremove -->|"deletes item"| node_database
node_cartremove -->|"redirects to"| node_cartview
node_order -->|"loads connection"| node_dbconn
node_order -->|"confirms items"| node_database
node_dbconn -->|"connects to"| node_database
node_about -->|"includes"| node_authui
node_about -->|"includes"| node_footer
node_about -->|"submits form"| node_formspree
node_catalog -->|"includes"| node_footer
node_cartview -->|"includes"| node_footer
node_order -->|"includes"| node_footer

click node_home "https://github.com/winston-dsouza/ecommerce-website/blob/master/index.php"
click node_catalog "https://github.com/winston-dsouza/ecommerce-website/blob/master/products.php"
click node_about "https://github.com/winston-dsouza/ecommerce-website/blob/master/about.php"
click node_authui "https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/header_menu.php"
click node_signup "https://github.com/winston-dsouza/ecommerce-website/blob/master/signup_script.php"
click node_login "https://github.com/winston-dsouza/ecommerce-website/blob/master/login_script.php"
click node_logout "https://github.com/winston-dsouza/ecommerce-website/blob/master/logout_script.php"
click node_cartcheck "https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/check-if-added.php"
click node_cartadd "https://github.com/winston-dsouza/ecommerce-website/blob/master/cart-add.php"
click node_cartview "https://github.com/winston-dsouza/ecommerce-website/blob/master/cart.php"
click node_cartremove "https://github.com/winston-dsouza/ecommerce-website/blob/master/cart-remove.php"
click node_order "https://github.com/winston-dsouza/ecommerce-website/blob/master/success.php"
click node_dbconn "https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/common.php"
click node_database "https://github.com/winston-dsouza/ecommerce-website/blob/master/ecommerce.sql"
click node_footer "https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/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_home,node_catalog,node_about toneBlue
class node_authui,node_signup,node_login,node_logout toneAmber
class node_cartcheck,node_cartadd,node_cartview,node_cartremove,node_order toneMint
class node_dbconn,node_database,node_footer toneRose
class node_shopper,node_formspree toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/winston-dsouza/ecommerce-website/blob/master/index.php): `index.php`
- [Product catalog](https://github.com/winston-dsouza/ecommerce-website/blob/master/products.php): `products.php`
- [About and contact](https://github.com/winston-dsouza/ecommerce-website/blob/master/about.php): `about.php`

### Accounts

- [Account navigation and forms](https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/header_menu.php): `includes/header_menu.php`
- [Sign up](https://github.com/winston-dsouza/ecommerce-website/blob/master/signup_script.php): `signup_script.php`
- [Log in](https://github.com/winston-dsouza/ecommerce-website/blob/master/login_script.php): `login_script.php`
- [Log out](https://github.com/winston-dsouza/ecommerce-website/blob/master/logout_script.php): `logout_script.php`

### Cart and Orders

- [Cart status check](https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/check-if-added.php): `includes/check-if-added.php`
- [Add to cart](https://github.com/winston-dsouza/ecommerce-website/blob/master/cart-add.php): `cart-add.php`
- [Cart view](https://github.com/winston-dsouza/ecommerce-website/blob/master/cart.php): `cart.php`
- [Remove cart item](https://github.com/winston-dsouza/ecommerce-website/blob/master/cart-remove.php): `cart-remove.php`
- [Order confirmation](https://github.com/winston-dsouza/ecommerce-website/blob/master/success.php): `success.php`

### Shared and Integrations

- [Database connection](https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/common.php): `includes/common.php`
- [Ecommerce database](https://github.com/winston-dsouza/ecommerce-website/blob/master/ecommerce.sql): `ecommerce.sql`
- [Shared footer](https://github.com/winston-dsouza/ecommerce-website/blob/master/includes/footer.php): `includes/footer.php`

### Other components

- **Shopper**
- **Formspree**

## Connections

- Shopper → Home page: opens
- Home page → Account navigation and forms: includes (evidence: `index.php`)
- Home page → Cart status check: includes (evidence: `index.php`)
- Home page → Product catalog: links to (evidence: `index.php`)
- Home page → Shared footer: includes (evidence: `index.php`)
- Product catalog → Account navigation and forms: includes (evidence: `products.php`)
- Product catalog → Cart status check: checks items (evidence: `products.php`)
- Product catalog → Add to cart: links to (evidence: `products.php`)
- Account navigation and forms → Log in: posts to (evidence: `includes/header_menu.php`)
- Account navigation and forms → Sign up: posts to (evidence: `includes/header_menu.php`)
- Account navigation and forms → Cart view: links to (evidence: `includes/header_menu.php`)
- Account navigation and forms → Log out: links to (evidence: `includes/header_menu.php`)
- Sign up → Database connection: uses connection (evidence: `signup_script.php`)
- Sign up → Ecommerce database: queries users (evidence: `signup_script.php`)
- Log in → Database connection: uses connection (evidence: `login_script.php`)
- Log in → Ecommerce database: queries users (evidence: `login_script.php`)
- Cart status check → Database connection: loads connection (evidence: `includes/check-if-added.php`)
- Cart view → Database connection: loads connection (evidence: `cart.php`)
- Cart view → Ecommerce database: reads cart (evidence: `cart.php`)
- Cart view → Remove cart item: links to (evidence: `cart.php`)
- Cart view → Order confirmation: links to (evidence: `cart.php`)
- Remove cart item → Database connection: loads connection (evidence: `cart-remove.php`)
- Remove cart item → Ecommerce database: deletes item (evidence: `cart-remove.php`)
- Remove cart item → Cart view: redirects to (evidence: `cart-remove.php`)
- Order confirmation → Database connection: loads connection (evidence: `success.php`)
- Order confirmation → Ecommerce database: confirms items (evidence: `success.php`)
- Database connection → Ecommerce database: connects to (evidence: `includes/common.php`)
- About and contact → Account navigation and forms: includes (evidence: `about.php`)
- About and contact → Shared footer: includes (evidence: `about.php`)
- About and contact → Formspree: submits form (evidence: `about.php`)
- Product catalog → Shared footer: includes (evidence: `products.php`)
- Cart view → Shared footer: includes (evidence: `cart.php`)
- Order confirmation → Shared footer: includes (evidence: `success.php`)
