# bhargavramanamarchi/supply-market architecture

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

- Interactive diagram: https://gitdiagram.com/bhargavramanamarchi/supply-market
- Repository: https://github.com/bhargavramanamarchi/supply-market

## Overview

Supply Market is a B2B procurement platform: buyers submit sourcing needs in natural language or voice, receive AI-assisted supplier matches and explanations, then follow or connect with suppliers; sellers maintain profiles and product inventory. The frontend also supports authentication, seller and buyer dashboards, multilingual conversations, and voice output. The README documents Supabase as the managed auth and database backend. Some service wiring is supported only by the source index or README, so those edges cite that evidence rather than implying unsampled implementation details.

Main entry points: [`frontend/src/pages/BuyerPage.tsx`](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/BuyerPage.tsx) (Buyer Workspace), [`frontend/src/App.tsx`](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/App.tsx) (App Routing), [`frontend/src/pages/SellerPage.tsx`](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/SellerPage.tsx) (Seller Workspace), [`frontend/src/services/supabase.ts`](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/supabase.ts) (Supabase Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app_routes["App Routing<br/>[App.tsx]"]
end

subgraph group_procurement["Buyer Procurement"]
  node_buyer_page["Buyer Workspace<br/>[BuyerPage.tsx]"]
  node_ai_matching["AI Matching<br/>[geminiService.ts]"]
  node_supplier_catalog["Supplier Catalog<br/>[supplierData.ts]"]
  node_assistant["Procurement Assistant"]
  node_call_experience["AI Call Experience"]
  node_speech["Speech Services<br/>[speechService.ts]"]
  node_murf["Murf Voice<br/>[murfService.ts]"]
end

subgraph group_supplier["Supplier Operations"]
  node_seller_page["Seller Workspace<br/>[SellerPage.tsx]"]
  node_user_dashboard["User Dashboard<br/>[UserDashboard.tsx]"]
end

subgraph group_platform["Shared Services"]
  node_auth_context["Authentication<br/>[AuthContext.tsx]"]
  node_protected_route["Route Protection<br/>[ProtectedRoute.tsx]"]
  node_auth_hook["Auth Hook<br/>[useAuth.ts]"]
  node_supabase_client["Supabase Client<br/>[supabase.ts]"]
  node_database[("Postgres Data<br/>[schema.sql]")]
  node_language["Language Context"]
  node_translations["Translations<br/>[localization.ts]"]
  node_notifications["Notifications"]
end

node_buyer(("Buyer"))
node_whatsapp["WhatsApp"]

node_buyer -->|"opens platform"| node_app_routes
node_app_routes -->|"routes buyers"| node_buyer_page
node_app_routes -->|"routes sellers"| node_seller_page
node_app_routes -->|"routes users"| node_user_dashboard
node_app_routes -->|"guards routes"| node_protected_route
node_buyer_page -->|"analyzes needs"| node_ai_matching
node_buyer_page -->|"loads directory"| node_supplier_catalog
node_ai_matching -->|"loads suppliers"| node_supplier_catalog
node_ai_matching -->|"queries suppliers"| node_supabase_client
node_buyer_page -->|"opens assistant"| node_assistant
node_buyer_page -->|"opens call flow"| node_call_experience
node_assistant -->|"requests AI help"| node_ai_matching
node_assistant -->|"uses supplier data"| node_supplier_catalog
node_buyer_page -->|"captures voice"| node_speech
node_seller_page -->|"uses voice input"| node_speech
node_speech -->|"requests voice output"| node_murf
node_seller_page -->|"manages inventory"| node_supabase_client
node_seller_page -->|"loads fallback data"| node_supplier_catalog
node_user_dashboard -->|"reads account data"| node_supabase_client
node_auth_context -->|"authenticates users"| node_supabase_client
node_auth_context -->|"stores profiles and follows"| node_database
node_supabase_client -->|"accesses records"| node_database
node_protected_route -->|"checks session"| node_auth_hook
node_auth_hook -->|"reads auth state"| node_auth_context
node_language -->|"loads translations"| node_translations
node_buyer_page -->|"uses notifications"| node_notifications
node_seller_page -.->|"uses notifications"| node_notifications
node_buyer_page -.->|"offers contact"| node_whatsapp

click node_app_routes "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/App.tsx"
click node_buyer_page "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/BuyerPage.tsx"
click node_ai_matching "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/geminiService.ts"
click node_supplier_catalog "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/supplierData.ts"
click node_assistant "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/components/ConversationalAssistant.tsx"
click node_call_experience "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/components/AICallExperience.tsx"
click node_speech "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/speechService.ts"
click node_murf "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/murfService.ts"
click node_seller_page "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/SellerPage.tsx"
click node_user_dashboard "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/UserDashboard.tsx"
click node_auth_context "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/context/AuthContext.tsx"
click node_protected_route "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/components/ProtectedRoute.tsx"
click node_auth_hook "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/hooks/useAuth.ts"
click node_supabase_client "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/supabase.ts"
click node_database "https://github.com/bhargavramanamarchi/supply-market/blob/main/supabase/schema.sql"
click node_language "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/context/LanguageContext.tsx"
click node_translations "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/localization.ts"
click node_notifications "https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/notificationService.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_routes toneBlue
class node_buyer_page,node_ai_matching,node_supplier_catalog,node_assistant,node_call_experience,node_speech,node_murf toneAmber
class node_seller_page,node_user_dashboard toneMint
class node_auth_context,node_protected_route,node_auth_hook,node_supabase_client,node_database,node_language,node_translations,node_notifications toneRose
class node_buyer,node_whatsapp toneIndigo
```

## Components

### Application

- [App Routing](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Buyer Procurement

- [Buyer Workspace](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/BuyerPage.tsx): `frontend/src/pages/BuyerPage.tsx`
- [AI Matching](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/geminiService.ts): `frontend/src/services/geminiService.ts`
- [Supplier Catalog](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/supplierData.ts): `frontend/src/services/supplierData.ts`
- [Procurement Assistant](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/components/ConversationalAssistant.tsx): `frontend/src/components/ConversationalAssistant.tsx`
- [AI Call Experience](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/components/AICallExperience.tsx): `frontend/src/components/AICallExperience.tsx`
- [Speech Services](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/speechService.ts): `frontend/src/services/speechService.ts`
- [Murf Voice](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/murfService.ts): `frontend/src/services/murfService.ts`

### Supplier Operations

- [Seller Workspace](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/SellerPage.tsx): `frontend/src/pages/SellerPage.tsx`
- [User Dashboard](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/pages/UserDashboard.tsx): `frontend/src/pages/UserDashboard.tsx`

### Shared Services

- [Authentication](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Route Protection](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/components/ProtectedRoute.tsx): `frontend/src/components/ProtectedRoute.tsx`
- [Auth Hook](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/hooks/useAuth.ts): `frontend/src/hooks/useAuth.ts`
- [Supabase Client](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/supabase.ts): `frontend/src/services/supabase.ts`
- [Postgres Data](https://github.com/bhargavramanamarchi/supply-market/blob/main/supabase/schema.sql): `supabase/schema.sql`
- [Language Context](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/context/LanguageContext.tsx): `frontend/src/context/LanguageContext.tsx`
- [Translations](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/localization.ts): `frontend/src/services/localization.ts`
- [Notifications](https://github.com/bhargavramanamarchi/supply-market/blob/main/frontend/src/services/notificationService.ts): `frontend/src/services/notificationService.ts`

### Other components

- **Buyer**
- **WhatsApp**

## Connections

- Buyer → App Routing: opens platform (evidence: `README.md`)
- App Routing → Buyer Workspace: routes buyers (evidence: `frontend/src/App.tsx`)
- App Routing → Seller Workspace: routes sellers (evidence: `frontend/src/App.tsx`)
- App Routing → User Dashboard: routes users (evidence: `frontend/src/App.tsx`)
- App Routing → Route Protection: guards routes (evidence: `frontend/src/App.tsx`)
- Buyer Workspace → AI Matching: analyzes needs (evidence: `frontend/src/pages/BuyerPage.tsx`)
- Buyer Workspace → Supplier Catalog: loads directory (evidence: `frontend/src/pages/BuyerPage.tsx`)
- AI Matching → Supplier Catalog: loads suppliers (evidence: `frontend/src/services/geminiService.ts`)
- AI Matching → Supabase Client: queries suppliers (evidence: `frontend/src/services/geminiService.ts`)
- Buyer Workspace → Procurement Assistant: opens assistant (evidence: `frontend/src/pages/BuyerPage.tsx`)
- Buyer Workspace → AI Call Experience: opens call flow (evidence: `frontend/src/pages/BuyerPage.tsx`)
- Procurement Assistant → AI Matching: requests AI help (evidence: `frontend/src/components/ConversationalAssistant.tsx`)
- Procurement Assistant → Supplier Catalog: uses supplier data (evidence: `frontend/src/components/ConversationalAssistant.tsx`)
- Buyer Workspace → Speech Services: captures voice (evidence: `frontend/src/pages/BuyerPage.tsx`)
- Seller Workspace → Speech Services: uses voice input (evidence: `frontend/src/pages/SellerPage.tsx`)
- Speech Services → Murf Voice: requests voice output (evidence: `frontend/src/services/speechService.ts`)
- Seller Workspace → Supabase Client: manages inventory (evidence: `frontend/src/pages/SellerPage.tsx`)
- Seller Workspace → Supplier Catalog: loads fallback data (evidence: `frontend/src/pages/SellerPage.tsx`)
- User Dashboard → Supabase Client: reads account data (evidence: `frontend/src/pages/UserDashboard.tsx`)
- Authentication → Supabase Client: authenticates users (evidence: `frontend/src/context/AuthContext.tsx`)
- Authentication → Postgres Data: stores profiles and follows (evidence: `README.md`)
- Supabase Client → Postgres Data: accesses records (evidence: `README.md`)
- Route Protection → Auth Hook: checks session (evidence: `frontend/src/components/ProtectedRoute.tsx`)
- Auth Hook → Authentication: reads auth state (evidence: `frontend/src/hooks/useAuth.ts`)
- Language Context → Translations: loads translations (evidence: `frontend/src/context/LanguageContext.tsx`)
- Buyer Workspace → Notifications: uses notifications (evidence: `frontend/src/pages/BuyerPage.tsx`)
- Seller Workspace → Notifications: uses notifications
- Buyer Workspace → WhatsApp: offers contact (evidence: `README.md`)
