# mahmudulhasanmaruf78/b14-a7-bazar-dor architecture

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

- Interactive diagram: https://gitdiagram.com/mahmudulhasanmaruf78/b14-a7-bazar-dor
- Repository: https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor

## Overview

BazarDor is a Bengali-language market-price application. The main visitor flow loads product and category data for the home page, presents price movement and a searchable, sortable catalog, then routes product selections to market-level details; category pages provide a separate browse path. Authentication supports protected details, email/social sign-in, and profile updates. Edges are limited to calls and page composition shown in excerpts or the README; several page and authentication links are documented rather than source-sampled.

Main entry points: [`src/app/page.tsx`](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/page.tsx) (Home page), [`src/lib/api.ts`](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/api.ts) (Price API client), [`src/lib/auth.ts`](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/auth.ts) (BetterAuth server), [`src/components/ProductCard.tsx`](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/ProductCard.tsx) (Product cards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market_data["Market data"]
  node_api["Price API client<br/>[api.ts]"]
  node_price_service{{"Market price service"}}
end

subgraph group_browse["Price browsing"]
  node_home["Home page<br/>[page.tsx]"]
  node_ticker["Price ticker<br/>[PriceTicker.tsx]"]
  node_hero["Hero banner<br/>[Hero.tsx]"]
  node_catalog["Search and sort"]
  node_sort["Sort controls<br/>[SortDropdown.tsx]"]
  node_product_card["Product cards<br/>[ProductCard.tsx]"]
  node_category_page["Category page<br/>[page.tsx]"]
  node_category_view["Category results<br/>[CategoryView.tsx]"]
end

subgraph group_details["Product details"]
  node_product_page["Product page<br/>[page.tsx]"]
  node_product_detail["Market breakdown"]
end

subgraph group_identity["Accounts"]
  node_auth_context["Auth state<br/>[AuthContext.tsx]"]
  node_auth_client["Auth client<br/>[auth-client.ts]"]
  node_sign_in["Sign-in page<br/>[page.tsx]"]
  node_sign_up["Sign-up page<br/>[page.tsx]"]
  node_auth_route["Auth endpoint<br/>[route.ts]"]
  node_auth_service["BetterAuth server<br/>[auth.ts]"]
  node_mongo_client["MongoDB client<br/>[mongodb.ts]"]
  node_mongo_helper["Mongo helper<br/>[mongo-helper.ts]"]
  node_mongo_db[("MongoDB")]
  node_profile["Profile page<br/>[page.tsx]"]
  node_profile_update["Profile update<br/>[page.tsx]"]
end

node_visitor(("Visitor"))
node_google(("Google OAuth"))
node_github(("GitHub OAuth"))

node_visitor -->|"opens"| node_home
node_home -->|"loads prices"| node_api
node_api -->|"fetches data"| node_price_service
node_home -->|"renders"| node_ticker
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_catalog
node_home -->|"renders"| node_product_card
node_catalog -->|"renders"| node_product_card
node_catalog -->|"uses"| node_sort
node_ticker -->|"imports"| node_api
node_visitor -->|"browses"| node_category_page
node_category_page -->|"loads products"| node_api
node_category_page -->|"renders"| node_category_view
node_category_view -->|"uses data"| node_api
node_category_view -->|"renders"| node_product_card
node_product_card -->|"links to"| node_product_page
node_product_page -->|"loads product"| node_api
node_product_page -->|"renders"| node_product_detail
node_product_detail -->|"checks access"| node_auth_context
node_visitor -->|"signs in"| node_sign_in
node_visitor -->|"registers"| node_sign_up
node_sign_in -->|"calls"| node_auth_client
node_sign_up -->|"calls"| node_auth_client
node_auth_context -->|"calls"| node_auth_client
node_auth_client -.->|"requests"| node_auth_route
node_auth_route -->|"delegates"| node_auth_service
node_auth_service -->|"configures adapter"| node_mongo_client
node_mongo_client -->|"uses"| node_mongo_helper
node_mongo_client -.->|"connects"| node_mongo_db
node_auth_service -.->|"OAuth"| node_google
node_auth_service -.->|"OAuth"| node_github
node_visitor -->|"views"| node_profile
node_visitor -->|"updates"| node_profile_update
node_profile -->|"uses state"| node_auth_context
node_profile_update -->|"updates user"| node_auth_context

click node_home "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/page.tsx"
click node_api "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/api.ts"
click node_ticker "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/PriceTicker.tsx"
click node_hero "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/Hero.tsx"
click node_catalog "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/HomeProductList.tsx"
click node_sort "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/SortDropdown.tsx"
click node_product_card "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/ProductCard.tsx"
click node_category_page "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/category/%5Bslug%5D/page.tsx"
click node_category_view "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/category/%5Bslug%5D/CategoryView.tsx"
click node_product_page "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/product/%5Bslug%5D/page.tsx"
click node_product_detail "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/product/%5Bslug%5D/ProductDetailClient.tsx"
click node_auth_context "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/context/AuthContext.tsx"
click node_auth_client "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/auth-client.ts"
click node_sign_in "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/signin/page.tsx"
click node_sign_up "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/signup/page.tsx"
click node_auth_route "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/api/auth/%5B...all%5D/route.ts"
click node_auth_service "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/auth.ts"
click node_mongo_client "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/mongodb.ts"
click node_mongo_helper "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/mongo-helper.ts"
click node_profile "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/profile/page.tsx"
click node_profile_update "https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/profile/update/page.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_api,node_price_service toneBlue
class node_home,node_ticker,node_hero,node_catalog,node_sort,node_product_card,node_category_page,node_category_view toneAmber
class node_product_page,node_product_detail toneMint
class node_auth_context,node_auth_client,node_sign_in,node_sign_up,node_auth_route,node_auth_service,node_mongo_client,node_mongo_helper,node_mongo_db,node_profile,node_profile_update toneRose
class node_visitor,node_google,node_github toneIndigo
```

## Components

### Market data

- [Price API client](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/api.ts): `src/lib/api.ts`
- **Market price service**

### Price browsing

- [Home page](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Price ticker](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/PriceTicker.tsx): `src/components/PriceTicker.tsx`
- [Hero banner](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/Hero.tsx): `src/components/Hero.tsx`
- [Search and sort](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/HomeProductList.tsx): `src/components/HomeProductList.tsx`
- [Sort controls](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/SortDropdown.tsx): `src/components/SortDropdown.tsx`
- [Product cards](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`
- [Category page](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/category/%5Bslug%5D/page.tsx): `src/app/category/[slug]/page.tsx`
- [Category results](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/category/%5Bslug%5D/CategoryView.tsx): `src/app/category/[slug]/CategoryView.tsx`

### Product details

- [Product page](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/product/%5Bslug%5D/page.tsx): `src/app/product/[slug]/page.tsx`
- [Market breakdown](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/product/%5Bslug%5D/ProductDetailClient.tsx): `src/app/product/[slug]/ProductDetailClient.tsx`

### Accounts

- [Auth state](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Auth client](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`
- [Sign-in page](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/signin/page.tsx): `src/app/signin/page.tsx`
- [Sign-up page](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/signup/page.tsx): `src/app/signup/page.tsx`
- [Auth endpoint](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/api/auth/%5B...all%5D/route.ts): `src/app/api/auth/[...all]/route.ts`
- [BetterAuth server](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [MongoDB client](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/mongodb.ts): `src/lib/mongodb.ts`
- [Mongo helper](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/lib/mongo-helper.ts): `src/lib/mongo-helper.ts`
- **MongoDB**
- [Profile page](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Profile update](https://github.com/mahmudulhasanmaruf78/b14-a7-bazar-dor/blob/main/src/app/profile/update/page.tsx): `src/app/profile/update/page.tsx`

### Other components

- **Visitor**
- **Google OAuth**
- **GitHub OAuth**

## Connections

- Visitor → Home page: opens (evidence: `README.md`)
- Home page → Price API client: loads prices (evidence: `src/app/page.tsx`)
- Price API client → Market price service: fetches data (evidence: `src/lib/api.ts`)
- Home page → Price ticker: renders (evidence: `src/app/page.tsx`)
- Home page → Hero banner: renders (evidence: `src/app/page.tsx`)
- Home page → Search and sort: renders (evidence: `src/app/page.tsx`)
- Home page → Product cards: renders (evidence: `src/app/page.tsx`)
- Search and sort → Product cards: renders (evidence: `src/components/HomeProductList.tsx`)
- Search and sort → Sort controls: uses (evidence: `src/components/HomeProductList.tsx`)
- Price ticker → Price API client: imports (evidence: `src/components/PriceTicker.tsx`)
- Visitor → Category page: browses (evidence: `README.md`)
- Category page → Price API client: loads products (evidence: `src/app/category/[slug]/page.tsx`)
- Category page → Category results: renders (evidence: `src/app/category/[slug]/page.tsx`)
- Category results → Price API client: uses data (evidence: `src/app/category/[slug]/CategoryView.tsx`)
- Category results → Product cards: renders (evidence: `src/app/category/[slug]/CategoryView.tsx`)
- Product cards → Product page: links to (evidence: `src/components/ProductCard.tsx`)
- Product page → Price API client: loads product (evidence: `src/app/product/[slug]/page.tsx`)
- Product page → Market breakdown: renders (evidence: `src/app/product/[slug]/page.tsx`)
- Market breakdown → Auth state: checks access (evidence: `src/app/product/[slug]/ProductDetailClient.tsx`)
- Visitor → Sign-in page: signs in (evidence: `README.md`)
- Visitor → Sign-up page: registers (evidence: `README.md`)
- Sign-in page → Auth client: calls (evidence: `src/app/signin/page.tsx`)
- Sign-up page → Auth client: calls (evidence: `src/app/signup/page.tsx`)
- Auth state → Auth client: calls (evidence: `src/context/AuthContext.tsx`)
- Auth client → Auth endpoint: requests
- Auth endpoint → BetterAuth server: delegates (evidence: `src/app/api/auth/[...all]/route.ts`)
- BetterAuth server → MongoDB client: configures adapter (evidence: `src/lib/auth.ts`)
- MongoDB client → Mongo helper: uses (evidence: `src/lib/mongodb.ts`)
- MongoDB client → MongoDB: connects
- BetterAuth server → Google OAuth: OAuth (evidence: `src/lib/auth.ts`)
- BetterAuth server → GitHub OAuth: OAuth (evidence: `src/lib/auth.ts`)
- Visitor → Profile page: views (evidence: `README.md`)
- Visitor → Profile update: updates (evidence: `README.md`)
- Profile page → Auth state: uses state (evidence: `src/app/profile/page.tsx`)
- Profile update → Auth state: updates user (evidence: `src/app/profile/update/page.tsx`)
