# hariom0/rangoloshoe architecture

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

- Interactive diagram: https://gitdiagram.com/hariom0/rangoloshoe
- Repository: https://github.com/hariom0/rangoloshoe

## Overview

Rangolo Shoe is a footwear storefront with product browsing, size/stock-aware product details, cart and wishlist experiences, and an admin catalog. The customer path runs from the landing page into collections and product details, then into cart or WhatsApp purchase actions. Admins authenticate and manage catalog records and media through product APIs. Source evidence confirms several page compositions, product API dependencies, and admin client/API wiring; unsampled cart, wishlist, and integration internals are shown only where explicitly supported.

Main entry points: [`src/app/api/products/route.ts`](https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/products/route.ts) (Product endpoints), [`src/app/api/products/[id]/route.ts`](https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/products/%5Bid%5D/route.ts) (Product item endpoints), [`src/models/Footware.ts`](https://github.com/hariom0/rangoloshoe/blob/main/src/models/Footware.ts) (Footwear model), [`src/app/page.tsx`](https://github.com/hariom0/rangoloshoe/blob/main/src/app/page.tsx) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_landing["Home page<br/>[page.tsx]"]
  node_landing_sections["Landing sections"]
  node_cart_page["Cart page<br/>[page.tsx]"]
  node_cart_view["Cart experience<br/>[cartPage.tsx]"]
  node_wishlist_page["Wishlist page<br/>[page.tsx]"]
  node_wishlist_view["Wishlist experience<br/>[WishlistPage.tsx]"]
  node_whatsapp["WhatsApp purchase"]
end

subgraph group_catalog["Catalog browsing"]
  node_collections_page["Collections page<br/>[page.tsx]"]
  node_collection_grid["Collection grid<br/>[CollectionGrid.tsx]"]
  node_product_page["Product detail page<br/>[page.tsx]"]
  node_product_view["Product detail view"]
end

subgraph group_admin["Admin catalog"]
  node_login_page["Admin login<br/>[page.tsx]"]
  node_login_form["Login form<br/>[LoginForm.tsx]"]
  node_admin_page["Admin page<br/>[page.tsx]"]
  node_admin_grid["Product management<br/>[AdminGrid.tsx]"]
  node_admin_api_client["Admin API client<br/>[api.ts]"]
end

subgraph group_services["Data and services"]
  node_products_api["Product endpoints<br/>[route.ts]"]
  node_product_id_api["Product item endpoints<br/>[route.ts]"]
  node_stock_api["Stock summary<br/>[route.tsx]"]
  node_auth_config["Credentials auth<br/>[auth.ts]"]
  node_auth_route["Auth route<br/>[route.ts]"]
  node_seed_route["Seed endpoint<br/>[route.ts]"]
  node_seed_data["Seed catalog data<br/>[seed.ts]"]
  node_footware_model["Footwear model<br/>[Footware.ts]"]
  node_database[("MongoDB")]
  node_cloudinary[("Cloudinary media")]
  node_api_response["API responses<br/>[api-response.ts]"]
end

node_visitor(("Shopper"))
node_admin_actor(("Administrator"))

node_visitor -->|"opens"| node_landing
node_landing -->|"renders"| node_landing_sections
node_landing -.->|"links to"| node_collections_page
node_visitor -.->|"browses"| node_collections_page
node_collections_page -->|"renders"| node_collection_grid
node_collection_grid -.->|"opens item"| node_product_page
node_product_page -->|"renders"| node_product_view
node_product_view -->|"renders"| node_whatsapp
node_product_view -.->|"adds item"| node_cart_page
node_visitor -.->|"opens"| node_cart_page
node_cart_page -->|"renders"| node_cart_view
node_visitor -.->|"opens"| node_wishlist_page
node_wishlist_page -->|"renders"| node_wishlist_view
node_visitor -.->|"signs in"| node_login_page
node_login_page -->|"renders"| node_login_form
node_login_form -.->|"authenticates"| node_auth_config
node_admin_actor -.->|"manages catalog"| node_admin_page
node_admin_page -->|"renders"| node_admin_grid
node_admin_grid -->|"uses"| node_admin_api_client
node_admin_api_client -->|"requests products"| node_products_api
node_admin_api_client -->|"updates items"| node_product_id_api
node_products_api -->|"queries"| node_footware_model
node_product_id_api -->|"reads and writes"| node_footware_model
node_stock_api -->|"counts"| node_footware_model
node_products_api -->|"connects"| node_database
node_product_id_api -->|"connects"| node_database
node_stock_api -->|"connects"| node_database
node_seed_route -->|"invokes"| node_seed_data
node_seed_data -->|"inserts records"| node_footware_model
node_seed_data -->|"connects"| node_database
node_products_api -->|"uploads media"| node_cloudinary
node_product_id_api -->|"manages media"| node_cloudinary
node_auth_route -->|"exports handlers"| node_auth_config
node_products_api -.->|"checks access"| node_auth_config
node_products_api -->|"formats responses"| node_api_response
node_product_id_api -->|"formats responses"| node_api_response

click node_landing "https://github.com/hariom0/rangoloshoe/blob/main/src/app/page.tsx"
click node_landing_sections "https://github.com/hariom0/rangoloshoe/tree/main/src/app/components/landing"
click node_collections_page "https://github.com/hariom0/rangoloshoe/blob/main/src/app/collections/page.tsx"
click node_collection_grid "https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/collections/CollectionGrid.tsx"
click node_product_page "https://github.com/hariom0/rangoloshoe/blob/main/src/app/collections/%5Bslug%5D/page.tsx"
click node_product_view "https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/collections/ProductClientView.tsx"
click node_cart_page "https://github.com/hariom0/rangoloshoe/blob/main/src/app/cart/page.tsx"
click node_cart_view "https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/shared/cartPage.tsx"
click node_wishlist_page "https://github.com/hariom0/rangoloshoe/blob/main/src/app/wishlist/page.tsx"
click node_wishlist_view "https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/shared/WishlistPage.tsx"
click node_whatsapp "https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/shared/WhatsAppBuyButton.tsx"
click node_login_page "https://github.com/hariom0/rangoloshoe/blob/main/src/app/login/page.tsx"
click node_login_form "https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/admin/LoginForm.tsx"
click node_admin_page "https://github.com/hariom0/rangoloshoe/blob/main/src/app/admin/page.tsx"
click node_admin_grid "https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/admin/AdminGrid.tsx"
click node_admin_api_client "https://github.com/hariom0/rangoloshoe/blob/main/src/lib/admin/api.ts"
click node_products_api "https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/products/route.ts"
click node_product_id_api "https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/products/%5Bid%5D/route.ts"
click node_stock_api "https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/stocks/route.tsx"
click node_auth_config "https://github.com/hariom0/rangoloshoe/blob/main/src/auth.ts"
click node_auth_route "https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_seed_route "https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/seed/route.ts"
click node_seed_data "https://github.com/hariom0/rangoloshoe/blob/main/src/lib/seed.ts"
click node_footware_model "https://github.com/hariom0/rangoloshoe/blob/main/src/models/Footware.ts"
click node_api_response "https://github.com/hariom0/rangoloshoe/blob/main/src/lib/api-response.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_landing,node_landing_sections,node_cart_page,node_cart_view,node_wishlist_page,node_wishlist_view,node_whatsapp toneBlue
class node_collections_page,node_collection_grid,node_product_page,node_product_view toneAmber
class node_login_page,node_login_form,node_admin_page,node_admin_grid,node_admin_api_client toneMint
class node_products_api,node_product_id_api,node_stock_api,node_auth_config,node_auth_route,node_seed_route,node_seed_data,node_footware_model,node_database,node_cloudinary,node_api_response toneRose
class node_visitor,node_admin_actor toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/hariom0/rangoloshoe/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Landing sections](https://github.com/hariom0/rangoloshoe/tree/main/src/app/components/landing): `src/app/components/landing`
- [Cart page](https://github.com/hariom0/rangoloshoe/blob/main/src/app/cart/page.tsx): `src/app/cart/page.tsx`
- [Cart experience](https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/shared/cartPage.tsx): `src/app/components/shared/cartPage.tsx`
- [Wishlist page](https://github.com/hariom0/rangoloshoe/blob/main/src/app/wishlist/page.tsx): `src/app/wishlist/page.tsx`
- [Wishlist experience](https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/shared/WishlistPage.tsx): `src/app/components/shared/WishlistPage.tsx`
- [WhatsApp purchase](https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/shared/WhatsAppBuyButton.tsx): `src/app/components/shared/WhatsAppBuyButton.tsx`

### Catalog browsing

- [Collections page](https://github.com/hariom0/rangoloshoe/blob/main/src/app/collections/page.tsx): `src/app/collections/page.tsx`
- [Collection grid](https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/collections/CollectionGrid.tsx): `src/app/components/collections/CollectionGrid.tsx`
- [Product detail page](https://github.com/hariom0/rangoloshoe/blob/main/src/app/collections/%5Bslug%5D/page.tsx): `src/app/collections/[slug]/page.tsx`
- [Product detail view](https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/collections/ProductClientView.tsx): `src/app/components/collections/ProductClientView.tsx`

### Admin catalog

- [Admin login](https://github.com/hariom0/rangoloshoe/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Login form](https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/admin/LoginForm.tsx): `src/app/components/admin/LoginForm.tsx`
- [Admin page](https://github.com/hariom0/rangoloshoe/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Product management](https://github.com/hariom0/rangoloshoe/blob/main/src/app/components/admin/AdminGrid.tsx): `src/app/components/admin/AdminGrid.tsx`
- [Admin API client](https://github.com/hariom0/rangoloshoe/blob/main/src/lib/admin/api.ts): `src/lib/admin/api.ts`

### Data and services

- [Product endpoints](https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/products/route.ts): `src/app/api/products/route.ts`
- [Product item endpoints](https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/products/%5Bid%5D/route.ts): `src/app/api/products/[id]/route.ts`
- [Stock summary](https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/stocks/route.tsx): `src/app/api/stocks/route.tsx`
- [Credentials auth](https://github.com/hariom0/rangoloshoe/blob/main/src/auth.ts): `src/auth.ts`
- [Auth route](https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`
- [Seed endpoint](https://github.com/hariom0/rangoloshoe/blob/main/src/app/api/seed/route.ts): `src/app/api/seed/route.ts`
- [Seed catalog data](https://github.com/hariom0/rangoloshoe/blob/main/src/lib/seed.ts): `src/lib/seed.ts`
- [Footwear model](https://github.com/hariom0/rangoloshoe/blob/main/src/models/Footware.ts): `src/models/Footware.ts`
- **MongoDB**
- **Cloudinary media**
- [API responses](https://github.com/hariom0/rangoloshoe/blob/main/src/lib/api-response.ts): `src/lib/api-response.ts`

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Home page: opens
- Home page → Landing sections: renders (evidence: `src/app/page.tsx`)
- Home page → Collections page: links to
- Shopper → Collections page: browses
- Collections page → Collection grid: renders (evidence: `src/app/collections/page.tsx`)
- Collection grid → Product detail page: opens item
- Product detail page → Product detail view: renders (evidence: `src/app/collections/[slug]/page.tsx`)
- Product detail view → WhatsApp purchase: renders (evidence: `src/app/components/collections/ProductClientView.tsx`)
- Product detail view → Cart page: adds item
- Shopper → Cart page: opens
- Cart page → Cart experience: renders (evidence: `src/app/cart/page.tsx`)
- Shopper → Wishlist page: opens
- Wishlist page → Wishlist experience: renders (evidence: `src/app/wishlist/page.tsx`)
- Shopper → Admin login: signs in
- Admin login → Login form: renders (evidence: `src/app/login/page.tsx`)
- Login form → Credentials auth: authenticates
- Administrator → Admin page: manages catalog
- Admin page → Product management: renders (evidence: `src/app/admin/page.tsx`)
- Product management → Admin API client: uses (evidence: `src/app/components/admin/AdminGrid.tsx`)
- Admin API client → Product endpoints: requests products (evidence: `src/lib/admin/api.ts`)
- Admin API client → Product item endpoints: updates items (evidence: `src/lib/admin/api.ts`)
- Product endpoints → Footwear model: queries (evidence: `src/app/api/products/route.ts`)
- Product item endpoints → Footwear model: reads and writes (evidence: `src/app/api/products/[id]/route.ts`)
- Stock summary → Footwear model: counts (evidence: `src/app/api/stocks/route.tsx`)
- Product endpoints → MongoDB: connects (evidence: `src/app/api/products/route.ts`)
- Product item endpoints → MongoDB: connects (evidence: `src/app/api/products/[id]/route.ts`)
- Stock summary → MongoDB: connects (evidence: `src/app/api/stocks/route.tsx`)
- Seed endpoint → Seed catalog data: invokes (evidence: `src/app/api/seed/route.ts`)
- Seed catalog data → Footwear model: inserts records (evidence: `src/lib/seed.ts`)
- Seed catalog data → MongoDB: connects (evidence: `src/lib/seed.ts`)
- Product endpoints → Cloudinary media: uploads media (evidence: `src/app/api/products/route.ts`)
- Product item endpoints → Cloudinary media: manages media (evidence: `src/app/api/products/[id]/route.ts`)
- Auth route → Credentials auth: exports handlers (evidence: `src/app/api/auth/[...nextauth]/route.ts`)
- Product endpoints → Credentials auth: checks access
- Product endpoints → API responses: formats responses (evidence: `src/app/api/products/route.ts`)
- Product item endpoints → API responses: formats responses (evidence: `src/app/api/products/[id]/route.ts`)
