# vaibhavk73/product-catalogue architecture

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

- Interactive diagram: https://gitdiagram.com/vaibhavk73/product-catalogue
- Repository: https://github.com/vaibhavk73/product-catalogue

## Overview

Collective is a full-stack product catalogue. Customers browse featured products, categories, search results and product details through the React client; the client’s API service sends catalogue requests to the Express backend, which retrieves product data from Fake Store API. Customers can also submit enquiries: the backend validates and rate-limits them before sending email through SMTP, after which the client displays confirmation. The graph preserves documented capabilities, but several page and routing implementations were not sampled, so uncertain links are omitted or dashed.

Main entry points: [`server/src/app.ts`](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/app.ts) (API routes), [`client/src/services/api.ts`](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/services/api.ts) (API client), [`client/src/pages/EnquiryPage.tsx`](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/pages/EnquiryPage.tsx) (Enquiry form), [`server/src/integrations/product-provider.ts`](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/integrations/product-provider.ts) (Product provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer client"]
  node_app["Client shell<br/>[App.tsx]"]
  node_category["Category browse<br/>[CategoryPage.tsx]"]
  node_card["Product card<br/>[ProductCard.tsx]"]
  node_details["Product details<br/>[ProductDetails.tsx]"]
  node_enquiry["Enquiry form<br/>[EnquiryPage.tsx]"]
  node_client_api["API client<br/>[api.ts]"]
end

subgraph group_backend["Catalogue API"]
  node_server["HTTP server<br/>[index.ts]"]
  node_api["API routes<br/>[app.ts]"]
end

subgraph group_integrations["External integrations"]
  node_product_provider["Product provider"]
  node_email_provider["Email provider<br/>[email-provider.ts]"]
end

subgraph group_external["External systems"]
  node_fake_store["Fake Store API"]
  node_smtp["SMTP service"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_app
node_customer -->|"submits enquiry"| node_enquiry
node_enquiry -->|"submits data"| node_client_api
node_details -->|"fetches product"| node_client_api
node_category -.->|"requests catalogue"| node_client_api
node_client_api -->|"HTTP requests"| node_api
node_server -->|"starts"| node_api
node_api -->|"calls"| node_product_provider
node_api -->|"sends enquiry"| node_email_provider
node_product_provider -->|"fetches products"| node_fake_store
node_email_provider -->|"sends email"| node_smtp

click node_app "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/App.tsx"
click node_category "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/pages/CategoryPage.tsx"
click node_card "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/components/ProductCard.tsx"
click node_details "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/pages/ProductDetails.tsx"
click node_enquiry "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/pages/EnquiryPage.tsx"
click node_client_api "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/services/api.ts"
click node_server "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/index.ts"
click node_api "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/app.ts"
click node_product_provider "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/integrations/product-provider.ts"
click node_email_provider "https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/integrations/email-provider.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_app,node_category,node_card,node_details,node_enquiry,node_client_api toneBlue
class node_server,node_api toneAmber
class node_product_provider,node_email_provider toneMint
class node_fake_store,node_smtp toneRose
class node_customer toneIndigo
```

## Components

### Customer client

- [Client shell](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/App.tsx): `client/src/App.tsx`
- [Category browse](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/pages/CategoryPage.tsx): `client/src/pages/CategoryPage.tsx`
- [Product card](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/components/ProductCard.tsx): `client/src/components/ProductCard.tsx`
- [Product details](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/pages/ProductDetails.tsx): `client/src/pages/ProductDetails.tsx`
- [Enquiry form](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/pages/EnquiryPage.tsx): `client/src/pages/EnquiryPage.tsx`
- [API client](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/client/src/services/api.ts): `client/src/services/api.ts`

### Catalogue API

- [HTTP server](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/index.ts): `server/src/index.ts`
- [API routes](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/app.ts): `server/src/app.ts`

### External integrations

- [Product provider](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/integrations/product-provider.ts): `server/src/integrations/product-provider.ts`
- [Email provider](https://github.com/vaibhavk73/product-catalogue/blob/feature/product-catalogue/server/src/integrations/email-provider.ts): `server/src/integrations/email-provider.ts`

### External systems

- **Fake Store API**
- **SMTP service**

### Other components

- **Customer**

## Connections

- Customer → Client shell: browses (evidence: `README.md`)
- Customer → Enquiry form: submits enquiry (evidence: `README.md`)
- Enquiry form → API client: submits data (evidence: `client/src/pages/EnquiryPage.tsx`)
- Product details → API client: fetches product (evidence: `client/src/pages/ProductDetails.tsx`)
- Category browse → API client: requests catalogue
- API client → API routes: HTTP requests (evidence: `README.md`)
- HTTP server → API routes: starts (evidence: `server/src/index.ts`)
- API routes → Product provider: calls (evidence: `server/src/app.ts`)
- API routes → Email provider: sends enquiry (evidence: `server/src/app.ts`)
- Product provider → Fake Store API: fetches products (evidence: `server/src/integrations/product-provider.ts`)
- Email provider → SMTP service: sends email (evidence: `server/src/integrations/email-provider.ts`)
