# shashishekhardixit/buildmart-ai architecture

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

- Interactive diagram: https://gitdiagram.com/shashishekhardixit/buildmart-ai
- Repository: https://github.com/shashishekhardixit/buildmart-ai

## Overview

BuildMart is a construction-material marketplace with a React client and Spring Boot API. The customer workflow runs from browsing or asking for an estimate through the API to product or order handling; account, vendor, admin, and support capabilities form adjacent branches. The README documents the broader feature set, while several backend excerpts show placeholder or commented-out persistence, so storage and some integrations are not represented as verified call paths.

Main entry points: [`frontend/src/services/api.js`](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/App.js`](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/App.js) (React app), [`backend/src/main/java/com/buildmart/service/ProductService.java`](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/ProductService.java) (Product operations), [`backend/src/main/java/com/buildmart/service/OrderService.java`](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/OrderService.java) (Order operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace client"]
  node_app["React app<br/>[App.js]"]
  node_products_page["Product browsing<br/>[ProductsPage.js]"]
  node_ai_page["AI advisor<br/>[AIAdvisorPage.js]"]
  node_chatbot["AI chatbot<br/>[AIChatbot.js]"]
  node_login_page["Login and registration<br/>[LoginPage.js]"]
  node_admin_page["Admin dashboard"]
  node_api_client["API client<br/>[api.js]"]
  node_auth_state["Auth state<br/>[authSlice.js]"]
end

subgraph group_commerce["Commerce API"]
  node_product_controller["Product endpoints"]
  node_product_service["Product operations"]
  node_order_controller["Order endpoints"]
  node_order_service["Order operations<br/>[OrderService.java]"]
  node_ai_controller["AI endpoints<br/>[AIController.java]"]
end

subgraph group_identity["Identity and operations"]
  node_auth_controller["Auth endpoints"]
  node_auth_service["Auth operations<br/>[AuthService.java]"]
  node_jwt_service["JWT service<br/>[JwtService.java]"]
  node_vendor_admin["Vendor and admin"]
end

subgraph group_domain["Marketplace data"]
  node_product_model["Product model<br/>[Product.java]"]
  node_order_model["Order model<br/>[Order.java]"]
  node_user_model["User model<br/>[User.java]"]
end

node_customer(("Customer"))
node_mysql[("MySQL database")]
node_openai{{"OpenAI service"}}

node_customer -->|"uses"| node_app
node_app -->|"routes to"| node_products_page
node_app -->|"routes to"| node_ai_page
node_app -->|"routes to"| node_login_page
node_app -->|"routes to"| node_admin_page
node_app -->|"renders"| node_chatbot
node_products_page -->|"requests data"| node_api_client
node_ai_page -->|"requests estimates"| node_api_client
node_chatbot -->|"sends chat"| node_api_client
node_login_page -->|"dispatches auth"| node_auth_state
node_auth_state -->|"calls"| node_api_client
node_admin_page -->|"requests data"| node_api_client
node_api_client -->|"calls API"| node_product_controller
node_api_client -->|"calls API"| node_order_controller
node_api_client -->|"calls API"| node_ai_controller
node_api_client -->|"calls API"| node_auth_controller
node_product_controller -->|"delegates to"| node_product_service
node_order_controller -->|"delegates to"| node_order_service
node_auth_controller -->|"delegates to"| node_auth_service
node_auth_controller -->|"uses tokens"| node_jwt_service
node_product_service -->|"handles products"| node_product_model
node_order_service -->|"handles orders"| node_order_model
node_auth_service -.->|"manages accounts"| node_user_model
node_product_service -.->|"persists catalog"| node_mysql
node_order_service -.->|"persists orders"| node_mysql
node_ai_controller -.->|"uses AI"| node_openai
node_vendor_admin -.->|"manages records"| node_mysql

click node_app "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/App.js"
click node_products_page "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/ProductsPage.js"
click node_ai_page "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/AIAdvisorPage.js"
click node_chatbot "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/components/ai/AIChatbot.js"
click node_login_page "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/LoginPage.js"
click node_admin_page "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/admin/AdminDashboardPage.js"
click node_api_client "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/services/api.js"
click node_auth_state "https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/store/slices/authSlice.js"
click node_product_controller "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/ProductController.java"
click node_product_service "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/ProductService.java"
click node_order_controller "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/OrderController.java"
click node_order_service "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/OrderService.java"
click node_ai_controller "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/AIController.java"
click node_auth_controller "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/AuthController.java"
click node_auth_service "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/AuthService.java"
click node_jwt_service "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/security/JwtService.java"
click node_vendor_admin "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/VendorController.java"
click node_product_model "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/entity/Product.java"
click node_order_model "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/entity/Order.java"
click node_user_model "https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/entity/User.java"

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_products_page,node_ai_page,node_chatbot,node_login_page,node_admin_page,node_api_client,node_auth_state toneBlue
class node_product_controller,node_product_service,node_order_controller,node_order_service,node_ai_controller,node_mysql toneAmber
class node_auth_controller,node_auth_service,node_jwt_service,node_vendor_admin toneMint
class node_product_model,node_order_model,node_user_model toneRose
class node_customer,node_openai toneIndigo
```

## Components

### Marketplace client

- [React app](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Product browsing](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/ProductsPage.js): `frontend/src/pages/ProductsPage.js`
- [AI advisor](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/AIAdvisorPage.js): `frontend/src/pages/AIAdvisorPage.js`
- [AI chatbot](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/components/ai/AIChatbot.js): `frontend/src/components/ai/AIChatbot.js`
- [Login and registration](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/LoginPage.js): `frontend/src/pages/LoginPage.js`
- [Admin dashboard](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/pages/admin/AdminDashboardPage.js): `frontend/src/pages/admin/AdminDashboardPage.js`
- [API client](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Auth state](https://github.com/shashishekhardixit/buildmart-ai/blob/main/frontend/src/store/slices/authSlice.js): `frontend/src/store/slices/authSlice.js`

### Commerce API

- [Product endpoints](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/ProductController.java): `backend/src/main/java/com/buildmart/controller/ProductController.java`
- [Product operations](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/ProductService.java): `backend/src/main/java/com/buildmart/service/ProductService.java`
- [Order endpoints](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/OrderController.java): `backend/src/main/java/com/buildmart/controller/OrderController.java`
- [Order operations](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/OrderService.java): `backend/src/main/java/com/buildmart/service/OrderService.java`
- [AI endpoints](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/AIController.java): `backend/src/main/java/com/buildmart/controller/AIController.java`

### Identity and operations

- [Auth endpoints](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/AuthController.java): `backend/src/main/java/com/buildmart/controller/AuthController.java`
- [Auth operations](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/service/AuthService.java): `backend/src/main/java/com/buildmart/service/AuthService.java`
- [JWT service](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/security/JwtService.java): `backend/src/main/java/com/buildmart/security/JwtService.java`
- [Vendor and admin](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/controller/VendorController.java): `backend/src/main/java/com/buildmart/controller/VendorController.java`

### Marketplace data

- [Product model](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/entity/Product.java): `backend/src/main/java/com/buildmart/entity/Product.java`
- [Order model](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/entity/Order.java): `backend/src/main/java/com/buildmart/entity/Order.java`
- [User model](https://github.com/shashishekhardixit/buildmart-ai/blob/main/backend/src/main/java/com/buildmart/entity/User.java): `backend/src/main/java/com/buildmart/entity/User.java`

### Other components

- **Customer**
- **MySQL database**
- **OpenAI service**

## Connections

- Customer → React app: uses
- React app → Product browsing: routes to (evidence: `frontend/src/App.js`)
- React app → AI advisor: routes to (evidence: `frontend/src/App.js`)
- React app → Login and registration: routes to (evidence: `frontend/src/App.js`)
- React app → Admin dashboard: routes to (evidence: `frontend/src/App.js`)
- React app → AI chatbot: renders (evidence: `frontend/src/App.js`)
- Product browsing → API client: requests data (evidence: `frontend/src/pages/ProductsPage.js`)
- AI advisor → API client: requests estimates (evidence: `frontend/src/pages/AIAdvisorPage.js`)
- AI chatbot → API client: sends chat (evidence: `frontend/src/components/ai/AIChatbot.js`)
- Login and registration → Auth state: dispatches auth (evidence: `frontend/src/pages/LoginPage.js`)
- Auth state → API client: calls (evidence: `frontend/src/store/slices/authSlice.js`)
- Admin dashboard → API client: requests data (evidence: `frontend/src/pages/admin/AdminDashboardPage.js`)
- API client → Product endpoints: calls API
- API client → Order endpoints: calls API
- API client → AI endpoints: calls API
- API client → Auth endpoints: calls API
- Product endpoints → Product operations: delegates to (evidence: `backend/src/main/java/com/buildmart/controller/ProductController.java`)
- Order endpoints → Order operations: delegates to (evidence: `backend/src/main/java/com/buildmart/controller/OrderController.java`)
- Auth endpoints → Auth operations: delegates to (evidence: `backend/src/main/java/com/buildmart/controller/AuthController.java`)
- Auth endpoints → JWT service: uses tokens (evidence: `backend/src/main/java/com/buildmart/controller/AuthController.java`)
- Product operations → Product model: handles products (evidence: `backend/src/main/java/com/buildmart/service/ProductService.java`)
- Order operations → Order model: handles orders (evidence: `backend/src/main/java/com/buildmart/service/OrderService.java`)
- Auth operations → User model: manages accounts
- Product operations → MySQL database: persists catalog
- Order operations → MySQL database: persists orders
- AI endpoints → OpenAI service: uses AI
- Vendor and admin → MySQL database: manages records
