# 24691a3188/shilpsetu architecture

> Architecture diagram of the GitHub repository 24691a3188/shilpsetu, 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/24691a3188/shilpsetu
- Repository: https://github.com/24691a3188/shilpsetu

## Overview

KalaMitra (ShilpSetu) is an artisan-focused marketplace and AI business-management platform. Artisans onboard, create enhanced product imagery and multilingual listings, calculate fair prices, and manage orders; buyers discover craft products, check out, track orders, or submit bulk enquiries; administrators govern verification, catalog quality, and AI settings. The graph includes the documented product branches, but several view-to-service and persistence links remain unverified because those source files were not excerpted.

Main entry points: [`src/App.tsx`](https://github.com/24691a3188/shilpsetu/blob/main/src/App.tsx) (Role-based app), [`src/context/CartContext.tsx`](https://github.com/24691a3188/shilpsetu/blob/main/src/context/CartContext.tsx) (Cart state), [`src/services/ai/visionService.ts`](https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/visionService.ts) (Image processing), [`src/services/ai/aiGateway.ts`](https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/aiGateway.ts) (AI gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and identity"]
  node_app["Role-based app<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
end

subgraph group_artisan["Artisan tools"]
  node_onboarding["Artisan onboarding"]
  node_ai_studio["Image studio"]
  node_voice_catalog["Voice cataloging"]
  node_pricing["Fair pricing"]
  node_artisan_dashboard["Artisan dashboard"]
  node_artisan_orders["Artisan orders"]
end

subgraph group_market["Marketplace and orders"]
  node_buyer_market["Product discovery"]
  node_product_details["Product details"]
  node_cart_context["Cart state<br/>[CartContext.tsx]"]
  node_checkout["Cart checkout"]
  node_buyer_orders["Buyer orders"]
  node_b2b["Bulk enquiries<br/>[B2BLinkageView.tsx]"]
end

subgraph group_governance["Admin governance"]
  node_admin_verify["Artisan verification"]
  node_admin_moderate["Catalog moderation"]
  node_admin_ai["AI gateway settings"]
end

subgraph group_services["AI and persistence"]
  node_b2b_matcher["Cluster matching<br/>[b2bMatcher.ts]"]
  node_ai_gateway["AI gateway<br/>[aiGateway.ts]"]
  node_vision["Image processing<br/>[visionService.ts]"]
  node_image_compose["Studio composition<br/>[imageProcessing.ts]"]
  node_pricing_service["Pricing engine<br/>[pricingService.ts]"]
  node_catalog_data["Craft catalog<br/>[craftCatalog.ts]"]
  node_orders_state["Order state<br/>[OrderContext.tsx]"]
  node_local_db[("Local data store<br/>[db.ts]")]
  node_supabase_client["Supabase client<br/>[client.ts]"]
  node_supabase_storage["Image storage<br/>[storage.ts]"]
end

node_artisan_actor(("Artisan"))
node_buyer_actor(("Buyer"))
node_admin_actor(("Administrator"))

node_artisan_actor -.->|"uses"| node_app
node_buyer_actor -.->|"uses"| node_app
node_admin_actor -.->|"uses"| node_app
node_app -->|"provides"| node_auth
node_app -->|"routes"| node_onboarding
node_app -->|"routes"| node_artisan_dashboard
node_app -.->|"routes"| node_buyer_market
node_app -.->|"routes"| node_admin_verify
node_ai_studio -.->|"processes images"| node_vision
node_vision -->|"composes image"| node_image_compose
node_vision -.->|"uses gateway"| node_ai_gateway
node_voice_catalog -.->|"uses gateway"| node_ai_gateway
node_pricing -.->|"calculates prices"| node_pricing_service
node_buyer_market -.->|"opens products"| node_product_details
node_product_details -.->|"adds to cart"| node_cart_context
node_checkout -.->|"reads cart"| node_cart_context
node_checkout -.->|"creates orders"| node_orders_state
node_artisan_orders -.->|"reads orders"| node_orders_state
node_buyer_orders -.->|"tracks orders"| node_orders_state
node_b2b -.->|"requests matches"| node_b2b_matcher
node_admin_ai -.->|"configures"| node_ai_gateway
node_cart_context -->|"persists cart"| node_local_db
node_cart_context -->|"uses products"| node_catalog_data
node_auth -->|"authenticates"| node_supabase_client
node_supabase_storage -->|"uploads through"| node_supabase_client

click node_app "https://github.com/24691a3188/shilpsetu/blob/main/src/App.tsx"
click node_auth "https://github.com/24691a3188/shilpsetu/blob/main/src/context/AuthContext.tsx"
click node_onboarding "https://github.com/24691a3188/shilpsetu/blob/main/src/views/onboarding/ArtisanOnboardingView.tsx"
click node_ai_studio "https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/AIProductStudioView.tsx"
click node_voice_catalog "https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/VoiceCatalogStudioView.tsx"
click node_pricing "https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/DynamicPricingView.tsx"
click node_artisan_dashboard "https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/ArtisanDashboard.tsx"
click node_artisan_orders "https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/ArtisanOrdersView.tsx"
click node_buyer_market "https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/BuyerMarketplaceView.tsx"
click node_product_details "https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/ProductDetailsView.tsx"
click node_cart_context "https://github.com/24691a3188/shilpsetu/blob/main/src/context/CartContext.tsx"
click node_checkout "https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/CartCheckoutView.tsx"
click node_buyer_orders "https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/BuyerOrdersView.tsx"
click node_b2b "https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/B2BLinkageView.tsx"
click node_admin_verify "https://github.com/24691a3188/shilpsetu/blob/main/src/views/admin/AdminArtisanVerificationView.tsx"
click node_admin_moderate "https://github.com/24691a3188/shilpsetu/blob/main/src/views/admin/AdminCatalogModerationView.tsx"
click node_admin_ai "https://github.com/24691a3188/shilpsetu/blob/main/src/views/admin/AdminAISettingsView.tsx"
click node_b2b_matcher "https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/b2bMatcher.ts"
click node_ai_gateway "https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/aiGateway.ts"
click node_vision "https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/visionService.ts"
click node_image_compose "https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/imageProcessing.ts"
click node_pricing_service "https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/pricingService.ts"
click node_catalog_data "https://github.com/24691a3188/shilpsetu/blob/main/src/constants/craftCatalog.ts"
click node_orders_state "https://github.com/24691a3188/shilpsetu/blob/main/src/context/OrderContext.tsx"
click node_local_db "https://github.com/24691a3188/shilpsetu/blob/main/src/services/storage/db.ts"
click node_supabase_client "https://github.com/24691a3188/shilpsetu/blob/main/src/services/supabase/client.ts"
click node_supabase_storage "https://github.com/24691a3188/shilpsetu/blob/main/src/services/supabase/storage.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,node_auth toneBlue
class node_onboarding,node_ai_studio,node_voice_catalog,node_pricing,node_artisan_dashboard,node_artisan_orders toneAmber
class node_buyer_market,node_product_details,node_cart_context,node_checkout,node_buyer_orders,node_b2b toneMint
class node_admin_verify,node_admin_moderate,node_admin_ai toneRose
class node_b2b_matcher,node_ai_gateway,node_vision,node_image_compose,node_pricing_service,node_catalog_data,node_orders_state,node_local_db,node_supabase_client,node_supabase_storage,node_artisan_actor,node_buyer_actor,node_admin_actor toneIndigo
```

## Components

### App and identity

- [Role-based app](https://github.com/24691a3188/shilpsetu/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/24691a3188/shilpsetu/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`

### Artisan tools

- [Artisan onboarding](https://github.com/24691a3188/shilpsetu/blob/main/src/views/onboarding/ArtisanOnboardingView.tsx): `src/views/onboarding/ArtisanOnboardingView.tsx`
- [Image studio](https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/AIProductStudioView.tsx): `src/views/artisan/AIProductStudioView.tsx`
- [Voice cataloging](https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/VoiceCatalogStudioView.tsx): `src/views/artisan/VoiceCatalogStudioView.tsx`
- [Fair pricing](https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/DynamicPricingView.tsx): `src/views/artisan/DynamicPricingView.tsx`
- [Artisan dashboard](https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/ArtisanDashboard.tsx): `src/views/artisan/ArtisanDashboard.tsx`
- [Artisan orders](https://github.com/24691a3188/shilpsetu/blob/main/src/views/artisan/ArtisanOrdersView.tsx): `src/views/artisan/ArtisanOrdersView.tsx`

### Marketplace and orders

- [Product discovery](https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/BuyerMarketplaceView.tsx): `src/views/buyer/BuyerMarketplaceView.tsx`
- [Product details](https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/ProductDetailsView.tsx): `src/views/buyer/ProductDetailsView.tsx`
- [Cart state](https://github.com/24691a3188/shilpsetu/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Cart checkout](https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/CartCheckoutView.tsx): `src/views/buyer/CartCheckoutView.tsx`
- [Buyer orders](https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/BuyerOrdersView.tsx): `src/views/buyer/BuyerOrdersView.tsx`
- [Bulk enquiries](https://github.com/24691a3188/shilpsetu/blob/main/src/views/buyer/B2BLinkageView.tsx): `src/views/buyer/B2BLinkageView.tsx`

### Admin governance

- [Artisan verification](https://github.com/24691a3188/shilpsetu/blob/main/src/views/admin/AdminArtisanVerificationView.tsx): `src/views/admin/AdminArtisanVerificationView.tsx`
- [Catalog moderation](https://github.com/24691a3188/shilpsetu/blob/main/src/views/admin/AdminCatalogModerationView.tsx): `src/views/admin/AdminCatalogModerationView.tsx`
- [AI gateway settings](https://github.com/24691a3188/shilpsetu/blob/main/src/views/admin/AdminAISettingsView.tsx): `src/views/admin/AdminAISettingsView.tsx`

### AI and persistence

- [Cluster matching](https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/b2bMatcher.ts): `src/services/ai/b2bMatcher.ts`
- [AI gateway](https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/aiGateway.ts): `src/services/ai/aiGateway.ts`
- [Image processing](https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/visionService.ts): `src/services/ai/visionService.ts`
- [Studio composition](https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/imageProcessing.ts): `src/services/ai/imageProcessing.ts`
- [Pricing engine](https://github.com/24691a3188/shilpsetu/blob/main/src/services/ai/pricingService.ts): `src/services/ai/pricingService.ts`
- [Craft catalog](https://github.com/24691a3188/shilpsetu/blob/main/src/constants/craftCatalog.ts): `src/constants/craftCatalog.ts`
- [Order state](https://github.com/24691a3188/shilpsetu/blob/main/src/context/OrderContext.tsx): `src/context/OrderContext.tsx`
- [Local data store](https://github.com/24691a3188/shilpsetu/blob/main/src/services/storage/db.ts): `src/services/storage/db.ts`
- [Supabase client](https://github.com/24691a3188/shilpsetu/blob/main/src/services/supabase/client.ts): `src/services/supabase/client.ts`
- [Image storage](https://github.com/24691a3188/shilpsetu/blob/main/src/services/supabase/storage.ts): `src/services/supabase/storage.ts`

### Other components

- **Artisan**
- **Buyer**
- **Administrator**

## Connections

- Artisan → Role-based app: uses (evidence: `README.md`)
- Buyer → Role-based app: uses (evidence: `README.md`)
- Administrator → Role-based app: uses (evidence: `README.md`)
- Role-based app → Authentication: provides (evidence: `src/App.tsx`)
- Role-based app → Artisan onboarding: routes (evidence: `src/App.tsx`)
- Role-based app → Artisan dashboard: routes (evidence: `src/App.tsx`)
- Role-based app → Product discovery: routes
- Role-based app → Artisan verification: routes
- Image studio → Image processing: processes images
- Image processing → Studio composition: composes image (evidence: `src/services/ai/visionService.ts`)
- Image processing → AI gateway: uses gateway (evidence: `src/services/ai/visionService.ts`)
- Voice cataloging → AI gateway: uses gateway
- Fair pricing → Pricing engine: calculates prices
- Product discovery → Product details: opens products
- Product details → Cart state: adds to cart
- Cart checkout → Cart state: reads cart
- Cart checkout → Order state: creates orders
- Artisan orders → Order state: reads orders
- Buyer orders → Order state: tracks orders
- Bulk enquiries → Cluster matching: requests matches
- AI gateway settings → AI gateway: configures
- Cart state → Local data store: persists cart (evidence: `src/context/CartContext.tsx`)
- Cart state → Craft catalog: uses products (evidence: `src/context/CartContext.tsx`)
- Authentication → Supabase client: authenticates (evidence: `src/context/AuthContext.tsx`)
- Image storage → Supabase client: uploads through (evidence: `src/services/supabase/storage.ts`)
