# lindaabytyqi/beauty-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/lindaabytyqi/beauty-ecommerce
- Repository: https://github.com/lindaabytyqi/beauty-ecommerce

## Overview

This PHP skincare storefront supports product discovery through checkout and order history, alongside customer accounts and an admin content/operations panel. The graph preserves the README’s major capabilities; some feature links are documented rather than verified in source excerpts, so their evidence cites the README. PostgreSQL is shown as an external store, accessed through the repository’s PDO connection file.

Main entry points: [`admin/admindashboard.php`](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/admindashboard.php) (Admin Panel), [`includes/database.php`](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/includes/database.php) (PDO Connection), [`index.php`](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/index.php) (Storefront), [`product.php`](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/product.php) (Catalog and Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Storefront<br/>[index.php]"]
  node_catalog["Catalog and Search<br/>[product.php]"]
  node_product_detail["Product Details<br/>[productdetails.php]"]
end

subgraph group_commerce["Shopping and Orders"]
  node_cart["Shopping Cart<br/>[cart.php]"]
  node_checkout["Checkout<br/>[checkout.php]"]
  node_order_processing["Order Processing<br/>[processorder.php]"]
  node_order_history["Order History<br/>[myorder.php]"]
end

subgraph group_accounts["Accounts and Security"]
  node_registration["Registration<br/>[register.php]"]
  node_login["Login<br/>[login.php]"]
  node_customer_account["Customer Account<br/>[dashboard.php]"]
  node_customer_auth["Customer Authentication<br/>[user_auth.php]"]
  node_admin_auth["Admin Authorization<br/>[admin_auth.php]"]
  node_csrf["CSRF Protection<br/>[csrf.php]"]
  node_db_connection["PDO Connection<br/>[database.php]"]
end

subgraph group_content["Content and Contact"]
  node_newsletter["Newsletter Signup<br/>[newsletter.php]"]
  node_contact["Contact Form<br/>[contactus.php]"]
  node_blog["Blog<br/>[blogs.php]"]
  node_beauty_quiz["Beauty Quiz<br/>[beauty-quiz.php]"]
end

subgraph group_admin["Administration"]
  node_admin_panel["Admin Panel<br/>[admindashboard.php]"]
  node_admin_catalog["Product and Category Management"]
  node_admin_orders["Order Management<br/>[orders.php]"]
  node_admin_users["User Management<br/>[users.php]"]
  node_admin_content["Site Content Management"]
  node_admin_newsletter["Newsletter Management<br/>[newsletter.php]"]
end

node_customer(("Customer"))
node_postgres[("PostgreSQL")]
node_mail["Gmail SMTP"]

node_customer -->|"browses"| node_home
node_home -->|"opens catalog"| node_catalog
node_catalog -->|"views products"| node_product_detail
node_product_detail -->|"adds to cart"| node_cart
node_cart -->|"continues to"| node_checkout
node_checkout -->|"places order"| node_order_processing
node_order_processing -->|"records for history"| node_order_history
node_customer -->|"registers"| node_registration
node_customer -->|"signs in"| node_login
node_customer -->|"manages account"| node_customer_account
node_customer_account -->|"checks session"| node_customer_auth
node_customer_auth -->|"redirects unauthenticated"| node_login
node_admin_panel -->|"checks authorization"| node_admin_auth
node_admin_panel -->|"manages catalog"| node_admin_catalog
node_admin_panel -->|"manages orders"| node_admin_orders
node_admin_panel -->|"manages users"| node_admin_users
node_admin_panel -->|"manages site content"| node_admin_content
node_admin_panel -->|"manages subscribers"| node_admin_newsletter
node_home -->|"queries catalog data"| node_db_connection
node_catalog -->|"queries products"| node_db_connection
node_product_detail -->|"queries product data"| node_db_connection
node_checkout -->|"uses database"| node_db_connection
node_db_connection -->|"opens PDO connection"| node_postgres
node_contact -->|"sends via SMTP"| node_mail
node_customer -->|"subscribes"| node_newsletter
node_customer -->|"contacts store"| node_contact
node_customer -->|"reads articles"| node_blog
node_customer -.->|"takes quiz"| node_beauty_quiz
node_admin_catalog -->|"protects form submissions"| node_csrf
node_admin_content -->|"protects form submissions"| node_csrf
node_customer_account -->|"uses form protection"| node_csrf

click node_home "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/index.php"
click node_catalog "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/product.php"
click node_product_detail "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/productdetails.php"
click node_cart "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/cart.php"
click node_checkout "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/checkout.php"
click node_order_processing "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/processorder.php"
click node_order_history "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/myorder.php"
click node_registration "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/register.php"
click node_login "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/login.php"
click node_customer_account "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/customerdashboard/dashboard.php"
click node_customer_auth "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/includes/user_auth.php"
click node_admin_auth "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/admin_auth.php"
click node_csrf "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/includes/csrf.php"
click node_db_connection "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/includes/database.php"
click node_newsletter "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/newsletter.php"
click node_contact "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/contactus.php"
click node_blog "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/blogs.php"
click node_beauty_quiz "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/beauty-quiz.php"
click node_admin_panel "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/admindashboard.php"
click node_admin_catalog "https://github.com/lindaabytyqi/beauty-ecommerce/tree/main/admin"
click node_admin_orders "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/orders.php"
click node_admin_users "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/users.php"
click node_admin_content "https://github.com/lindaabytyqi/beauty-ecommerce/tree/main/admin"
click node_admin_newsletter "https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/newsletter.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_product_detail toneBlue
class node_cart,node_checkout,node_order_processing,node_order_history,node_postgres toneAmber
class node_registration,node_login,node_customer_account,node_customer_auth,node_admin_auth,node_csrf,node_db_connection toneMint
class node_newsletter,node_contact,node_blog,node_beauty_quiz toneRose
class node_admin_panel,node_admin_catalog,node_admin_orders,node_admin_users,node_admin_content,node_admin_newsletter,node_customer,node_mail toneIndigo
```

## Components

### Storefront

- [Storefront](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/index.php): `index.php`
- [Catalog and Search](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/product.php): `product.php`
- [Product Details](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/productdetails.php): `productdetails.php`

### Shopping and Orders

- [Shopping Cart](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/cart.php): `cart.php`
- [Checkout](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/checkout.php): `checkout.php`
- [Order Processing](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/processorder.php): `processorder.php`
- [Order History](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/myorder.php): `myorder.php`

### Accounts and Security

- [Registration](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/register.php): `register.php`
- [Login](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/login.php): `login.php`
- [Customer Account](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/customerdashboard/dashboard.php): `customerdashboard/dashboard.php`
- [Customer Authentication](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/includes/user_auth.php): `includes/user_auth.php`
- [Admin Authorization](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/admin_auth.php): `admin/admin_auth.php`
- [CSRF Protection](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/includes/csrf.php): `includes/csrf.php`
- [PDO Connection](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/includes/database.php): `includes/database.php`

### Content and Contact

- [Newsletter Signup](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/newsletter.php): `newsletter.php`
- [Contact Form](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/contactus.php): `contactus.php`
- [Blog](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/blogs.php): `blogs.php`
- [Beauty Quiz](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/beauty-quiz.php): `beauty-quiz.php`

### Administration

- [Admin Panel](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/admindashboard.php): `admin/admindashboard.php`
- [Product and Category Management](https://github.com/lindaabytyqi/beauty-ecommerce/tree/main/admin): `admin`
- [Order Management](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/orders.php): `admin/orders.php`
- [User Management](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/users.php): `admin/users.php`
- [Site Content Management](https://github.com/lindaabytyqi/beauty-ecommerce/tree/main/admin): `admin`
- [Newsletter Management](https://github.com/lindaabytyqi/beauty-ecommerce/blob/main/admin/newsletter.php): `admin/newsletter.php`

### Other components

- **Customer**
- **PostgreSQL**
- **Gmail SMTP**

## Connections

- Customer → Storefront: browses (evidence: `README.md`)
- Storefront → Catalog and Search: opens catalog (evidence: `README.md`)
- Catalog and Search → Product Details: views products (evidence: `README.md`)
- Product Details → Shopping Cart: adds to cart (evidence: `README.md`)
- Shopping Cart → Checkout: continues to (evidence: `README.md`)
- Checkout → Order Processing: places order (evidence: `README.md`)
- Order Processing → Order History: records for history (evidence: `README.md`)
- Customer → Registration: registers (evidence: `README.md`)
- Customer → Login: signs in (evidence: `README.md`)
- Customer → Customer Account: manages account (evidence: `README.md`)
- Customer Account → Customer Authentication: checks session (evidence: `customerdashboard/dashboard.php`)
- Customer Authentication → Login: redirects unauthenticated (evidence: `includes/user_auth.php`)
- Admin Panel → Admin Authorization: checks authorization (evidence: `admin/admin_auth.php`)
- Admin Panel → Product and Category Management: manages catalog (evidence: `README.md`)
- Admin Panel → Order Management: manages orders (evidence: `README.md`)
- Admin Panel → User Management: manages users (evidence: `README.md`)
- Admin Panel → Site Content Management: manages site content (evidence: `README.md`)
- Admin Panel → Newsletter Management: manages subscribers (evidence: `README.md`)
- Storefront → PDO Connection: queries catalog data (evidence: `index.php`)
- Catalog and Search → PDO Connection: queries products (evidence: `product.php`)
- Product Details → PDO Connection: queries product data (evidence: `productdetails.php`)
- Checkout → PDO Connection: uses database (evidence: `checkout.php`)
- PDO Connection → PostgreSQL: opens PDO connection (evidence: `includes/database.php`)
- Contact Form → Gmail SMTP: sends via SMTP (evidence: `README.md`)
- Customer → Newsletter Signup: subscribes (evidence: `README.md`)
- Customer → Contact Form: contacts store (evidence: `README.md`)
- Customer → Blog: reads articles (evidence: `README.md`)
- Customer → Beauty Quiz: takes quiz
- Product and Category Management → CSRF Protection: protects form submissions (evidence: `admin/addabout.php`)
- Site Content Management → CSRF Protection: protects form submissions (evidence: `admin/addblog.php`)
- Customer Account → CSRF Protection: uses form protection
