# rohanislambd/bazar-dor-nextjs-app architecture

> Architecture diagram of the GitHub repository rohanislambd/bazar-dor-nextjs-app, 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/rohanislambd/bazar-dor-nextjs-app
- Repository: https://github.com/rohanislambd/bazar-dor-nextjs-app

## Overview

Bazar-Dor is a Bengali grocery-price browsing app with account registration, sign-in, and profile access. The main browsing flow loads products for the home page, highlights price risers and fallers, and lets shoppers open a category or product detail. Authentication uses Better Auth with MongoDB persistence and Google/GitHub sign-in. The README is the default Next.js template and documents no additional product capabilities; relationships below are limited to source excerpts and indexed references.

Main entry points: [`src/types/type.ts`](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/types/type.ts) (Catalog Types), [`src/components/Products.tsx`](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Products.tsx) (Product Listings), [`src/lib/auth-client.ts`](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/lib/auth-client.ts) (Auth Client), [`src/app/category/[categoryId]/page.tsx`](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/category/%5BcategoryId%5D/page.tsx) (Category Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home Page<br/>[page.tsx]"]
  node_category_page["Category Page<br/>[page.tsx]"]
  node_product_page["Product Page<br/>[page.tsx]"]
  node_banner["Banner<br/>[Banner.tsx]"]
  node_site_layout["Site Layout<br/>[layout.tsx]"]
end

subgraph group_catalog["Price Catalog"]
  node_products["Product Listings<br/>[Products.tsx]"]
  node_category_sort["Category Sorting"]
  node_product_card["Product Card<br/>[ProductCard.tsx]"]
  node_detail_card["Product Detail Card"]
  node_category_header["Category Header<br/>[CategoryHeader.tsx]"]
end

subgraph group_identity["Accounts"]
  node_profile["Profile Page<br/>[page.tsx]"]
  node_signin["Sign In<br/>[page.tsx]"]
  node_signup["Sign Up<br/>[page.tsx]"]
  node_auth_route["Auth API Route<br/>[route.ts]"]
  node_auth_server["Auth Server<br/>[auth.ts]"]
  node_auth_client["Auth Client<br/>[auth-client.ts]"]
  node_user_info["User Info<br/>[UserInfo.tsx]"]
  node_redirect_toast["Auth Redirect Toast"]
end

subgraph group_shared["Shared UI"]
  node_header["Header<br/>[Header.tsx]"]
  node_navlinks["Navigation Links<br/>[Navlinks.tsx]"]
  node_category_links["Category Links<br/>[CategoryLinks.tsx]"]
  node_marquee["Marquee<br/>[Marquee.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_category_types["Catalog Types<br/>[type.ts]"]
  node_number_format["Bangla Number Formatter<br/>[common.ts]"]
end

node_shopper(("Shopper"))
node_mongo[("MongoDB")]
node_google["Google Sign-In"]
node_github["GitHub Sign-In"]

node_shopper -->|"browses"| node_home
node_shopper -->|"opens category"| node_category_page
node_shopper -->|"opens product"| node_product_page
node_shopper -->|"signs in"| node_signin
node_shopper -->|"registers"| node_signup
node_home -->|"renders"| node_banner
node_home -->|"renders"| node_products
node_products -->|"renders"| node_product_card
node_products -->|"uses types"| node_category_types
node_products -->|"formats counts"| node_number_format
node_products -->|"fetches prices"| node_shopper
node_category_page -->|"fetches category prices"| node_shopper
node_category_page -->|"renders"| node_category_header
node_category_page -->|"renders"| node_category_sort
node_category_sort -->|"renders"| node_product_card
node_category_sort -->|"formats values"| node_number_format
node_category_sort -->|"uses types"| node_category_types
node_product_page -->|"renders"| node_detail_card
node_product_page -->|"uses types"| node_category_types
node_product_card -->|"formats prices"| node_number_format
node_product_card -->|"uses types"| node_category_types
node_category_header -->|"formats values"| node_number_format
node_category_header -->|"uses types"| node_category_types
node_site_layout -->|"renders"| node_header
node_site_layout -->|"renders"| node_marquee
node_site_layout -->|"renders"| node_footer
node_header -->|"renders"| node_navlinks
node_header -->|"renders"| node_user_info
node_navlinks -->|"renders"| node_category_links
node_navlinks -->|"uses types"| node_category_types
node_category_links -->|"uses types"| node_category_types
node_signin -->|"calls"| node_auth_client
node_signin -->|"renders"| node_redirect_toast
node_signup -->|"calls"| node_auth_client
node_profile -->|"reads session"| node_auth_client
node_user_info -->|"reads session"| node_auth_client
node_auth_route -->|"dispatches"| node_auth_server
node_auth_server -->|"persists auth data"| node_mongo
node_auth_client -.->|"uses auth API"| node_auth_route
node_auth_server -->|"configures provider"| node_google
node_auth_server -->|"configures provider"| node_github

click node_home "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/page.tsx"
click node_category_page "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/category/%5BcategoryId%5D/page.tsx"
click node_product_page "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/products/%5BproductId%5D/page.tsx"
click node_profile "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/profile/page.tsx"
click node_signin "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/signin/page.tsx"
click node_signup "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/signup/page.tsx"
click node_auth_route "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/api/auth/%5B...all%5D/route.ts"
click node_auth_server "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/lib/auth.ts"
click node_auth_client "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/lib/auth-client.ts"
click node_products "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Products.tsx"
click node_category_sort "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/CategoryProductSorting.tsx"
click node_product_card "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/ProductCard.tsx"
click node_detail_card "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/ProductDetailCard.tsx"
click node_category_header "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/CategoryHeader.tsx"
click node_banner "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Banner.tsx"
click node_site_layout "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/layout.tsx"
click node_header "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Header.tsx"
click node_navlinks "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Navlinks.tsx"
click node_category_links "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/CategoryLinks.tsx"
click node_user_info "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/UserInfo.tsx"
click node_redirect_toast "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/AuthRedirectToast.tsx"
click node_marquee "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Marquee.tsx"
click node_footer "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Footer.tsx"
click node_category_types "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/types/type.ts"
click node_number_format "https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/shared/common.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_home,node_category_page,node_product_page,node_banner,node_site_layout toneBlue
class node_products,node_category_sort,node_product_card,node_detail_card,node_category_header,node_mongo toneAmber
class node_profile,node_signin,node_signup,node_auth_route,node_auth_server,node_auth_client,node_user_info,node_redirect_toast toneMint
class node_header,node_navlinks,node_category_links,node_marquee,node_footer,node_category_types,node_number_format toneRose
class node_shopper,node_google,node_github toneIndigo
```

## Components

### Storefront

- [Home Page](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Category Page](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/category/%5BcategoryId%5D/page.tsx): `src/app/category/[categoryId]/page.tsx`
- [Product Page](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/products/%5BproductId%5D/page.tsx): `src/app/products/[productId]/page.tsx`
- [Banner](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Banner.tsx): `src/components/Banner.tsx`
- [Site Layout](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/layout.tsx): `src/app/layout.tsx`

### Price Catalog

- [Product Listings](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Products.tsx): `src/components/Products.tsx`
- [Category Sorting](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/CategoryProductSorting.tsx): `src/components/CategoryProductSorting.tsx`
- [Product Card](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`
- [Product Detail Card](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/ProductDetailCard.tsx): `src/components/ProductDetailCard.tsx`
- [Category Header](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/CategoryHeader.tsx): `src/components/CategoryHeader.tsx`

### Accounts

- [Profile Page](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Sign In](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/signin/page.tsx): `src/app/signin/page.tsx`
- [Sign Up](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/signup/page.tsx): `src/app/signup/page.tsx`
- [Auth API Route](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/app/api/auth/%5B...all%5D/route.ts): `src/app/api/auth/[...all]/route.ts`
- [Auth Server](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Auth Client](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`
- [User Info](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/UserInfo.tsx): `src/components/UserInfo.tsx`
- [Auth Redirect Toast](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/AuthRedirectToast.tsx): `src/components/AuthRedirectToast.tsx`

### Shared UI

- [Header](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Navigation Links](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Navlinks.tsx): `src/components/Navlinks.tsx`
- [Category Links](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/CategoryLinks.tsx): `src/components/CategoryLinks.tsx`
- [Marquee](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Marquee.tsx): `src/components/Marquee.tsx`
- [Footer](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Catalog Types](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/types/type.ts): `src/types/type.ts`
- [Bangla Number Formatter](https://github.com/rohanislambd/bazar-dor-nextjs-app/blob/main/src/components/shared/common.ts): `src/components/shared/common.ts`

### Other components

- **Shopper**
- **MongoDB**
- **Google Sign-In**
- **GitHub Sign-In**

## Connections

- Shopper → Home Page: browses (evidence: `src/app/page.tsx`)
- Shopper → Category Page: opens category (evidence: `src/app/category/[categoryId]/page.tsx`)
- Shopper → Product Page: opens product (evidence: `src/app/products/[productId]/page.tsx`)
- Shopper → Sign In: signs in (evidence: `src/app/signin/page.tsx`)
- Shopper → Sign Up: registers (evidence: `src/app/signup/page.tsx`)
- Home Page → Banner: renders (evidence: `src/app/page.tsx`)
- Home Page → Product Listings: renders (evidence: `src/app/page.tsx`)
- Product Listings → Product Card: renders (evidence: `src/components/Products.tsx`)
- Product Listings → Catalog Types: uses types (evidence: `src/components/Products.tsx`)
- Product Listings → Bangla Number Formatter: formats counts (evidence: `src/components/Products.tsx`)
- Product Listings → Shopper: fetches prices (evidence: `src/components/Products.tsx`)
- Category Page → Shopper: fetches category prices (evidence: `src/app/category/[categoryId]/page.tsx`)
- Category Page → Category Header: renders (evidence: `src/app/category/[categoryId]/page.tsx`)
- Category Page → Category Sorting: renders (evidence: `src/app/category/[categoryId]/page.tsx`)
- Category Sorting → Product Card: renders (evidence: `src/components/CategoryProductSorting.tsx`)
- Category Sorting → Bangla Number Formatter: formats values (evidence: `src/components/CategoryProductSorting.tsx`)
- Category Sorting → Catalog Types: uses types (evidence: `src/components/CategoryProductSorting.tsx`)
- Product Page → Product Detail Card: renders (evidence: `src/app/products/[productId]/page.tsx`)
- Product Page → Catalog Types: uses types (evidence: `src/app/products/[productId]/page.tsx`)
- Product Card → Bangla Number Formatter: formats prices (evidence: `src/components/ProductCard.tsx`)
- Product Card → Catalog Types: uses types (evidence: `src/components/ProductCard.tsx`)
- Category Header → Bangla Number Formatter: formats values (evidence: `src/components/CategoryHeader.tsx`)
- Category Header → Catalog Types: uses types (evidence: `src/components/CategoryHeader.tsx`)
- Site Layout → Header: renders (evidence: `src/app/layout.tsx`)
- Site Layout → Marquee: renders (evidence: `src/app/layout.tsx`)
- Site Layout → Footer: renders (evidence: `src/app/layout.tsx`)
- Header → Navigation Links: renders (evidence: `src/components/Header.tsx`)
- Header → User Info: renders (evidence: `src/components/Header.tsx`)
- Navigation Links → Category Links: renders (evidence: `src/components/Navlinks.tsx`)
- Navigation Links → Catalog Types: uses types (evidence: `src/components/Navlinks.tsx`)
- Category Links → Catalog Types: uses types (evidence: `src/components/CategoryLinks.tsx`)
- Sign In → Auth Client: calls (evidence: `src/app/signin/page.tsx`)
- Sign In → Auth Redirect Toast: renders (evidence: `src/app/signin/page.tsx`)
- Sign Up → Auth Client: calls (evidence: `src/app/signup/page.tsx`)
- Profile Page → Auth Client: reads session (evidence: `src/app/profile/page.tsx`)
- User Info → Auth Client: reads session (evidence: `src/components/UserInfo.tsx`)
- Auth API Route → Auth Server: dispatches (evidence: `src/app/api/auth/[...all]/route.ts`)
- Auth Server → MongoDB: persists auth data (evidence: `src/lib/auth.ts`)
- Auth Client → Auth API Route: uses auth API
- Auth Server → Google Sign-In: configures provider (evidence: `src/lib/auth.ts`)
- Auth Server → GitHub Sign-In: configures provider (evidence: `src/lib/auth.ts`)
