# mehedilabs/bazar-dor architecture

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

- Interactive diagram: https://gitdiagram.com/mehedilabs/bazar-dor
- Repository: https://github.com/mehedilabs/bazar-dor

## Overview

BazarDor is a Bangladesh market-price browsing app with a parallel account-management capability. The main browse flow loads product data from the configured REST API, presents it on the homepage or category pages, and lets users open market-level product details; authentication supports registration, social sign-in, and profile updates. The graph includes documented ticker, trend, and category-navigation features. Some relationships for unsampled sign-in and layout components are based on README descriptions and the source index, not inspected implementation details.

Main entry points: [`src/lib/api.ts`](https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/api.ts) (Market API client), [`src/lib/auth-client.ts`](https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/auth-client.ts) (Auth client), [`src/app/page.tsx`](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/page.tsx) (Home route), [`src/lib/auth.ts`](https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/auth.ts) (Auth configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browse["Price browsing"]
  node_home["Home route<br/>[page.tsx]"]
  node_category["Category route<br/>[page.tsx]"]
  node_detailroute["Product route<br/>[page.tsx]"]
  node_api["Market API client<br/>[api.ts]"]
  node_types["Product data model<br/>[product.ts]"]
  node_utils["Price utilities<br/>[utils.ts]"]
end

subgraph group_presentation["Market presentation"]
  node_hero["Hero section<br/>[Hero.tsx]"]
  node_sections["Trend sections"]
  node_categoryproducts["Category products"]
  node_card["Product card<br/>[ProductCard.tsx]"]
  node_details["Price details<br/>[ProductDetails.tsx]"]
  node_ticker["Price ticker<br/>[PriceTicker.tsx]"]
  node_tickerloader["Ticker loader"]
  node_categorynav["Category navigation<br/>[CategoryNav.tsx]"]
  node_categoryloader["Category loader"]
  node_header["Site header<br/>[Header.tsx]"]
  node_footer["Market footer<br/>[Footer.tsx]"]
end

subgraph group_identity["Accounts"]
  node_userinfo["User information<br/>[Userinfo.tsx]"]
  node_signin["Sign-in page<br/>[page.tsx]"]
  node_signup["Sign-up page<br/>[page.tsx]"]
  node_profile["Profile page<br/>[page.tsx]"]
  node_oauthnotice["OAuth feedback"]
  node_authclient["Auth client<br/>[auth-client.ts]"]
end

subgraph group_runtime["Application runtime"]
  node_authroute["Auth endpoint<br/>[route.ts]"]
  node_authconfig["Auth configuration<br/>[auth.ts]"]
  node_proxy["Route proxy<br/>[proxy.ts]"]
end

node_visitor(("Visitor"))
node_marketapi(("BazarDor REST API"))
node_mongodb[("MongoDB")]
node_provider(("Google / GitHub"))

node_visitor -->|"opens"| node_home
node_home -->|"loads products"| node_api
node_api -->|"fetches data"| node_marketapi
node_home -->|"renders"| node_hero
node_home -->|"renders products"| node_sections
node_sections -->|"renders cards"| node_card
node_visitor -->|"browses category"| node_category
node_category -->|"loads category data"| node_api
node_category -->|"renders listings"| node_categoryproducts
node_categoryproducts -->|"renders cards"| node_card
node_visitor -->|"opens product"| node_detailroute
node_detailroute -->|"loads product"| node_api
node_detailroute -->|"renders details"| node_details
node_tickerloader -->|"loads prices"| node_api
node_tickerloader -->|"renders ticker"| node_ticker
node_categoryloader -->|"loads categories"| node_api
node_categoryloader -->|"renders navigation"| node_categorynav
node_header -->|"renders account"| node_userinfo
node_visitor -->|"signs in"| node_signin
node_visitor -->|"registers"| node_signup
node_signup -->|"submits credentials"| node_authclient
node_signin -->|"authenticates"| node_authclient
node_profile -->|"manages session"| node_authclient
node_userinfo -->|"reads account"| node_authclient
node_oauthnotice -->|"checks session"| node_authclient
node_authclient -.->|"calls auth service"| node_authroute
node_authroute -->|"dispatches requests"| node_authconfig
node_authconfig -->|"stores auth data"| node_mongodb
node_authconfig -->|"configures OAuth"| node_provider
node_proxy -->|"checks access"| node_authconfig
node_api -->|"uses product types"| node_types
node_details -->|"formats prices"| node_utils
node_categoryproducts -->|"sorts prices"| node_utils
node_footer -.->|"shows disclaimer"| node_visitor

click node_home "https://github.com/mehedilabs/bazar-dor/blob/main/src/app/page.tsx"
click node_category "https://github.com/mehedilabs/bazar-dor/blob/main/src/app/category/%5Bslug%5D/page.tsx"
click node_detailroute "https://github.com/mehedilabs/bazar-dor/blob/main/src/app/product/%5Bslug%5D/page.tsx"
click node_api "https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/api.ts"
click node_hero "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/home/Hero.tsx"
click node_sections "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/home/ProductSections.tsx"
click node_categoryproducts "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/category/CategoryProducts.tsx"
click node_card "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/product/ProductCard.tsx"
click node_details "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/product/ProductDetails.tsx"
click node_ticker "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/PriceTicker.tsx"
click node_tickerloader "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/PriceTickerLoader.tsx"
click node_categorynav "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/CategoryNav.tsx"
click node_categoryloader "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/CategoryNavLoader.tsx"
click node_header "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/Header.tsx"
click node_userinfo "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/Userinfo.tsx"
click node_signin "https://github.com/mehedilabs/bazar-dor/blob/main/src/app/signin/page.tsx"
click node_signup "https://github.com/mehedilabs/bazar-dor/blob/main/src/app/signup/page.tsx"
click node_profile "https://github.com/mehedilabs/bazar-dor/blob/main/src/app/profile/page.tsx"
click node_oauthnotice "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/auth/OAuthSuccessToast.tsx"
click node_authclient "https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/auth-client.ts"
click node_authroute "https://github.com/mehedilabs/bazar-dor/blob/main/src/app/api/auth/%5B...all%5D/route.ts"
click node_authconfig "https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/auth.ts"
click node_proxy "https://github.com/mehedilabs/bazar-dor/blob/main/src/proxy.ts"
click node_types "https://github.com/mehedilabs/bazar-dor/blob/main/src/types/product.ts"
click node_utils "https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/utils.ts"
click node_footer "https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/Footer.tsx"

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,node_detailroute,node_api,node_types,node_utils toneBlue
class node_hero,node_sections,node_categoryproducts,node_card,node_details,node_ticker,node_tickerloader,node_categorynav,node_categoryloader,node_header,node_footer,node_mongodb toneAmber
class node_userinfo,node_signin,node_signup,node_profile,node_oauthnotice,node_authclient,node_marketapi toneMint
class node_authroute,node_authconfig,node_proxy toneRose
class node_visitor,node_provider toneIndigo
```

## Components

### Price browsing

- [Home route](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Category route](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/category/%5Bslug%5D/page.tsx): `src/app/category/[slug]/page.tsx`
- [Product route](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/product/%5Bslug%5D/page.tsx): `src/app/product/[slug]/page.tsx`
- [Market API client](https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Product data model](https://github.com/mehedilabs/bazar-dor/blob/main/src/types/product.ts): `src/types/product.ts`
- [Price utilities](https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/utils.ts): `src/lib/utils.ts`

### Market presentation

- [Hero section](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/home/Hero.tsx): `src/components/home/Hero.tsx`
- [Trend sections](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/home/ProductSections.tsx): `src/components/home/ProductSections.tsx`
- [Category products](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/category/CategoryProducts.tsx): `src/components/category/CategoryProducts.tsx`
- [Product card](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/product/ProductCard.tsx): `src/components/product/ProductCard.tsx`
- [Price details](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/product/ProductDetails.tsx): `src/components/product/ProductDetails.tsx`
- [Price ticker](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/PriceTicker.tsx): `src/components/layout/PriceTicker.tsx`
- [Ticker loader](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/PriceTickerLoader.tsx): `src/components/layout/PriceTickerLoader.tsx`
- [Category navigation](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/CategoryNav.tsx): `src/components/layout/CategoryNav.tsx`
- [Category loader](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/CategoryNavLoader.tsx): `src/components/layout/CategoryNavLoader.tsx`
- [Site header](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/Header.tsx): `src/components/layout/Header.tsx`
- [Market footer](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/layout/Footer.tsx): `src/components/layout/Footer.tsx`

### Accounts

- [User information](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/Userinfo.tsx): `src/components/Userinfo.tsx`
- [Sign-in page](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/signin/page.tsx): `src/app/signin/page.tsx`
- [Sign-up page](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/signup/page.tsx): `src/app/signup/page.tsx`
- [Profile page](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [OAuth feedback](https://github.com/mehedilabs/bazar-dor/blob/main/src/components/auth/OAuthSuccessToast.tsx): `src/components/auth/OAuthSuccessToast.tsx`
- [Auth client](https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`

### Application runtime

- [Auth endpoint](https://github.com/mehedilabs/bazar-dor/blob/main/src/app/api/auth/%5B...all%5D/route.ts): `src/app/api/auth/[...all]/route.ts`
- [Auth configuration](https://github.com/mehedilabs/bazar-dor/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Route proxy](https://github.com/mehedilabs/bazar-dor/blob/main/src/proxy.ts): `src/proxy.ts`

### Other components

- **Visitor**
- **BazarDor REST API**
- **MongoDB**
- **Google / GitHub**

## Connections

- Visitor → Home route: opens (evidence: `README.md`)
- Home route → Market API client: loads products (evidence: `src/app/page.tsx`)
- Market API client → BazarDor REST API: fetches data (evidence: `src/lib/api.ts`)
- Home route → Hero section: renders (evidence: `src/app/page.tsx`)
- Home route → Trend sections: renders products (evidence: `src/app/page.tsx`)
- Trend sections → Product card: renders cards (evidence: `src/components/home/ProductSections.tsx`)
- Visitor → Category route: browses category (evidence: `README.md`)
- Category route → Market API client: loads category data (evidence: `src/app/category/[slug]/page.tsx`)
- Category route → Category products: renders listings (evidence: `src/app/category/[slug]/page.tsx`)
- Category products → Product card: renders cards (evidence: `src/components/category/CategoryProducts.tsx`)
- Visitor → Product route: opens product (evidence: `README.md`)
- Product route → Market API client: loads product (evidence: `src/app/product/[slug]/page.tsx`)
- Product route → Price details: renders details (evidence: `src/app/product/[slug]/page.tsx`)
- Ticker loader → Market API client: loads prices (evidence: `src/components/layout/PriceTickerLoader.tsx`)
- Ticker loader → Price ticker: renders ticker (evidence: `src/components/layout/PriceTickerLoader.tsx`)
- Category loader → Market API client: loads categories (evidence: `src/components/layout/CategoryNavLoader.tsx`)
- Category loader → Category navigation: renders navigation (evidence: `src/components/layout/CategoryNavLoader.tsx`)
- Site header → User information: renders account (evidence: `src/components/layout/Header.tsx`)
- Visitor → Sign-in page: signs in (evidence: `README.md`)
- Visitor → Sign-up page: registers (evidence: `README.md`)
- Sign-up page → Auth client: submits credentials (evidence: `src/app/signup/page.tsx`)
- Sign-in page → Auth client: authenticates (evidence: `src/app/signin/page.tsx`)
- Profile page → Auth client: manages session (evidence: `src/app/profile/page.tsx`)
- User information → Auth client: reads account (evidence: `src/components/Userinfo.tsx`)
- OAuth feedback → Auth client: checks session (evidence: `src/components/auth/OAuthSuccessToast.tsx`)
- Auth client → Auth endpoint: calls auth service
- Auth endpoint → Auth configuration: dispatches requests (evidence: `src/app/api/auth/[...all]/route.ts`)
- Auth configuration → MongoDB: stores auth data (evidence: `src/lib/auth.ts`)
- Auth configuration → Google / GitHub: configures OAuth (evidence: `src/lib/auth.ts`)
- Route proxy → Auth configuration: checks access (evidence: `src/proxy.ts`)
- Market API client → Product data model: uses product types (evidence: `src/lib/api.ts`)
- Price details → Price utilities: formats prices (evidence: `src/components/product/ProductDetails.tsx`)
- Category products → Price utilities: sorts prices (evidence: `src/components/category/CategoryProducts.tsx`)
- Market footer → Visitor: shows disclaimer (evidence: `README.md`)
