# sanjeevandev/hepna_mart architecture

> Architecture diagram of the GitHub repository sanjeevandev/hepna_mart, 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/sanjeevandev/hepna_mart
- Repository: https://github.com/sanjeevandev/hepna_mart

## Overview

HEPNA MART is a construction-materials storefront and procurement platform, with a React client and FastAPI backend. Customers browse a catalog, manage shopping and orders, and can use project planning, estimates/BOQs, or wholesale RFQs and quotes; staff have administrative workflows for catalog, stock, orders, and payments. The sampled client shows route ownership and catalog API calls, while backend excerpts show API mounting and wholesale/order service behavior. Most endpoint-to-service wiring and other feature internals were not sampled, so those links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/sanjeevandev/hepna_mart/blob/main/src/App.tsx) (Client routes), [`src/lib/api.ts`](https://github.com/sanjeevandev/hepna_mart/blob/main/src/lib/api.ts) (API client), [`src/pages/ShopPage.tsx`](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/ShopPage.tsx) (Catalog browsing), [`src/pages/ProjectsDashboardPage.tsx`](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/ProjectsDashboardPage.tsx) (Projects and BOQs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer storefront"]
  node_app["Client routes<br/>[App.tsx]"]
  node_catalog["Catalog browsing<br/>[ShopPage.tsx]"]
  node_cart["Cart and checkout<br/>[CartPage.tsx]"]
  node_orders["Order tracking<br/>[OrdersPage.tsx]"]
  node_account["Account and wishlist<br/>[AccountPage.tsx]"]
end

subgraph group_planning["Project planning"]
  node_planning_pages["Projects and BOQs"]
  node_estimates["Cost estimates"]
  node_calculator["Construction calculator"]
end

subgraph group_procurement["Wholesale procurement"]
  node_rfq["Wholesale RFQs<br/>[RFQListPage.tsx]"]
  node_quotes["Quotes and approval"]
end

subgraph group_operations["Staff operations"]
  node_admin["Admin console"]
  node_admin_orders["Order and payment admin"]
  node_admin_catalog["Catalog and stock admin"]
end

subgraph group_backend["Backend platform"]
  node_api_client["API client<br/>[api.ts]"]
  node_catalog_service["Catalog adapter<br/>[catalogService.ts]"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_api_router["API v1 router<br/>[router.py]"]
  node_endpoints["API endpoints"]
  node_wholesale_service["RFQ and quote service"]
  node_order_service["Order service<br/>[order_service.py]"]
  node_database[("Relational database<br/>[database.py]")]
end

node_shopper(("Customer"))
node_staff(("Staff user"))

node_shopper -->|"uses"| node_app
node_staff -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_account
node_app -->|"routes to"| node_planning_pages
node_app -->|"routes to"| node_estimates
node_app -->|"routes to"| node_rfq
node_app -->|"routes to"| node_quotes
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_admin_orders
node_app -->|"routes to"| node_admin_catalog
node_catalog -->|"loads catalog"| node_catalog_service
node_catalog_service -->|"requests data"| node_api_client
node_planning_pages -->|"calculates materials"| node_calculator
node_api_app -->|"mounts router"| node_api_router
node_api_router -->|"dispatches routes"| node_endpoints
node_api_client -->|"HTTP requests"| node_api_app
node_quotes -->|"quote requests"| node_api_client
node_wholesale_service -->|"creates accepted-quote order"| node_order_service
node_endpoints -->|"handles RFQ routes"| node_wholesale_service

click node_app "https://github.com/sanjeevandev/hepna_mart/blob/main/src/App.tsx"
click node_catalog "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/ShopPage.tsx"
click node_cart "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/CartPage.tsx"
click node_orders "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/OrdersPage.tsx"
click node_account "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/AccountPage.tsx"
click node_planning_pages "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/ProjectsDashboardPage.tsx"
click node_estimates "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/CostCalculatorPage.tsx"
click node_calculator "https://github.com/sanjeevandev/hepna_mart/blob/main/src/utils/constructionCalculator.ts"
click node_rfq "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/RFQListPage.tsx"
click node_quotes "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/QuoteDetailPage.tsx"
click node_admin "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/admin/AdminOverviewPage.tsx"
click node_admin_orders "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/admin/AdminOrdersPage.tsx"
click node_admin_catalog "https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/admin/AdminProductsPage.tsx"
click node_api_client "https://github.com/sanjeevandev/hepna_mart/blob/main/src/lib/api.ts"
click node_catalog_service "https://github.com/sanjeevandev/hepna_mart/blob/main/src/services/catalogService.ts"
click node_api_app "https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/main.py"
click node_api_router "https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/api/v1/router.py"
click node_endpoints "https://github.com/sanjeevandev/hepna_mart/tree/main/backend/app/api/v1/endpoints"
click node_wholesale_service "https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/services/wholesale_service.py"
click node_order_service "https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/services/order_service.py"
click node_database "https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/core/database.py"

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_catalog,node_cart,node_orders,node_account,node_staff toneBlue
class node_planning_pages,node_estimates,node_calculator toneAmber
class node_rfq,node_quotes toneMint
class node_admin,node_admin_orders,node_admin_catalog toneRose
class node_api_client,node_catalog_service,node_api_app,node_api_router,node_endpoints,node_wholesale_service,node_order_service,node_database,node_shopper toneIndigo
```

## Components

### Customer storefront

- [Client routes](https://github.com/sanjeevandev/hepna_mart/blob/main/src/App.tsx): `src/App.tsx`
- [Catalog browsing](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/ShopPage.tsx): `src/pages/ShopPage.tsx`
- [Cart and checkout](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/CartPage.tsx): `src/pages/CartPage.tsx`
- [Order tracking](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/OrdersPage.tsx): `src/pages/OrdersPage.tsx`
- [Account and wishlist](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/AccountPage.tsx): `src/pages/AccountPage.tsx`

### Project planning

- [Projects and BOQs](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/ProjectsDashboardPage.tsx): `src/pages/ProjectsDashboardPage.tsx`
- [Cost estimates](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/CostCalculatorPage.tsx): `src/pages/CostCalculatorPage.tsx`
- [Construction calculator](https://github.com/sanjeevandev/hepna_mart/blob/main/src/utils/constructionCalculator.ts): `src/utils/constructionCalculator.ts`

### Wholesale procurement

- [Wholesale RFQs](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/RFQListPage.tsx): `src/pages/RFQListPage.tsx`
- [Quotes and approval](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/QuoteDetailPage.tsx): `src/pages/QuoteDetailPage.tsx`

### Staff operations

- [Admin console](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/admin/AdminOverviewPage.tsx): `src/pages/admin/AdminOverviewPage.tsx`
- [Order and payment admin](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/admin/AdminOrdersPage.tsx): `src/pages/admin/AdminOrdersPage.tsx`
- [Catalog and stock admin](https://github.com/sanjeevandev/hepna_mart/blob/main/src/pages/admin/AdminProductsPage.tsx): `src/pages/admin/AdminProductsPage.tsx`

### Backend platform

- [API client](https://github.com/sanjeevandev/hepna_mart/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Catalog adapter](https://github.com/sanjeevandev/hepna_mart/blob/main/src/services/catalogService.ts): `src/services/catalogService.ts`
- [FastAPI application](https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/main.py): `backend/app/main.py`
- [API v1 router](https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [API endpoints](https://github.com/sanjeevandev/hepna_mart/tree/main/backend/app/api/v1/endpoints): `backend/app/api/v1/endpoints`
- [RFQ and quote service](https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/services/wholesale_service.py): `backend/app/services/wholesale_service.py`
- [Order service](https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/services/order_service.py): `backend/app/services/order_service.py`
- [Relational database](https://github.com/sanjeevandev/hepna_mart/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Other components

- **Customer**
- **Staff user**

## Connections

- Customer → Client routes: uses
- Staff user → Client routes: uses
- Client routes → Catalog browsing: routes to
- Client routes → Cart and checkout: routes to
- Client routes → Order tracking: routes to
- Client routes → Account and wishlist: routes to
- Client routes → Projects and BOQs: routes to
- Client routes → Cost estimates: routes to
- Client routes → Wholesale RFQs: routes to
- Client routes → Quotes and approval: routes to
- Client routes → Admin console: routes to
- Client routes → Order and payment admin: routes to
- Client routes → Catalog and stock admin: routes to
- Catalog browsing → Catalog adapter: loads catalog
- Catalog adapter → API client: requests data
- Projects and BOQs → Construction calculator: calculates materials
- FastAPI application → API v1 router: mounts router
- API v1 router → API endpoints: dispatches routes
- API client → FastAPI application: HTTP requests
- Quotes and approval → API client: quote requests
- RFQ and quote service → Order service: creates accepted-quote order
- API endpoints → RFQ and quote service: handles RFQ routes
