# attiyah02/elite-interiors architecture

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

- Interactive diagram: https://gitdiagram.com/attiyah02/elite-interiors
- Repository: https://github.com/attiyah02/elite-interiors

## Overview

Elite Interiors is a furniture-commerce application. Customers browse and search a catalog, add items to a locally persisted cart, authenticate, and place and review orders; administrators manage catalog and orders and view reports. The graph separates the React entry/routing layer, backend domain handlers and MongoDB models, and optional AI/email integrations. Source excerpts confirm several controller-to-model calls and the order-to-email flow; route-to-controller wiring and page-to-API calls are not detailed, so those links are omitted.

Main entry points: [`backend/server.js`](https://github.com/attiyah02/elite-interiors/blob/main/backend/server.js) (API Server), [`frontend/src/App.jsx`](https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/App.jsx) (App Routing), [`backend/controllers/orderController.js`](https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/orderController.js) (Order Handler), [`backend/controllers/adminController.js`](https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/adminController.js) (Admin Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Storefront"]
  node_app["App Routing<br/>[App.jsx]"]
  node_cart["Cart State<br/>[CartContext.jsx]"]
  node_catalogui["Catalog Pages<br/>[ProductsPage.jsx]"]
  node_checkoutui["Checkout<br/>[CheckoutPage.jsx]"]
  node_orderui["Order Pages<br/>[MyOrdersPage.jsx]"]
  node_adminui["Admin Pages<br/>[AdminDashboard.jsx]"]
end

subgraph group_backend["Commerce Backend"]
  node_server["API Server<br/>[server.js]"]
  node_productctl["Product Handler"]
  node_image["Image Search<br/>[imageSearch.js]"]
  node_orderctl["Order Handler<br/>[orderController.js]"]
  node_categoryctl["Category Handler"]
  node_products[("Product Records<br/>[Product.js]")]
  node_orders[("Order Records<br/>[Order.js]")]
  node_categories[("Category Records<br/>[Category.js]")]
end

subgraph group_admin["Identity And Admin"]
  node_authctl["Account Handler<br/>[authController.js]"]
  node_authmw["JWT Authorization<br/>[auth.js]"]
  node_adminctl["Admin Handler<br/>[adminController.js]"]
  node_users[("User Records<br/>[User.js]")]
end

subgraph group_integrations["External Services"]
  node_nlp{{"Google Language"}}
  node_vision{{"Google Vision"}}
  node_email["Email Service<br/>[emailService.js]"]
end

node_customer(("Customer"))
node_adminactor(("Administrator"))
node_mailprovider{{"Mail Provider"}}
node_mongodb[("MongoDB")]

node_customer -->|"browses"| node_app
node_adminactor -->|"administers"| node_app
node_app -->|"routes to"| node_catalogui
node_app -->|"routes to"| node_checkoutui
node_app -->|"routes to"| node_orderui
node_app -->|"routes to"| node_adminui
node_app -->|"provides state"| node_cart
node_server -->|"mounts products"| node_productctl
node_server -->|"mounts orders"| node_orderctl
node_server -->|"mounts categories"| node_categoryctl
node_server -->|"mounts auth"| node_authctl
node_server -->|"mounts admin"| node_adminctl
node_server -->|"mounts search"| node_image
node_server -->|"connects"| node_mongodb
node_productctl -->|"queries"| node_products
node_productctl -.->|"analyzes text"| node_nlp
node_image -.->|"analyzes image"| node_vision
node_image -->|"searches"| node_products
node_orderctl -->|"reads items"| node_products
node_orderctl -->|"creates and reads"| node_orders
node_orderctl -->|"loads customer"| node_users
node_orderctl -->|"requests notifications"| node_email
node_email -.->|"sends messages"| node_mailprovider
node_categoryctl -->|"manages"| node_categories
node_authctl -->|"manages accounts"| node_users
node_authmw -->|"loads identity"| node_users
node_adminctl -->|"reports on"| node_orders
node_adminctl -->|"reports on"| node_products
node_adminctl -->|"reports on"| node_users

click node_app "https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/App.jsx"
click node_cart "https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/context/CartContext.jsx"
click node_catalogui "https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/ProductsPage.jsx"
click node_checkoutui "https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/CheckoutPage.jsx"
click node_orderui "https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/MyOrdersPage.jsx"
click node_adminui "https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/admin/AdminDashboard.jsx"
click node_server "https://github.com/attiyah02/elite-interiors/blob/main/backend/server.js"
click node_productctl "https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/productController.js"
click node_image "https://github.com/attiyah02/elite-interiors/blob/main/backend/routes/imageSearch.js"
click node_orderctl "https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/orderController.js"
click node_categoryctl "https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/categoryController.js"
click node_authctl "https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/authController.js"
click node_authmw "https://github.com/attiyah02/elite-interiors/blob/main/backend/middleware/auth.js"
click node_adminctl "https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/adminController.js"
click node_products "https://github.com/attiyah02/elite-interiors/blob/main/backend/models/Product.js"
click node_orders "https://github.com/attiyah02/elite-interiors/blob/main/backend/models/Order.js"
click node_categories "https://github.com/attiyah02/elite-interiors/blob/main/backend/models/Category.js"
click node_users "https://github.com/attiyah02/elite-interiors/blob/main/backend/models/User.js"
click node_email "https://github.com/attiyah02/elite-interiors/blob/main/backend/utils/emailService.js"

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_app,node_cart,node_catalogui,node_checkoutui,node_orderui,node_adminui toneBlue
class node_server,node_productctl,node_image,node_orderctl,node_categoryctl,node_products,node_orders,node_categories,node_mongodb toneAmber
class node_authctl,node_authmw,node_adminctl,node_users toneMint
class node_nlp,node_vision,node_email toneRose
class node_customer,node_adminactor,node_mailprovider toneIndigo
```

## Components

### Storefront

- [App Routing](https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Cart State](https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Catalog Pages](https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/ProductsPage.jsx): `frontend/src/pages/ProductsPage.jsx`
- [Checkout](https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/CheckoutPage.jsx): `frontend/src/pages/CheckoutPage.jsx`
- [Order Pages](https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/MyOrdersPage.jsx): `frontend/src/pages/MyOrdersPage.jsx`
- [Admin Pages](https://github.com/attiyah02/elite-interiors/blob/main/frontend/src/pages/admin/AdminDashboard.jsx): `frontend/src/pages/admin/AdminDashboard.jsx`

### Commerce Backend

- [API Server](https://github.com/attiyah02/elite-interiors/blob/main/backend/server.js): `backend/server.js`
- [Product Handler](https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/productController.js): `backend/controllers/productController.js`
- [Image Search](https://github.com/attiyah02/elite-interiors/blob/main/backend/routes/imageSearch.js): `backend/routes/imageSearch.js`
- [Order Handler](https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/orderController.js): `backend/controllers/orderController.js`
- [Category Handler](https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/categoryController.js): `backend/controllers/categoryController.js`
- [Product Records](https://github.com/attiyah02/elite-interiors/blob/main/backend/models/Product.js): `backend/models/Product.js`
- [Order Records](https://github.com/attiyah02/elite-interiors/blob/main/backend/models/Order.js): `backend/models/Order.js`
- [Category Records](https://github.com/attiyah02/elite-interiors/blob/main/backend/models/Category.js): `backend/models/Category.js`

### Identity And Admin

- [Account Handler](https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT Authorization](https://github.com/attiyah02/elite-interiors/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Admin Handler](https://github.com/attiyah02/elite-interiors/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`
- [User Records](https://github.com/attiyah02/elite-interiors/blob/main/backend/models/User.js): `backend/models/User.js`

### External Services

- **Google Language**
- **Google Vision**
- [Email Service](https://github.com/attiyah02/elite-interiors/blob/main/backend/utils/emailService.js): `backend/utils/emailService.js`

### Other components

- **Customer**
- **Administrator**
- **Mail Provider**
- **MongoDB**

## Connections

- Customer → App Routing: browses
- Administrator → App Routing: administers
- App Routing → Catalog Pages: routes to
- App Routing → Checkout: routes to
- App Routing → Order Pages: routes to
- App Routing → Admin Pages: routes to
- App Routing → Cart State: provides state
- API Server → Product Handler: mounts products
- API Server → Order Handler: mounts orders
- API Server → Category Handler: mounts categories
- API Server → Account Handler: mounts auth
- API Server → Admin Handler: mounts admin
- API Server → Image Search: mounts search
- API Server → MongoDB: connects
- Product Handler → Product Records: queries
- Product Handler → Google Language: analyzes text
- Image Search → Google Vision: analyzes image
- Image Search → Product Records: searches
- Order Handler → Product Records: reads items
- Order Handler → Order Records: creates and reads
- Order Handler → User Records: loads customer
- Order Handler → Email Service: requests notifications
- Email Service → Mail Provider: sends messages
- Category Handler → Category Records: manages
- Account Handler → User Records: manages accounts
- JWT Authorization → User Records: loads identity
- Admin Handler → Order Records: reports on
- Admin Handler → Product Records: reports on
- Admin Handler → User Records: reports on
