# shivam-4039/kalakriti architecture

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

- Interactive diagram: https://gitdiagram.com/shivam-4039/kalakriti
- Repository: https://github.com/shivam-4039/kalakriti

## Overview

Kalakriti is an artisan-focused mobile cataloging and market-linkage product. The main user journey is onboarding and authentication, then capturing a product by voice or image, reviewing extracted details, and publishing it; catalog, pricing, QR, B2B, and ONDC are distinct backend capabilities. The graph combines shown frontend calls and backend wiring with documented module references. Several feature routers and services were not excerpted, so their internal processing links are omitted rather than inferred.

Main entry points: [`Backend/app/main.py`](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/main.py) (API application), [`Backend/app/routers/auth.py`](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/auth.py) (Authentication endpoints), [`Frontend/services/api.ts`](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/services/api.ts) (API client), [`Frontend/stores/listingStore.ts`](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/stores/listingStore.ts) (Listing state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Artisan mobile app"]
  node_language["Language selection<br/>[index.tsx]"]
  node_sign_in["Phone sign-in<br/>[login.tsx]"]
  node_mobile_api["API client<br/>[api.ts]"]
end

subgraph group_identity["Identity and persistence"]
  node_auth_state["Session state<br/>[authStore.ts]"]
  node_auth_api["Authentication endpoints<br/>[auth.py]"]
  node_supabase_service["Supabase auth and storage"]
  node_artisan_model["Artisan profile<br/>[artisan.py]"]
end

subgraph group_catalog["Catalog creation"]
  node_listing_capture["Listing capture<br/>[photo.tsx]"]
  node_voice_capture["Voice listing<br/>[voice.tsx]"]
  node_listing_state["Listing state<br/>[listingStore.ts]"]
  node_listing_review["Listing review<br/>[preview.tsx]"]
  node_catalog_api["Product endpoints<br/>[products.py]"]
  node_image_api["Image processing endpoint<br/>[image.py]"]
  node_image_service["Image processing<br/>[image_service.py]"]
  node_voice_api["Voice endpoints<br/>[voice.py]"]
  node_stt_service["Speech recognition<br/>[stt_service.py]"]
  node_llm_service["Language processing<br/>[llm_service.py]"]
end

subgraph group_market["Market linkage"]
  node_pricing_api["Pricing endpoint<br/>[pricing.py]"]
  node_pricing_service["Pricing model service<br/>[pricing_service.py]"]
  node_b2b_api["B2B inquiries<br/>[b2b.py]"]
  node_ondc_api["ONDC integration<br/>[ondc.py]"]
  node_qr_api["QR endpoint<br/>[qr.py]"]
end

subgraph group_platform["Backend platform"]
  node_database["Database sessions<br/>[database.py]"]
  node_backend_entry["API application<br/>[main.py]"]
end

node_artisan(("Artisan"))
node_postgres[("PostgreSQL")]
node_supabase["Supabase service"]
node_mobile_app(("Mobile app user"))

node_artisan -->|"chooses language"| node_language
node_artisan -.->|"starts sign-in"| node_sign_in
node_sign_in -->|"requests OTP"| node_auth_state
node_auth_state -->|"calls auth API"| node_mobile_api
node_mobile_api -.->|"sends API requests"| node_backend_entry
node_backend_entry -->|"registers router"| node_auth_api
node_backend_entry -->|"registers router"| node_voice_api
node_backend_entry -->|"registers router"| node_image_api
node_backend_entry -->|"registers router"| node_catalog_api
node_backend_entry -->|"registers router"| node_pricing_api
node_backend_entry -->|"registers router"| node_ondc_api
node_backend_entry -->|"registers router"| node_b2b_api
node_backend_entry -->|"registers router"| node_qr_api
node_backend_entry -->|"initializes model"| node_pricing_service
node_auth_api -->|"verifies OTP"| node_supabase_service
node_auth_api -->|"queries profile"| node_artisan_model
node_auth_api -->|"uses session"| node_database
node_database -->|"connects to"| node_postgres
node_supabase_service -->|"authenticates and uploads"| node_supabase
node_image_api -->|"uses service"| node_image_service
node_image_api -->|"uploads media"| node_supabase_service
node_pricing_api -.->|"uses service"| node_pricing_service
node_mobile_app -.->|"begins listing"| node_listing_capture
node_listing_capture -.->|"stores captured data"| node_listing_state
node_voice_capture -.->|"stores voice input"| node_listing_state
node_listing_review -->|"reads and updates fields"| node_listing_state
node_listing_state -->|"submits listing"| node_mobile_api
node_mobile_api -.->|"requests product actions"| node_catalog_api
node_voice_api -.->|"uses speech service"| node_stt_service
node_voice_api -.->|"uses language service"| node_llm_service
node_catalog_api -.->|"uses persistence"| node_database
node_b2b_api -->|"uses persistence"| node_database

click node_language "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/index.tsx"
click node_sign_in "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/(auth)/login.tsx"
click node_auth_state "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/stores/authStore.ts"
click node_mobile_api "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/services/api.ts"
click node_listing_capture "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/listing/photo.tsx"
click node_voice_capture "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/listing/voice.tsx"
click node_listing_state "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/stores/listingStore.ts"
click node_listing_review "https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/listing/preview.tsx"
click node_catalog_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/products.py"
click node_image_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/image.py"
click node_image_service "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/image_service.py"
click node_voice_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/voice.py"
click node_stt_service "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/stt_service.py"
click node_llm_service "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/llm_service.py"
click node_pricing_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/pricing.py"
click node_pricing_service "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/pricing_service.py"
click node_b2b_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/b2b.py"
click node_ondc_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/ondc.py"
click node_qr_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/qr.py"
click node_auth_api "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/auth.py"
click node_supabase_service "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/supabase_service.py"
click node_artisan_model "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/models/artisan.py"
click node_database "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/database.py"
click node_backend_entry "https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/main.py"

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_language,node_sign_in,node_mobile_api,node_mobile_app toneBlue
class node_auth_state,node_auth_api,node_supabase_service,node_artisan_model,node_postgres toneAmber
class node_listing_capture,node_voice_capture,node_listing_state,node_listing_review,node_catalog_api,node_image_api,node_image_service,node_voice_api,node_stt_service,node_llm_service toneMint
class node_pricing_api,node_pricing_service,node_b2b_api,node_ondc_api,node_qr_api toneRose
class node_database,node_backend_entry,node_artisan,node_supabase toneIndigo
```

## Components

### Artisan mobile app

- [Language selection](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/index.tsx): `Frontend/app/index.tsx`
- [Phone sign-in](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/(auth)/login.tsx): `Frontend/app/(auth)/login.tsx`
- [API client](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/services/api.ts): `Frontend/services/api.ts`

### Identity and persistence

- [Session state](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/stores/authStore.ts): `Frontend/stores/authStore.ts`
- [Authentication endpoints](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/auth.py): `Backend/app/routers/auth.py`
- [Supabase auth and storage](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/supabase_service.py): `Backend/app/services/supabase_service.py`
- [Artisan profile](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/models/artisan.py): `Backend/app/models/artisan.py`

### Catalog creation

- [Listing capture](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/listing/photo.tsx): `Frontend/app/listing/photo.tsx`
- [Voice listing](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/listing/voice.tsx): `Frontend/app/listing/voice.tsx`
- [Listing state](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/stores/listingStore.ts): `Frontend/stores/listingStore.ts`
- [Listing review](https://github.com/shivam-4039/kalakriti/blob/main/Frontend/app/listing/preview.tsx): `Frontend/app/listing/preview.tsx`
- [Product endpoints](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/products.py): `Backend/app/routers/products.py`
- [Image processing endpoint](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/image.py): `Backend/app/routers/image.py`
- [Image processing](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/image_service.py): `Backend/app/services/image_service.py`
- [Voice endpoints](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/voice.py): `Backend/app/routers/voice.py`
- [Speech recognition](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/stt_service.py): `Backend/app/services/stt_service.py`
- [Language processing](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/llm_service.py): `Backend/app/services/llm_service.py`

### Market linkage

- [Pricing endpoint](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/pricing.py): `Backend/app/routers/pricing.py`
- [Pricing model service](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/services/pricing_service.py): `Backend/app/services/pricing_service.py`
- [B2B inquiries](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/b2b.py): `Backend/app/routers/b2b.py`
- [ONDC integration](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/ondc.py): `Backend/app/routers/ondc.py`
- [QR endpoint](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/routers/qr.py): `Backend/app/routers/qr.py`

### Backend platform

- [Database sessions](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/database.py): `Backend/app/database.py`
- [API application](https://github.com/shivam-4039/kalakriti/blob/main/Backend/app/main.py): `Backend/app/main.py`

### Other components

- **Artisan**
- **PostgreSQL**
- **Supabase service**
- **Mobile app user**

## Connections

- Artisan → Language selection: chooses language (evidence: `Frontend/app/index.tsx`)
- Artisan → Phone sign-in: starts sign-in
- Phone sign-in → Session state: requests OTP (evidence: `Frontend/app/(auth)/login.tsx`)
- Session state → API client: calls auth API (evidence: `Frontend/stores/authStore.ts`)
- API client → API application: sends API requests
- API application → Authentication endpoints: registers router (evidence: `Backend/app/main.py`)
- API application → Voice endpoints: registers router (evidence: `Backend/app/main.py`)
- API application → Image processing endpoint: registers router (evidence: `Backend/app/main.py`)
- API application → Product endpoints: registers router (evidence: `Backend/app/main.py`)
- API application → Pricing endpoint: registers router (evidence: `Backend/app/main.py`)
- API application → ONDC integration: registers router (evidence: `Backend/app/main.py`)
- API application → B2B inquiries: registers router (evidence: `Backend/app/main.py`)
- API application → QR endpoint: registers router (evidence: `Backend/app/main.py`)
- API application → Pricing model service: initializes model (evidence: `Backend/app/main.py`)
- Authentication endpoints → Supabase auth and storage: verifies OTP (evidence: `Backend/app/routers/auth.py`)
- Authentication endpoints → Artisan profile: queries profile (evidence: `Backend/app/routers/auth.py`)
- Authentication endpoints → Database sessions: uses session (evidence: `Backend/app/routers/auth.py`)
- Database sessions → PostgreSQL: connects to (evidence: `Backend/app/database.py`)
- Supabase auth and storage → Supabase service: authenticates and uploads (evidence: `Backend/app/services/supabase_service.py`)
- Image processing endpoint → Image processing: uses service (evidence: `Backend/app/routers/image.py`)
- Image processing endpoint → Supabase auth and storage: uploads media (evidence: `Backend/app/routers/image.py`)
- Pricing endpoint → Pricing model service: uses service
- Mobile app user → Listing capture: begins listing
- Listing capture → Listing state: stores captured data
- Voice listing → Listing state: stores voice input
- Listing review → Listing state: reads and updates fields (evidence: `Frontend/app/listing/preview.tsx`)
- Listing state → API client: submits listing (evidence: `Frontend/stores/listingStore.ts`)
- API client → Product endpoints: requests product actions
- Voice endpoints → Speech recognition: uses speech service
- Voice endpoints → Language processing: uses language service
- Product endpoints → Database sessions: uses persistence
- B2B inquiries → Database sessions: uses persistence (evidence: `Backend/app/routers/b2b.py`)
