# phamkhanhdu1503-rgb/bookstore architecture

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

- Interactive diagram: https://gitdiagram.com/phamkhanhdu1503-rgb/bookstore
- Repository: https://github.com/phamkhanhdu1503-rgb/bookstore

## Overview

This is a PHP bookstore: shoppers discover books, manage a cart, check out, and follow orders; staff maintain the catalog and operations. The homepage’s include relationships and several admin-to-database operations are visible in excerpts. Other domain stages are represented from the file tree, but their runtime calls were not sampled, so those connections are dashed and unverified.

Main entry points: [`index.php`](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/index.php) (Home Entry), [`config/database.php`](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/config/database.php) (Relational Database), [`admin/orders/index.php`](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/orders/index.php) (Order Management), [`books/index.php`](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/books/index.php) (Book Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home Entry<br/>[index.php]"]
  node_banner["Promotional Banners<br/>[banner.php]"]
  node_category_highlights["Category Highlights<br/>[categories.php]"]
  node_new_books["New Books<br/>[new-books.php]"]
  node_best_sellers["Best Sellers<br/>[best-sellers.php]"]
  node_top_rated["Top Rated Books<br/>[top-rated.php]"]
  node_navbar["Navigation<br/>[navbar.php]"]
  node_footer["Footer<br/>[footer.php]"]
  node_catalog["Book Catalog<br/>[index.php]"]
  node_book_detail["Book Details<br/>[detail.php]"]
end

subgraph group_commerce["Shopping and Orders"]
  node_cart["Cart<br/>[index.php]"]
  node_checkout["Checkout<br/>[process.php]"]
  node_customer_orders["Customer Orders<br/>[index.php]"]
end

subgraph group_accounts["Customer Accounts"]
  node_auth["Authentication<br/>[login.php]"]
  node_profile["Customer Profile<br/>[profile.php]"]
end

subgraph group_operations["Store Operations"]
  node_inventory["Inventory Management<br/>[index.php]"]
end

subgraph group_admin["Administration"]
  node_admin_catalog["Catalog Management<br/>[index.php]"]
  node_admin_orders["Order Management<br/>[index.php]"]
  node_promotions["Promotion Management<br/>[index.php]"]
  node_users["User Management<br/>[index.php]"]
  node_reports["Business Reports<br/>[index.php]"]
  node_reviews["Review Management<br/>[index.php]"]
end

node_shopper(("Shopper"))
node_database[("Relational Database<br/>[database.php]")]

node_shopper -.->|"opens"| node_home
node_home -->|"includes"| node_navbar
node_home -->|"includes"| node_banner
node_home -->|"includes"| node_category_highlights
node_home -->|"includes"| node_new_books
node_home -->|"includes"| node_best_sellers
node_home -->|"includes"| node_top_rated
node_home -->|"includes"| node_footer
node_shopper -.->|"browses"| node_catalog
node_catalog -.->|"opens"| node_book_detail
node_shopper -.->|"manages"| node_cart
node_cart -.->|"proceeds to"| node_checkout
node_checkout -.->|"creates order"| node_customer_orders
node_shopper -.->|"signs in"| node_auth
node_auth -.->|"accesses"| node_profile
node_admin_catalog -->|"queries"| node_database
node_admin_orders -->|"queries and updates"| node_database
node_inventory -->|"records stock"| node_database
node_promotions -->|"stores promotions"| node_database
node_users -->|"queries and updates"| node_database
node_reports -.->|"reads reports"| node_database
node_reviews -.->|"manages reviews"| node_database
node_admin_orders -.->|"adjusts stock"| node_inventory

click node_home "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/index.php"
click node_banner "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/banner.php"
click node_category_highlights "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/categories.php"
click node_new_books "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/new-books.php"
click node_best_sellers "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/best-sellers.php"
click node_top_rated "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/top-rated.php"
click node_navbar "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/navbar.php"
click node_footer "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/footer.php"
click node_catalog "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/books/index.php"
click node_book_detail "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/books/detail.php"
click node_cart "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/cart/index.php"
click node_checkout "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/checkout/process.php"
click node_customer_orders "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/orders/index.php"
click node_auth "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/auth/login.php"
click node_profile "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/auth/profile.php"
click node_admin_catalog "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/books/index.php"
click node_admin_orders "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/orders/index.php"
click node_inventory "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/inventory/index.php"
click node_promotions "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/promotions/index.php"
click node_users "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/users/index.php"
click node_reports "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/reports/index.php"
click node_reviews "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/reviews/index.php"
click node_database "https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/config/database.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_banner,node_category_highlights,node_new_books,node_best_sellers,node_top_rated,node_navbar,node_footer,node_catalog,node_book_detail toneBlue
class node_cart,node_checkout,node_customer_orders,node_database toneAmber
class node_auth,node_profile toneMint
class node_inventory toneRose
class node_admin_catalog,node_admin_orders,node_promotions,node_users,node_reports,node_reviews,node_shopper toneIndigo
```

## Components

### Storefront

- [Home Entry](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/index.php): `index.php`
- [Promotional Banners](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/banner.php): `includes/banner.php`
- [Category Highlights](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/categories.php): `includes/categories.php`
- [New Books](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/new-books.php): `includes/new-books.php`
- [Best Sellers](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/best-sellers.php): `includes/best-sellers.php`
- [Top Rated Books](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/top-rated.php): `includes/top-rated.php`
- [Navigation](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/navbar.php): `includes/navbar.php`
- [Footer](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/includes/footer.php): `includes/footer.php`
- [Book Catalog](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/books/index.php): `books/index.php`
- [Book Details](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/books/detail.php): `books/detail.php`

### Shopping and Orders

- [Cart](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/cart/index.php): `cart/index.php`
- [Checkout](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/checkout/process.php): `checkout/process.php`
- [Customer Orders](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/orders/index.php): `orders/index.php`

### Customer Accounts

- [Authentication](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/auth/login.php): `auth/login.php`
- [Customer Profile](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/auth/profile.php): `auth/profile.php`

### Store Operations

- [Inventory Management](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/inventory/index.php): `admin/inventory/index.php`

### Administration

- [Catalog Management](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/books/index.php): `admin/books/index.php`
- [Order Management](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/orders/index.php): `admin/orders/index.php`
- [Promotion Management](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/promotions/index.php): `admin/promotions/index.php`
- [User Management](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/users/index.php): `admin/users/index.php`
- [Business Reports](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/reports/index.php): `admin/reports/index.php`
- [Review Management](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/admin/reviews/index.php): `admin/reviews/index.php`

### Other components

- **Shopper**
- [Relational Database](https://github.com/phamkhanhdu1503-rgb/bookstore/blob/main/config/database.php): `config/database.php`

## Connections

- Shopper → Home Entry: opens
- Home Entry → Navigation: includes (evidence: `index.php`)
- Home Entry → Promotional Banners: includes (evidence: `index.php`)
- Home Entry → Category Highlights: includes (evidence: `index.php`)
- Home Entry → New Books: includes (evidence: `index.php`)
- Home Entry → Best Sellers: includes (evidence: `index.php`)
- Home Entry → Top Rated Books: includes (evidence: `index.php`)
- Home Entry → Footer: includes (evidence: `index.php`)
- Shopper → Book Catalog: browses
- Book Catalog → Book Details: opens
- Shopper → Cart: manages
- Cart → Checkout: proceeds to
- Checkout → Customer Orders: creates order
- Shopper → Authentication: signs in
- Authentication → Customer Profile: accesses
- Catalog Management → Relational Database: queries (evidence: `admin/books/index.php`)
- Order Management → Relational Database: queries and updates (evidence: `admin/orders/index.php`)
- Inventory Management → Relational Database: records stock (evidence: `admin/inventory/index.php`)
- Promotion Management → Relational Database: stores promotions (evidence: `admin/promotions/index.php`)
- User Management → Relational Database: queries and updates (evidence: `admin/users/index.php`)
- Business Reports → Relational Database: reads reports
- Review Management → Relational Database: manages reviews
- Order Management → Inventory Management: adjusts stock
