# k1mhoangg/home-decor architecture

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

- Interactive diagram: https://gitdiagram.com/k1mhoangg/home-decor
- Repository: https://github.com/k1mhoangg/home-decor

## Overview

Home Decor Shop is a PHP storefront with an administrative content and commerce panel. The user-facing workflow spans browsing products and pricing, managing a cart, account access, and contacting the shop; customers can also read and submit FAQs. Administrators manage products, orders, users, and site content. The map shows documented route dispatch, sampled controller-to-model calls, and the database layer; some controller and integration details are unsampled, so their internal links are omitted rather than inferred.

Main entry points: [`routes-register.php`](https://github.com/k1mhoangg/home-decor/blob/main/routes-register.php) (HTTP routes), [`Core/Database.php`](https://github.com/k1mhoangg/home-decor/blob/main/Core/Database.php) (MySQL database), [`Controller/Frontend/FaqController.php`](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/FaqController.php) (Customer FAQs), [`Controller/Admin/AdminController.php`](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/AdminController.php) (User management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home page<br/>[HomeController.php]"]
  node_auth["Customer accounts<br/>[AuthController.php]"]
  node_user_profile["User profile<br/>[UserController.php]"]
end

subgraph group_commerce["Commerce"]
  node_product_browse["Product browsing"]
  node_pricing["Pricing"]
  node_cart_flow["Cart<br/>[CartController.php]"]
  node_orders["Orders"]
  node_user_model["User records<br/>[User.php]"]
  node_product_model["Product records<br/>[Product.php]"]
  node_cart_model["Cart records<br/>[Cart.php]"]
  node_order_model["Order records<br/>[Order.php]"]
end

subgraph group_content["Site content"]
  node_contact_flow["Contact forms"]
  node_faq_front["Customer FAQs<br/>[FaqController.php]"]
  node_news_front["News<br/>[NewsController.php]"]
  node_faq_model["FAQ records<br/>[Faq.php]"]
  node_about_model["About records<br/>[About.php]"]
  node_home_model["Homepage records<br/>[HomeSettings.php]"]
  node_contact_model["Contact records<br/>[Contact.php]"]
  node_contact_settings["Contact settings"]
end

subgraph group_admin["Administration"]
  node_about_admin["About content"]
  node_home_admin["Homepage settings"]
  node_faq_admin["FAQ moderation<br/>[FaqsController.php]"]
  node_admin_users["User management"]
  node_product_admin["Product management"]
  node_contact_admin["Contact management"]
  node_news_admin["News management<br/>[NewsController.php]"]
end

subgraph group_platform["Runtime"]
  node_route_registry["HTTP routes"]
  node_router["Router<br/>[Router.php]"]
  node_database[("MySQL database<br/>[Database.php]")]
  node_sessions["Session state<br/>[Session.php]"]
  node_pagination["Pagination<br/>[Pagination.php]"]
  node_mailer["Email delivery<br/>[Mailer.php]"]
end

node_shopper(("Shopper"))
node_admin_user(("Administrator"))

node_shopper -.->|"requests pages"| node_route_registry
node_admin_user -.->|"requests admin"| node_route_registry
node_route_registry -->|"dispatches"| node_home
node_route_registry -->|"dispatches"| node_auth
node_route_registry -->|"dispatches"| node_user_profile
node_route_registry -->|"dispatches"| node_product_browse
node_route_registry -->|"dispatches"| node_pricing
node_route_registry -->|"dispatches"| node_cart_flow
node_route_registry -->|"dispatches"| node_contact_flow
node_route_registry -->|"dispatches"| node_faq_front
node_route_registry -->|"dispatches"| node_news_front
node_route_registry -->|"dispatches"| node_orders
node_route_registry -->|"dispatches"| node_about_admin
node_route_registry -->|"dispatches"| node_home_admin
node_route_registry -->|"dispatches"| node_faq_admin
node_route_registry -->|"dispatches"| node_admin_users
node_route_registry -->|"dispatches"| node_product_admin
node_route_registry -->|"dispatches"| node_contact_admin
node_home -->|"reads products"| node_product_model
node_home -->|"reads settings"| node_home_model
node_auth -->|"authenticates"| node_user_model
node_user_profile -->|"updates account"| node_user_model
node_product_browse -->|"reads products"| node_product_model
node_pricing -->|"reads products"| node_product_model
node_cart_flow -->|"manages cart"| node_cart_model
node_contact_flow -->|"saves messages"| node_contact_model
node_contact_flow -->|"reads settings"| node_contact_settings
node_faq_front -->|"queries and submits"| node_faq_model
node_faq_front -->|"calculates pages"| node_pagination
node_about_admin -->|"manages content"| node_about_model
node_home_admin -->|"manages settings"| node_home_model
node_home_admin -->|"loads products"| node_product_model
node_faq_admin -->|"moderates questions"| node_faq_model
node_faq_admin -->|"calculates pages"| node_pagination
node_admin_users -->|"manages users"| node_user_model
node_admin_users -->|"reads contacts"| node_contact_model
node_orders -->|"manages orders"| node_order_model
node_contact_admin -->|"manages contacts"| node_contact_model
node_contact_admin -->|"sends replies"| node_mailer
node_user_model -->|"reads and writes"| node_database
node_faq_model -->|"reads and writes"| node_database
node_about_model -->|"reads and writes"| node_database
node_home_model -->|"reads and writes"| node_database
node_cart_model -->|"reads and writes"| node_database
node_faq_front -->|"uses session"| node_sessions
node_admin_users -->|"calculates pages"| node_pagination

click node_route_registry "https://github.com/k1mhoangg/home-decor/blob/main/routes-register.php"
click node_router "https://github.com/k1mhoangg/home-decor/blob/main/Core/Router.php"
click node_home "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/HomeController.php"
click node_auth "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/AuthController.php"
click node_user_profile "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/UserController.php"
click node_product_browse "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/ProductController.php"
click node_pricing "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/PricingController.php"
click node_cart_flow "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/CartController.php"
click node_orders "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/OrdersController.php"
click node_contact_flow "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/ContactController.php"
click node_faq_front "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/FaqController.php"
click node_news_front "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/NewsController.php"
click node_about_admin "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/AboutController.php"
click node_home_admin "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/HomeSettingsController.php"
click node_faq_admin "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/FaqsController.php"
click node_admin_users "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/AdminController.php"
click node_product_admin "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/ProductsController.php"
click node_contact_admin "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/ContactsController.php"
click node_news_admin "https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/NewsController.php"
click node_user_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/User.php"
click node_product_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/Product.php"
click node_cart_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/Cart.php"
click node_order_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/Order.php"
click node_faq_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/Faq.php"
click node_about_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/About.php"
click node_home_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/HomeSettings.php"
click node_contact_model "https://github.com/k1mhoangg/home-decor/blob/main/Model/Contact.php"
click node_contact_settings "https://github.com/k1mhoangg/home-decor/blob/main/Model/ContactSettings.php"
click node_database "https://github.com/k1mhoangg/home-decor/blob/main/Core/Database.php"
click node_sessions "https://github.com/k1mhoangg/home-decor/blob/main/Core/Session.php"
click node_pagination "https://github.com/k1mhoangg/home-decor/blob/main/Core/Pagination.php"
click node_mailer "https://github.com/k1mhoangg/home-decor/blob/main/Core/Mailer.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_auth,node_user_profile toneBlue
class node_product_browse,node_pricing,node_cart_flow,node_orders,node_user_model,node_product_model,node_cart_model,node_order_model toneAmber
class node_contact_flow,node_faq_front,node_news_front,node_faq_model,node_about_model,node_home_model,node_contact_model,node_contact_settings toneMint
class node_about_admin,node_home_admin,node_faq_admin,node_admin_users,node_product_admin,node_contact_admin,node_news_admin toneRose
class node_route_registry,node_router,node_database,node_sessions,node_pagination,node_mailer,node_shopper,node_admin_user toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/HomeController.php): `Controller/Frontend/HomeController.php`
- [Customer accounts](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/AuthController.php): `Controller/Frontend/AuthController.php`
- [User profile](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/UserController.php): `Controller/Frontend/UserController.php`

### Commerce

- [Product browsing](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/ProductController.php): `Controller/Frontend/ProductController.php`
- [Pricing](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/PricingController.php): `Controller/Frontend/PricingController.php`
- [Cart](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/CartController.php): `Controller/Frontend/CartController.php`
- [Orders](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/OrdersController.php): `Controller/Admin/OrdersController.php`
- [User records](https://github.com/k1mhoangg/home-decor/blob/main/Model/User.php): `Model/User.php`
- [Product records](https://github.com/k1mhoangg/home-decor/blob/main/Model/Product.php): `Model/Product.php`
- [Cart records](https://github.com/k1mhoangg/home-decor/blob/main/Model/Cart.php): `Model/Cart.php`
- [Order records](https://github.com/k1mhoangg/home-decor/blob/main/Model/Order.php): `Model/Order.php`

### Site content

- [Contact forms](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/ContactController.php): `Controller/Frontend/ContactController.php`
- [Customer FAQs](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/FaqController.php): `Controller/Frontend/FaqController.php`
- [News](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Frontend/NewsController.php): `Controller/Frontend/NewsController.php`
- [FAQ records](https://github.com/k1mhoangg/home-decor/blob/main/Model/Faq.php): `Model/Faq.php`
- [About records](https://github.com/k1mhoangg/home-decor/blob/main/Model/About.php): `Model/About.php`
- [Homepage records](https://github.com/k1mhoangg/home-decor/blob/main/Model/HomeSettings.php): `Model/HomeSettings.php`
- [Contact records](https://github.com/k1mhoangg/home-decor/blob/main/Model/Contact.php): `Model/Contact.php`
- [Contact settings](https://github.com/k1mhoangg/home-decor/blob/main/Model/ContactSettings.php): `Model/ContactSettings.php`

### Administration

- [About content](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/AboutController.php): `Controller/Admin/AboutController.php`
- [Homepage settings](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/HomeSettingsController.php): `Controller/Admin/HomeSettingsController.php`
- [FAQ moderation](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/FaqsController.php): `Controller/Admin/FaqsController.php`
- [User management](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/AdminController.php): `Controller/Admin/AdminController.php`
- [Product management](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/ProductsController.php): `Controller/Admin/ProductsController.php`
- [Contact management](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/ContactsController.php): `Controller/Admin/ContactsController.php`
- [News management](https://github.com/k1mhoangg/home-decor/blob/main/Controller/Admin/NewsController.php): `Controller/Admin/NewsController.php`

### Runtime

- [HTTP routes](https://github.com/k1mhoangg/home-decor/blob/main/routes-register.php): `routes-register.php`
- [Router](https://github.com/k1mhoangg/home-decor/blob/main/Core/Router.php): `Core/Router.php`
- [MySQL database](https://github.com/k1mhoangg/home-decor/blob/main/Core/Database.php): `Core/Database.php`
- [Session state](https://github.com/k1mhoangg/home-decor/blob/main/Core/Session.php): `Core/Session.php`
- [Pagination](https://github.com/k1mhoangg/home-decor/blob/main/Core/Pagination.php): `Core/Pagination.php`
- [Email delivery](https://github.com/k1mhoangg/home-decor/blob/main/Core/Mailer.php): `Core/Mailer.php`

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → HTTP routes: requests pages (evidence: `README.md`)
- Administrator → HTTP routes: requests admin (evidence: `README.md`)
- HTTP routes → Home page: dispatches (evidence: `routes-register.php`)
- HTTP routes → Customer accounts: dispatches (evidence: `routes-register.php`)
- HTTP routes → User profile: dispatches (evidence: `routes-register.php`)
- HTTP routes → Product browsing: dispatches (evidence: `routes-register.php`)
- HTTP routes → Pricing: dispatches (evidence: `routes-register.php`)
- HTTP routes → Cart: dispatches (evidence: `routes-register.php`)
- HTTP routes → Contact forms: dispatches (evidence: `routes-register.php`)
- HTTP routes → Customer FAQs: dispatches (evidence: `routes-register.php`)
- HTTP routes → News: dispatches (evidence: `routes-register.php`)
- HTTP routes → Orders: dispatches (evidence: `routes-register.php`)
- HTTP routes → About content: dispatches (evidence: `routes-register.php`)
- HTTP routes → Homepage settings: dispatches (evidence: `routes-register.php`)
- HTTP routes → FAQ moderation: dispatches (evidence: `routes-register.php`)
- HTTP routes → User management: dispatches (evidence: `routes-register.php`)
- HTTP routes → Product management: dispatches (evidence: `routes-register.php`)
- HTTP routes → Contact management: dispatches (evidence: `routes-register.php`)
- Home page → Product records: reads products (evidence: `Controller/Frontend/HomeController.php`)
- Home page → Homepage records: reads settings (evidence: `Controller/Frontend/HomeController.php`)
- Customer accounts → User records: authenticates (evidence: `Controller/Frontend/AuthController.php`)
- User profile → User records: updates account (evidence: `Controller/Frontend/UserController.php`)
- Product browsing → Product records: reads products (evidence: `Controller/Frontend/ProductController.php`)
- Pricing → Product records: reads products (evidence: `Controller/Frontend/PricingController.php`)
- Cart → Cart records: manages cart (evidence: `Controller/Frontend/CartController.php`)
- Contact forms → Contact records: saves messages (evidence: `Controller/Frontend/ContactController.php`)
- Contact forms → Contact settings: reads settings (evidence: `Controller/Frontend/ContactController.php`)
- Customer FAQs → FAQ records: queries and submits (evidence: `Controller/Frontend/FaqController.php`)
- Customer FAQs → Pagination: calculates pages (evidence: `Controller/Frontend/FaqController.php`)
- About content → About records: manages content (evidence: `Controller/Admin/AboutController.php`)
- Homepage settings → Homepage records: manages settings (evidence: `Controller/Admin/HomeSettingsController.php`)
- Homepage settings → Product records: loads products (evidence: `Controller/Admin/HomeSettingsController.php`)
- FAQ moderation → FAQ records: moderates questions (evidence: `Controller/Admin/FaqsController.php`)
- FAQ moderation → Pagination: calculates pages (evidence: `Controller/Admin/FaqsController.php`)
- User management → User records: manages users (evidence: `Controller/Admin/AdminController.php`)
- User management → Contact records: reads contacts (evidence: `Controller/Admin/AdminController.php`)
- Orders → Order records: manages orders (evidence: `Controller/Admin/OrdersController.php`)
- Contact management → Contact records: manages contacts (evidence: `Controller/Admin/ContactsController.php`)
- Contact management → Email delivery: sends replies (evidence: `Controller/Admin/ContactsController.php`)
- User records → MySQL database: reads and writes (evidence: `Model/User.php`)
- FAQ records → MySQL database: reads and writes (evidence: `Model/Faq.php`)
- About records → MySQL database: reads and writes (evidence: `Model/About.php`)
- Homepage records → MySQL database: reads and writes (evidence: `Model/HomeSettings.php`)
- Cart records → MySQL database: reads and writes (evidence: `Model/Cart.php`)
- Customer FAQs → Session state: uses session (evidence: `Controller/Frontend/FaqController.php`)
- User management → Pagination: calculates pages (evidence: `Controller/Admin/AdminController.php`)
