# poseidonsamu-ux/ihomefurniture architecture

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

- Interactive diagram: https://gitdiagram.com/poseidonsamu-ux/ihomefurniture
- Repository: https://github.com/poseidonsamu-ux/ihomefurniture

## Overview

iHomeFurniture is an ASP.NET MVC furniture storefront with customer accounts, product browsing, cart checkout, and administrative management. The principal customer flow is catalog browsing, adding products to a session cart, then submitting an order that creates order and line-item records. Separate branches cover account verification, news, and AI product advice. The tree identifies additional brand and home controllers, but their behavior is not sampled; their wiring is therefore not shown.

Main entry points: [`IHomeFurniture/Models/IHomeModel.Context.cs`](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/IHomeModel.Context.cs) (Entity Framework), [`IHomeFurniture/Controllers/CartController.cs`](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/CartController.cs) (Cart and Checkout), [`IHomeFurniture/Controllers/ProductController.cs`](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/ProductController.cs) (Product Catalog), [`IHomeFurniture/Controllers/AccountController.cs`](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/AccountController.cs) (Account and OTP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Product Catalog"]
  node_cart["Cart and Checkout<br/>[CartController.cs]"]
  node_cart_session["Cart Session"]
end

subgraph group_accounts["Accounts"]
  node_account["Account and OTP"]
  node_profile["Customer Profile"]
end

subgraph group_operations["Store Operations"]
  node_admin_ops["Admin Management<br/>[AdminController.cs]"]
  node_order_status["Order Status"]
  node_brand["Brand Routes<br/>[BrandController.cs]"]
end

subgraph group_content["Content and Advice"]
  node_news["News Management<br/>[NewsController.cs]"]
  node_ai_chat["AI Shopping Chat"]
end

subgraph group_data["Persistence"]
  node_ef_context["Entity Framework"]
  node_store_db[("Store Database")]
  node_order_model["Order Entities<br/>[DONDATHANG.cs]"]
  node_product_model["Product Entity<br/>[SANPHAM.cs]"]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))
node_email["SMTP Email"]
node_gemini["Gemini API"]

node_shopper -->|"browses"| node_catalog
node_catalog -->|"queries products"| node_ef_context
node_catalog -->|"updates views"| node_ef_context
node_ef_context -->|"reads and writes"| node_store_db
node_shopper -->|"manages cart"| node_cart
node_cart -->|"stores cart"| node_cart_session
node_cart -->|"loads products"| node_ef_context
node_cart -->|"creates order"| node_ef_context
node_ef_context -->|"reads and writes"| node_store_db
node_cart -->|"persists order"| node_order_model
node_shopper -->|"registers or signs in"| node_account
node_account -->|"reads and updates customers"| node_ef_context
node_account -.->|"sends OTP"| node_email
node_shopper -->|"manages profile"| node_profile
node_profile -->|"reads and updates profile"| node_ef_context
node_profile -->|"loads orders"| node_ef_context
node_admin -->|"manages store"| node_admin_ops
node_admin_ops -->|"manages records"| node_ef_context
node_admin -->|"maintains statuses"| node_order_status
node_order_status -->|"manages statuses"| node_ef_context
node_admin -->|"manages news"| node_news
node_shopper -->|"reads news"| node_news
node_news -->|"reads and writes news"| node_ef_context
node_shopper -->|"asks for advice"| node_ai_chat
node_ai_chat -->|"loads products"| node_ef_context
node_ai_chat -.->|"requests response"| node_gemini
node_ef_context -->|"reads and writes"| node_store_db

click node_catalog "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/ProductController.cs"
click node_cart "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/CartController.cs"
click node_account "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/AccountController.cs"
click node_profile "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/UserAccountController.cs"
click node_admin_ops "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/AdminController.cs"
click node_order_status "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/OrderStatusController.cs"
click node_brand "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/BrandController.cs"
click node_news "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/NewsController.cs"
click node_ai_chat "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/ChatBoxAIController.cs"
click node_ef_context "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/IHomeModel.Context.cs"
click node_store_db "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/IHomeModel.Designer.cs"
click node_order_model "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/DONDATHANG.cs"
click node_product_model "https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/SANPHAM.cs"

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_cart,node_cart_session toneBlue
class node_account,node_profile toneAmber
class node_admin_ops,node_order_status,node_brand,node_gemini toneMint
class node_news,node_ai_chat toneRose
class node_ef_context,node_store_db,node_order_model,node_product_model,node_shopper,node_admin,node_email toneIndigo
```

## Components

### Storefront

- [Product Catalog](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/ProductController.cs): `IHomeFurniture/Controllers/ProductController.cs`
- [Cart and Checkout](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/CartController.cs): `IHomeFurniture/Controllers/CartController.cs`
- **Cart Session**

### Accounts

- [Account and OTP](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/AccountController.cs): `IHomeFurniture/Controllers/AccountController.cs`
- [Customer Profile](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/UserAccountController.cs): `IHomeFurniture/Controllers/UserAccountController.cs`

### Store Operations

- [Admin Management](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/AdminController.cs): `IHomeFurniture/Controllers/AdminController.cs`
- [Order Status](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/OrderStatusController.cs): `IHomeFurniture/Controllers/OrderStatusController.cs`
- [Brand Routes](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/BrandController.cs): `IHomeFurniture/Controllers/BrandController.cs`

### Content and Advice

- [News Management](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/NewsController.cs): `IHomeFurniture/Controllers/NewsController.cs`
- [AI Shopping Chat](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Controllers/ChatBoxAIController.cs): `IHomeFurniture/Controllers/ChatBoxAIController.cs`

### Persistence

- [Entity Framework](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/IHomeModel.Context.cs): `IHomeFurniture/Models/IHomeModel.Context.cs`
- [Store Database](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/IHomeModel.Designer.cs): `IHomeFurniture/Models/IHomeModel.Designer.cs`
- [Order Entities](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/DONDATHANG.cs): `IHomeFurniture/Models/DONDATHANG.cs`
- [Product Entity](https://github.com/poseidonsamu-ux/ihomefurniture/blob/master/IHomeFurniture/Models/SANPHAM.cs): `IHomeFurniture/Models/SANPHAM.cs`

### Other components

- **Shopper**
- **Administrator**
- **SMTP Email**
- **Gemini API**

## Connections

- Shopper → Product Catalog: browses
- Product Catalog → Entity Framework: queries products
- Product Catalog → Entity Framework: updates views
- Entity Framework → Store Database: reads and writes
- Shopper → Cart and Checkout: manages cart
- Cart and Checkout → Cart Session: stores cart
- Cart and Checkout → Entity Framework: loads products
- Cart and Checkout → Entity Framework: creates order
- Entity Framework → Store Database: reads and writes
- Cart and Checkout → Order Entities: persists order
- Shopper → Account and OTP: registers or signs in
- Account and OTP → Entity Framework: reads and updates customers
- Account and OTP → SMTP Email: sends OTP
- Shopper → Customer Profile: manages profile
- Customer Profile → Entity Framework: reads and updates profile
- Customer Profile → Entity Framework: loads orders
- Administrator → Admin Management: manages store
- Admin Management → Entity Framework: manages records
- Administrator → Order Status: maintains statuses
- Order Status → Entity Framework: manages statuses
- Administrator → News Management: manages news
- Shopper → News Management: reads news
- News Management → Entity Framework: reads and writes news
- Shopper → AI Shopping Chat: asks for advice
- AI Shopping Chat → Entity Framework: loads products
- AI Shopping Chat → Gemini API: requests response
- Entity Framework → Store Database: reads and writes
