# shsarv/e-store architecture

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

- Interactive diagram: https://gitdiagram.com/shsarv/e-store
- Repository: https://github.com/shsarv/e-store

## Overview

E-Store is a PHP/MySQLi mobile-shopping site. Visitors browse a product catalog, register or log in, add products to a cart, review the cart, and place an order; logged-in users can also change their password. The graph includes the documented registration validation and login capabilities, but source for several handlers was only indexed, not excerpted, so their internal database operations are not asserted. The README describes a forgot-password flow, but no corresponding implementation file appears in the tree.

Main entry points: [`index.php`](https://github.com/shsarv/e-store/blob/master/index.php) (Product catalog), [`login_modal.php`](https://github.com/shsarv/e-store/blob/master/login_modal.php) (Login modal), [`ecommerce1.sql`](https://github.com/shsarv/e-store/blob/master/ecommerce1.sql) (E-commerce database), [`contact_us.php`](https://github.com/shsarv/e-store/blob/master/contact_us.php) (Contact page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Product catalog<br/>[index.php]"]
  node_about["About page<br/>[about_us.php]"]
  node_contact["Contact page<br/>[contact_us.php]"]
  node_contact_handler["Contact handler<br/>[cont.php]"]
end

subgraph group_identity["Accounts"]
  node_signup["Signup form<br/>[signup.php]"]
  node_registration["Registration handler<br/>[sign.php]"]
  node_login_form["Login modal<br/>[login_modal.php]"]
  node_login_handler["Login handler<br/>[logi.php]"]
  node_settings["Password settings<br/>[settings.php]"]
  node_settings_handler["Password updater<br/>[sett.php]"]
end

subgraph group_commerce["Shopping"]
  node_cart_prompt["Add-to-cart prompt<br/>[add_to_cart.php]"]
  node_cart_handler["Cart add handler<br/>[cart_added.php]"]
  node_cart["Cart and totals<br/>[cart.php]"]
  node_order_result["Order confirmation<br/>[success.php]"]
  node_store_db[("E-commerce database<br/>[ecommerce1.sql]")]
end

subgraph group_shared["Shared UI"]
  node_logged_out_nav["Guest navigation"]
  node_logged_in_nav["Member navigation"]
  node_footer["Guest footer<br/>[foot.php]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_catalog
node_catalog -->|"requires"| node_logged_out_nav
node_catalog -->|"requires"| node_logged_in_nav
node_catalog -->|"includes"| node_login_form
node_catalog -->|"includes"| node_cart_prompt
node_visitor -->|"registers"| node_signup
node_signup -->|"posts to"| node_registration
node_registration -.->|"stores account"| node_store_db
node_visitor -->|"opens"| node_login_form
node_login_form -->|"posts to"| node_login_handler
node_login_handler -.->|"checks credentials"| node_store_db
node_settings -->|"posts to"| node_settings_handler
node_settings_handler -.->|"updates password"| node_store_db
node_visitor -->|"views"| node_about
node_visitor -->|"views"| node_contact
node_contact -->|"posts message"| node_contact_handler
node_about -->|"requires"| node_logged_out_nav
node_about -->|"requires"| node_footer
node_contact -->|"requires"| node_logged_out_nav
node_contact -->|"requires"| node_footer
node_visitor -->|"requests add"| node_cart_prompt
node_cart_prompt -->|"posts product ID"| node_cart_handler
node_cart_handler -.->|"adds product"| node_store_db
node_visitor -->|"reviews cart"| node_cart
node_cart -->|"reads cart and prices"| node_store_db
node_cart -->|"places order"| node_order_result
node_visitor -->|"changes password"| node_settings
node_logged_out_nav -->|"opens"| node_login_form
node_footer -->|"opens"| node_login_form

click node_catalog "https://github.com/shsarv/e-store/blob/master/index.php"
click node_about "https://github.com/shsarv/e-store/blob/master/about_us.php"
click node_contact "https://github.com/shsarv/e-store/blob/master/contact_us.php"
click node_contact_handler "https://github.com/shsarv/e-store/blob/master/cont.php"
click node_signup "https://github.com/shsarv/e-store/blob/master/signup.php"
click node_registration "https://github.com/shsarv/e-store/blob/master/sign.php"
click node_login_form "https://github.com/shsarv/e-store/blob/master/login_modal.php"
click node_login_handler "https://github.com/shsarv/e-store/blob/master/logi.php"
click node_settings "https://github.com/shsarv/e-store/blob/master/settings.php"
click node_settings_handler "https://github.com/shsarv/e-store/blob/master/sett.php"
click node_cart_prompt "https://github.com/shsarv/e-store/blob/master/add_to_cart.php"
click node_cart_handler "https://github.com/shsarv/e-store/blob/master/cart_added.php"
click node_cart "https://github.com/shsarv/e-store/blob/master/cart.php"
click node_order_result "https://github.com/shsarv/e-store/blob/master/success.php"
click node_store_db "https://github.com/shsarv/e-store/blob/master/ecommerce1.sql"
click node_logged_out_nav "https://github.com/shsarv/e-store/blob/master/header_logged_out.php"
click node_logged_in_nav "https://github.com/shsarv/e-store/blob/master/header_logged_in.php"
click node_footer "https://github.com/shsarv/e-store/blob/master/foot.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_about,node_contact,node_contact_handler toneBlue
class node_signup,node_registration,node_login_form,node_login_handler,node_settings,node_settings_handler toneAmber
class node_cart_prompt,node_cart_handler,node_cart,node_order_result,node_store_db toneMint
class node_logged_out_nav,node_logged_in_nav,node_footer toneRose
class node_visitor toneIndigo
```

## Components

### Storefront

- [Product catalog](https://github.com/shsarv/e-store/blob/master/index.php): `index.php`
- [About page](https://github.com/shsarv/e-store/blob/master/about_us.php): `about_us.php`
- [Contact page](https://github.com/shsarv/e-store/blob/master/contact_us.php): `contact_us.php`
- [Contact handler](https://github.com/shsarv/e-store/blob/master/cont.php): `cont.php`

### Accounts

- [Signup form](https://github.com/shsarv/e-store/blob/master/signup.php): `signup.php`
- [Registration handler](https://github.com/shsarv/e-store/blob/master/sign.php): `sign.php`
- [Login modal](https://github.com/shsarv/e-store/blob/master/login_modal.php): `login_modal.php`
- [Login handler](https://github.com/shsarv/e-store/blob/master/logi.php): `logi.php`
- [Password settings](https://github.com/shsarv/e-store/blob/master/settings.php): `settings.php`
- [Password updater](https://github.com/shsarv/e-store/blob/master/sett.php): `sett.php`

### Shopping

- [Add-to-cart prompt](https://github.com/shsarv/e-store/blob/master/add_to_cart.php): `add_to_cart.php`
- [Cart add handler](https://github.com/shsarv/e-store/blob/master/cart_added.php): `cart_added.php`
- [Cart and totals](https://github.com/shsarv/e-store/blob/master/cart.php): `cart.php`
- [Order confirmation](https://github.com/shsarv/e-store/blob/master/success.php): `success.php`
- [E-commerce database](https://github.com/shsarv/e-store/blob/master/ecommerce1.sql): `ecommerce1.sql`

### Shared UI

- [Guest navigation](https://github.com/shsarv/e-store/blob/master/header_logged_out.php): `header_logged_out.php`
- [Member navigation](https://github.com/shsarv/e-store/blob/master/header_logged_in.php): `header_logged_in.php`
- [Guest footer](https://github.com/shsarv/e-store/blob/master/foot.php): `foot.php`

### Other components

- **Visitor**

## Connections

- Visitor → Product catalog: browses (evidence: `README.md`)
- Product catalog → Guest navigation: requires (evidence: `index.php`)
- Product catalog → Member navigation: requires (evidence: `index.php`)
- Product catalog → Login modal: includes (evidence: `index.php`)
- Product catalog → Add-to-cart prompt: includes (evidence: `index.php`)
- Visitor → Signup form: registers (evidence: `README.md`)
- Signup form → Registration handler: posts to (evidence: `signup.php`)
- Registration handler → E-commerce database: stores account
- Visitor → Login modal: opens
- Login modal → Login handler: posts to (evidence: `login_modal.php`)
- Login handler → E-commerce database: checks credentials
- Password settings → Password updater: posts to (evidence: `settings.php`)
- Password updater → E-commerce database: updates password
- Visitor → About page: views
- Visitor → Contact page: views
- Contact page → Contact handler: posts message (evidence: `contact_us.php`)
- About page → Guest navigation: requires (evidence: `about_us.php`)
- About page → Guest footer: requires (evidence: `about_us.php`)
- Contact page → Guest navigation: requires (evidence: `contact_us.php`)
- Contact page → Guest footer: requires (evidence: `contact_us.php`)
- Visitor → Add-to-cart prompt: requests add
- Add-to-cart prompt → Cart add handler: posts product ID (evidence: `add_to_cart.php`)
- Cart add handler → E-commerce database: adds product
- Visitor → Cart and totals: reviews cart
- Cart and totals → E-commerce database: reads cart and prices (evidence: `cart.php`)
- Cart and totals → Order confirmation: places order (evidence: `cart.php`)
- Visitor → Password settings: changes password
- Guest navigation → Login modal: opens (evidence: `header_logged_out.php`)
- Guest footer → Login modal: opens (evidence: `foot.php`)
