# vivekaviva/product-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/vivekaviva/product-dashboard
- Repository: https://github.com/vivekaviva/product-dashboard

## Overview

This is a React/TypeScript product catalog app. Users browse and search a paginated list, view product details, and add, edit, or delete products; routed pages dispatch product operations through Redux state and API helpers. Cards calculate discounted prices, while a shared form supports product creation and editing. The README describes only a Vite template, so product capabilities are identified from the source index and sampled code. The API helper is present, but its external service and request details were not shown.

Main entry points: [`src/pages/Products.tsx`](https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/Products.tsx) (Product listing), [`src/pages/DetailedProducts.tsx`](https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/DetailedProducts.tsx) (Product details), [`src/store/productSlice.ts`](https://github.com/vivekaviva/product-dashboard/blob/main/src/store/productSlice.ts) (Product state and actions), [`src/App.tsx`](https://github.com/vivekaviva/product-dashboard/blob/main/src/App.tsx) (Route map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Routing"]
  node_entry["React entry<br/>[main.tsx]"]
  node_routes["Route map<br/>[App.tsx]"]
end

subgraph group_catalog["Catalog Experience"]
  node_listing["Product listing<br/>[Products.tsx]"]
  node_detail["Product details"]
  node_card["Product card<br/>[ProductCard.tsx]"]
  node_discount["Discount calculation"]
  node_pagination["Pagination controls<br/>[Pagination.tsx]"]
  node_loader["Loading indicator<br/>[Loader.tsx]"]
  node_debounce["Search debounce<br/>[useDebounce.ts]"]
end

subgraph group_editing["Product Editing"]
  node_add["Add product<br/>[AddNewProduct.tsx]"]
  node_edit["Edit product<br/>[EditProduct.tsx]"]
  node_form["Product form<br/>[ProductForm.tsx]"]
end

subgraph group_state["State and Data"]
  node_hooks["Typed Redux hooks<br/>[hook.ts]"]
  node_slice["Product state and actions<br/>[productSlice.ts]"]
  node_api["Product API helpers<br/>[productAPI.ts]"]
  node_types["Product data types<br/>[productTypes.ts]"]
  node_store["Redux store<br/>[store.ts]"]
end

node_user(("Catalog user"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_routes
node_routes -->|"routes to"| node_listing
node_routes -->|"routes to"| node_detail
node_routes -->|"routes to"| node_add
node_routes -->|"routes to"| node_edit
node_entry -->|"provides"| node_store
node_listing -->|"uses"| node_hooks
node_listing -->|"dispatches"| node_slice
node_listing -->|"debounces search"| node_debounce
node_listing -->|"renders"| node_card
node_listing -->|"renders"| node_pagination
node_listing -->|"renders"| node_loader
node_detail -->|"uses"| node_hooks
node_detail -->|"dispatches"| node_slice
node_detail -->|"renders"| node_card
node_detail -->|"renders"| node_loader
node_detail -->|"calculates price"| node_discount
node_card -->|"calculates price"| node_discount
node_add -->|"uses"| node_hooks
node_add -->|"dispatches"| node_slice
node_add -->|"renders"| node_form
node_edit -->|"uses"| node_hooks
node_edit -->|"dispatches"| node_slice
node_edit -->|"renders"| node_form
node_edit -->|"renders"| node_loader
node_hooks -->|"selects and dispatches"| node_store
node_store -->|"registers reducer"| node_slice
node_slice -->|"calls"| node_api

click node_entry "https://github.com/vivekaviva/product-dashboard/blob/main/src/main.tsx"
click node_routes "https://github.com/vivekaviva/product-dashboard/blob/main/src/App.tsx"
click node_listing "https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/Products.tsx"
click node_detail "https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/DetailedProducts.tsx"
click node_card "https://github.com/vivekaviva/product-dashboard/blob/main/src/components/ProductCard.tsx"
click node_discount "https://github.com/vivekaviva/product-dashboard/blob/main/src/helpers/calculateDiscountedPrice.ts"
click node_pagination "https://github.com/vivekaviva/product-dashboard/blob/main/src/components/Pagination.tsx"
click node_loader "https://github.com/vivekaviva/product-dashboard/blob/main/src/components/Loader.tsx"
click node_debounce "https://github.com/vivekaviva/product-dashboard/blob/main/src/hooks/useDebounce.ts"
click node_add "https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/AddNewProduct.tsx"
click node_edit "https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/EditProduct.tsx"
click node_form "https://github.com/vivekaviva/product-dashboard/blob/main/src/components/ProductForm.tsx"
click node_hooks "https://github.com/vivekaviva/product-dashboard/blob/main/src/hooks/hook.ts"
click node_slice "https://github.com/vivekaviva/product-dashboard/blob/main/src/store/productSlice.ts"
click node_api "https://github.com/vivekaviva/product-dashboard/blob/main/src/store/productAPI.ts"
click node_types "https://github.com/vivekaviva/product-dashboard/blob/main/src/store/productTypes.ts"
click node_store "https://github.com/vivekaviva/product-dashboard/blob/main/src/store/store.ts"

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_entry,node_routes,node_user toneBlue
class node_listing,node_detail,node_card,node_discount,node_pagination,node_loader,node_debounce toneAmber
class node_add,node_edit,node_form toneMint
class node_hooks,node_slice,node_api,node_types,node_store toneRose
```

## Components

### Application Routing

- [React entry](https://github.com/vivekaviva/product-dashboard/blob/main/src/main.tsx): `src/main.tsx`
- [Route map](https://github.com/vivekaviva/product-dashboard/blob/main/src/App.tsx): `src/App.tsx`

### Catalog Experience

- [Product listing](https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/Products.tsx): `src/pages/Products.tsx`
- [Product details](https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/DetailedProducts.tsx): `src/pages/DetailedProducts.tsx`
- [Product card](https://github.com/vivekaviva/product-dashboard/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`
- [Discount calculation](https://github.com/vivekaviva/product-dashboard/blob/main/src/helpers/calculateDiscountedPrice.ts): `src/helpers/calculateDiscountedPrice.ts`
- [Pagination controls](https://github.com/vivekaviva/product-dashboard/blob/main/src/components/Pagination.tsx): `src/components/Pagination.tsx`
- [Loading indicator](https://github.com/vivekaviva/product-dashboard/blob/main/src/components/Loader.tsx): `src/components/Loader.tsx`
- [Search debounce](https://github.com/vivekaviva/product-dashboard/blob/main/src/hooks/useDebounce.ts): `src/hooks/useDebounce.ts`

### Product Editing

- [Add product](https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/AddNewProduct.tsx): `src/pages/AddNewProduct.tsx`
- [Edit product](https://github.com/vivekaviva/product-dashboard/blob/main/src/pages/EditProduct.tsx): `src/pages/EditProduct.tsx`
- [Product form](https://github.com/vivekaviva/product-dashboard/blob/main/src/components/ProductForm.tsx): `src/components/ProductForm.tsx`

### State and Data

- [Typed Redux hooks](https://github.com/vivekaviva/product-dashboard/blob/main/src/hooks/hook.ts): `src/hooks/hook.ts`
- [Product state and actions](https://github.com/vivekaviva/product-dashboard/blob/main/src/store/productSlice.ts): `src/store/productSlice.ts`
- [Product API helpers](https://github.com/vivekaviva/product-dashboard/blob/main/src/store/productAPI.ts): `src/store/productAPI.ts`
- [Product data types](https://github.com/vivekaviva/product-dashboard/blob/main/src/store/productTypes.ts): `src/store/productTypes.ts`
- [Redux store](https://github.com/vivekaviva/product-dashboard/blob/main/src/store/store.ts): `src/store/store.ts`

### Other components

- **Catalog user**

## Connections

- Catalog user → React entry: opens app (evidence: `src/main.tsx`)
- React entry → Route map: renders (evidence: `src/main.tsx`)
- Route map → Product listing: routes to (evidence: `src/App.tsx`)
- Route map → Product details: routes to (evidence: `src/App.tsx`)
- Route map → Add product: routes to (evidence: `src/App.tsx`)
- Route map → Edit product: routes to (evidence: `src/App.tsx`)
- React entry → Redux store: provides (evidence: `src/main.tsx`)
- Product listing → Typed Redux hooks: uses (evidence: `src/pages/Products.tsx`)
- Product listing → Product state and actions: dispatches (evidence: `src/pages/Products.tsx`)
- Product listing → Search debounce: debounces search (evidence: `src/pages/Products.tsx`)
- Product listing → Product card: renders (evidence: `src/pages/Products.tsx`)
- Product listing → Pagination controls: renders (evidence: `src/pages/Products.tsx`)
- Product listing → Loading indicator: renders (evidence: `src/pages/Products.tsx`)
- Product details → Typed Redux hooks: uses (evidence: `src/pages/DetailedProducts.tsx`)
- Product details → Product state and actions: dispatches (evidence: `src/pages/DetailedProducts.tsx`)
- Product details → Product card: renders (evidence: `src/pages/DetailedProducts.tsx`)
- Product details → Loading indicator: renders (evidence: `src/pages/DetailedProducts.tsx`)
- Product details → Discount calculation: calculates price (evidence: `src/pages/DetailedProducts.tsx`)
- Product card → Discount calculation: calculates price (evidence: `src/components/ProductCard.tsx`)
- Add product → Typed Redux hooks: uses (evidence: `src/pages/AddNewProduct.tsx`)
- Add product → Product state and actions: dispatches (evidence: `src/pages/AddNewProduct.tsx`)
- Add product → Product form: renders (evidence: `src/pages/AddNewProduct.tsx`)
- Edit product → Typed Redux hooks: uses (evidence: `src/pages/EditProduct.tsx`)
- Edit product → Product state and actions: dispatches (evidence: `src/pages/EditProduct.tsx`)
- Edit product → Product form: renders (evidence: `src/pages/EditProduct.tsx`)
- Edit product → Loading indicator: renders (evidence: `src/pages/EditProduct.tsx`)
- Typed Redux hooks → Redux store: selects and dispatches (evidence: `src/hooks/hook.ts`)
- Redux store → Product state and actions: registers reducer (evidence: `src/store/store.ts`)
- Product state and actions → Product API helpers: calls (evidence: `src/store/productSlice.ts`)
