# bhiekeys/vendor-dashboard architecture

> Architecture diagram of the GitHub repository bhiekeys/vendor-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhiekeys/vendor-dashboard
- Repository: https://github.com/bhiekeys/vendor-dashboard

## Overview

#### Purpose and Runtime
This is a React single-page vendor dashboard, built and served with Vite. Its feature set is centered on vendor authentication, dashboard overview, products, orders, and account settings. Browser-side application startup is at `src/main.jsx`, with the root UI assembled in `src/App.jsx`.

#### Application Composition and Routing
Routing is centralized in `src/Router.jsx`, which connects page-level route views to the application shell. Page modules separate route concerns from reusable feature components:
- `src/pages/Auth.jsx`
- `src/pages/Overview.jsx`
- `src/pages/Product.jsx`
- `src/pages/Order.jsx`
- `src/pages/Setting.jsx`

#### Authenticated Dashboard Boundary
`src/layouts/DashboardLayout.jsx` is the primary authenticated-area shell and likely provides the shared dashboard structure around overview, product, order, and settings pages. Authentication UI is represented by `src/components/Login.jsx`, `src/components/SignUp.jsx`, and `src/components/LogoutModal.jsx`; auth state is isolated under `src/utils/Store/vendorAuthStore.jsx`.

#### Vendor API and Service Layer
Network integration is intentionally separated from UI:
- `src/utils/api/ThelvoraAPI.js` is the API client boundary.
- `src/utils/Services/vendorServices.jsx` contains vendor-oriented service operations.
- `src/utils/Store/vendorAuthStore.jsx` holds vendor authentication state.

Components and pages should depend on this layer rather than directly coupling request logic to rendering. The named API client indicates an external Thelvora backend/API service.

#### Product Management Flow
Product management is a dedicated CRUD feature with route-level add/edit views and composable product UI:
- `src/pages/Product.jsx`
- `src/pages/AddProduct.jsx`
- `src/pages/EditProduct.jsx`
- `src/components/Products/ProductLists.jsx`
- `src/components/Products/AddProducts.jsx`
- `src/components/Products/EditProducts.jsx`

The expected flow is product listing → add or edit route → service/API operation → refreshed product state/list. Deletion and media handling are isolated through `src/components/Products/DeleteModal.jsx` and `src/components/Products/ImageUploader.jsx`, making destructive actions and image upload explicit feature boundaries.

#### Orders and Dashboard Read Models
Order-facing views are split between aggregate and detail rendering:
- `src/components/Orders.jsx`
- `src/components/SingleOrder.jsx`
- `src/pages/Order.jsx`

The overview/dashboard read model is represented by `src/pages/Overview.jsx` and `src/components/OverView.jsx`. These views likely consume vendor service data but remain presentation-oriented rather than owning API configuration.

#### Styling and Frontend Infrastructure
The client uses Vite’s React setup (`vite.config.js`), Tailwind/PostCSS styling infrastructure (`tailwind.config.js`, `postcss.config.js`), and global CSS (`src/index.css`). Shared non-UI logic is placed in `src/utils/helpers.js`; static browser assets reside in `public` and `src/assets`.

Main entry points: [`src/utils/Services/vendorServices.jsx`](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/utils/Services/vendorServices.jsx) (Vendor operations), [`src/layouts/DashboardLayout.jsx`](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/layouts/DashboardLayout.jsx) (Authenticated dashboard shell), [`src/pages/Product.jsx`](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Product.jsx) (Product list), [`src/main.jsx`](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/main.jsx) (Browser entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Client Runtime"]
  node_vite{{"Vite build and dev server<br/>frontend tooling<br/>[vite.config.js]"}}
  node_main["Browser entry<br/>React startup<br/>[main.jsx]"]
  node_app["Root application<br/>React root<br/>[App.jsx]"]
  node_router["Route composition<br/>router<br/>[Router.jsx]"]
  node_global_styles["Global styling<br/>CSS and Tailwind<br/>[index.css]"]
end

subgraph group_auth["Authentication"]
  node_auth_pages["Auth page<br/>route view<br/>[Auth.jsx]"]
  node_auth_ui["Login, signup and logout UI<br/>auth components<br/>[Login.jsx]"]
  node_auth_store[("Vendor auth state<br/>client store")]
end

subgraph group_dashboard["Dashboard Features"]
  node_dashboard_layout["Authenticated dashboard shell<br/>layout"]
  node_overview["Overview dashboard<br/>read-model view<br/>[Overview.jsx]"]
  node_products["Product list<br/>[Product.jsx]"]
  node_product_editor["Add and edit products<br/>product CRUD views<br/>[AddProduct.jsx]"]
  node_product_actions["Product deletion and media<br/>product components<br/>[DeleteModal.jsx]"]
  node_orders["Orders and order detail<br/>order views<br/>[Order.jsx]"]
  node_settings["Account settings<br/>route view<br/>[Setting.jsx]"]
end

subgraph group_data["Vendor Data Layer"]
  node_vendor_services["Vendor operations<br/>service layer<br/>[vendorServices.jsx]"]
  node_api_client["Thelvora API client<br/>API boundary<br/>[ThelvoraAPI.js]"]
end

node_thelvora{{"Thelvora backend<br/>external API"}}

node_vite -->|"serves"| node_main
node_main -->|"mounts"| node_app
node_main -->|"loads"| node_global_styles
node_app -->|"renders"| node_router
node_router -->|"public route"| node_auth_pages
node_router -->|"authenticated routes"| node_dashboard_layout
node_auth_pages -->|"composes"| node_auth_ui
node_auth_ui -->|"updates"| node_auth_store
node_dashboard_layout -->|"checks session"| node_auth_store
node_dashboard_layout -->|"hosts route"| node_overview
node_dashboard_layout -->|"hosts route"| node_products
node_dashboard_layout -->|"hosts route"| node_orders
node_dashboard_layout -->|"hosts route"| node_settings
node_products -->|"add or edit route"| node_product_editor
node_products -->|"uses"| node_product_actions
node_overview -->|"loads vendor data"| node_vendor_services
node_products -->|"CRUD operations"| node_vendor_services
node_product_editor -->|"creates or updates"| node_vendor_services
node_orders -->|"loads orders"| node_vendor_services
node_settings -->|"loads or updates"| node_vendor_services
node_auth_store -->|"auth operations"| node_vendor_services
node_vendor_services -->|"calls"| node_api_client
node_api_client -->|"HTTP requests"| node_thelvora

click node_vite "https://github.com/bhiekeys/vendor-dashboard/blob/main/vite.config.js"
click node_main "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/main.jsx"
click node_app "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/App.jsx"
click node_router "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/Router.jsx"
click node_auth_pages "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Auth.jsx"
click node_auth_ui "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/components/Login.jsx"
click node_auth_store "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/utils/Store/vendorAuthStore.jsx"
click node_dashboard_layout "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/layouts/DashboardLayout.jsx"
click node_overview "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Overview.jsx"
click node_products "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Product.jsx"
click node_product_editor "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/AddProduct.jsx"
click node_product_actions "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/components/Products/DeleteModal.jsx"
click node_orders "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Order.jsx"
click node_settings "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Setting.jsx"
click node_vendor_services "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/utils/Services/vendorServices.jsx"
click node_api_client "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/utils/api/ThelvoraAPI.js"
click node_global_styles "https://github.com/bhiekeys/vendor-dashboard/blob/main/src/index.css"

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_vite,node_main,node_app,node_router,node_global_styles toneBlue
class node_auth_pages,node_auth_ui,node_auth_store toneAmber
class node_dashboard_layout,node_overview,node_products,node_product_editor,node_product_actions,node_orders,node_settings toneMint
class node_vendor_services,node_api_client toneRose
class node_thelvora toneNeutral
```

## Components

### Client Runtime

- [Vite build and dev server](https://github.com/bhiekeys/vendor-dashboard/blob/main/vite.config.js): frontend tooling · `vite.config.js`
- [Browser entry](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/main.jsx): React startup · `src/main.jsx`
- [Root application](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/App.jsx): React root · `src/App.jsx`
- [Route composition](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/Router.jsx): router · Connects page routes to the application shell. · `src/Router.jsx`
- [Global styling](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/index.css): CSS and Tailwind · `src/index.css`

### Authentication

- [Auth page](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Auth.jsx): route view · `src/pages/Auth.jsx`
- [Login, signup and logout UI](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/components/Login.jsx): auth components · `src/components/Login.jsx`
- [Vendor auth state](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/utils/Store/vendorAuthStore.jsx): client store · `src/utils/Store/vendorAuthStore.jsx`

### Dashboard Features

- [Authenticated dashboard shell](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/layouts/DashboardLayout.jsx): layout · Shared boundary for authenticated vendor routes. · `src/layouts/DashboardLayout.jsx`
- [Overview dashboard](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Overview.jsx): read-model view · `src/pages/Overview.jsx`
- [Product list](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Product.jsx): product route and list UI · `src/pages/Product.jsx`
- [Add and edit products](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/AddProduct.jsx): product CRUD views · `src/pages/AddProduct.jsx`
- [Product deletion and media](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/components/Products/DeleteModal.jsx): product components · Encapsulates destructive deletion and image upload. · `src/components/Products/DeleteModal.jsx`
- [Orders and order detail](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Order.jsx): order views · `src/pages/Order.jsx`
- [Account settings](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/pages/Setting.jsx): route view · `src/pages/Setting.jsx`

### Vendor Data Layer

- [Vendor operations](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/utils/Services/vendorServices.jsx): service layer · Keeps request operations outside rendering components. · `src/utils/Services/vendorServices.jsx`
- [Thelvora API client](https://github.com/bhiekeys/vendor-dashboard/blob/main/src/utils/api/ThelvoraAPI.js): API boundary · `src/utils/api/ThelvoraAPI.js`

### Other components

- **Thelvora backend**: external API

## Connections

- Vite build and dev server → Browser entry: serves
- Browser entry → Root application: mounts
- Browser entry → Global styling: loads
- Root application → Route composition: renders
- Route composition → Auth page: public route
- Route composition → Authenticated dashboard shell: authenticated routes
- Auth page → Login, signup and logout UI: composes
- Login, signup and logout UI → Vendor auth state: updates
- Authenticated dashboard shell → Vendor auth state: checks session
- Authenticated dashboard shell → Overview dashboard: hosts route
- Authenticated dashboard shell → Product list: hosts route
- Authenticated dashboard shell → Orders and order detail: hosts route
- Authenticated dashboard shell → Account settings: hosts route
- Product list → Add and edit products: add or edit route
- Product list → Product deletion and media: uses
- Overview dashboard → Vendor operations: loads vendor data
- Product list → Vendor operations: CRUD operations
- Add and edit products → Vendor operations: creates or updates
- Orders and order detail → Vendor operations: loads orders
- Account settings → Vendor operations: loads or updates
- Vendor auth state → Vendor operations: auth operations
- Vendor operations → Thelvora API client: calls
- Thelvora API client → Thelvora backend: HTTP requests
