# the-steelix-flame/kalakriti architecture

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

- Interactive diagram: https://gitdiagram.com/the-steelix-flame/kalakriti
- Repository: https://github.com/the-steelix-flame/kalakriti

## Overview

Kalakriti is an artisan business-management and market-linkage product: artisans capture and describe handmade goods, prepare and price listings, publish them, then manage orders and payments. The mobile app also supports offline capture, drafts, multilingual onboarding, group orders and logistics workflows. The backend provides image processing, commerce and operational services. Edges reflect the documented workflow and sampled code; several backend routes and client call sites were not sampled, so uncertain wiring is omitted.

Main entry points: [`backend/main.py`](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/main.py) (API application), [`backend/pipeline.py`](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/pipeline.py) (Image pipeline), [`app/App.tsx`](https://github.com/the-steelix-flame/kalakriti/blob/main/app/App.tsx) (App shell), [`app/src/screens/GuidedCamera.tsx`](https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/screens/GuidedCamera.tsx) (Guided capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["App shell<br/>[App.tsx]"]
  node_home["Home and products<br/>[HomeTab.tsx]"]
  node_api["API client<br/>[api.ts]"]
end

subgraph group_listing["Listing workflow"]
  node_camera["Guided capture<br/>[GuidedCamera.tsx]"]
  node_visionlocal["On-device vision<br/>[vision.ts]"]
  node_create["Create listing<br/>[Create.tsx]"]
  node_drafts["Draft persistence<br/>[drafts.ts]"]
  node_pipeline["Image pipeline<br/>[pipeline.py]"]
  node_imaging["Image enhancement<br/>[imaging.py]"]
  node_vision["OCR and analysis<br/>[vision.py]"]
  node_pricing["Pricing<br/>[pricing.py]"]
end

subgraph group_commerce["Commerce operations"]
  node_market["Marketplace publishing<br/>[market.py]"]
  node_seller["Seller readiness<br/>[seller.py]"]
  node_orders["Orders and reservations<br/>[reservations.py]"]
  node_logistics["Logistics<br/>[logistics.py]"]
  node_wallet["Wallet and payouts<br/>[wallet.py]"]
  node_storefront["Buyer storefront<br/>[storefront.py]"]
end

subgraph group_backend["Backend services"]
  node_backendapi["API application<br/>[main.py]"]
  node_media["Media storage<br/>[media.py]"]
  node_db[("Application database<br/>[db.py]")]
end

subgraph group_integrations["External services"]
  node_llm["Language models<br/>[llm.py]"]
  node_marketplaces{{"Sales channels"}}
  node_payment{{"Payment provider"}}
  node_courier{{"Courier services"}}
end

node_artisan(("Artisan"))
node_buyer(("Buyer"))

node_artisan -->|"uses"| node_app
node_app -->|"opens"| node_home
node_app -->|"starts capture"| node_camera
node_camera -->|"checks framing"| node_visionlocal
node_camera -->|"saves draft"| node_drafts
node_artisan -->|"describes product"| node_create
node_create -->|"requests listing"| node_api
node_api -->|"sends requests"| node_backendapi
node_backendapi -->|"processes image"| node_pipeline
node_pipeline -->|"enhances image"| node_imaging
node_pipeline -->|"runs OCR and analysis"| node_vision
node_vision -.->|"requests analysis"| node_llm
node_pipeline -->|"stores images"| node_media
node_backendapi -->|"calculates prices"| node_pricing
node_backendapi -->|"checks readiness"| node_seller
node_backendapi -->|"publishes listings"| node_market
node_market -.->|"publishes to channels"| node_marketplaces
node_backendapi -->|"serves shop"| node_storefront
node_buyer -->|"browses products"| node_storefront
node_backendapi -->|"manages orders"| node_orders
node_backendapi -->|"handles shipping"| node_logistics
node_logistics -.->|"books and tracks"| node_courier
node_backendapi -->|"handles payouts"| node_wallet
node_wallet -.->|"initiates payment"| node_payment
node_backendapi -->|"persists records"| node_db

click node_app "https://github.com/the-steelix-flame/kalakriti/blob/main/app/App.tsx"
click node_home "https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/screens/HomeTab.tsx"
click node_camera "https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/screens/GuidedCamera.tsx"
click node_visionlocal "https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/lib/vision.ts"
click node_create "https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/screens/Create.tsx"
click node_drafts "https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/lib/drafts.ts"
click node_api "https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/lib/api.ts"
click node_backendapi "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/main.py"
click node_pipeline "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/pipeline.py"
click node_imaging "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/imaging.py"
click node_vision "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/vision.py"
click node_llm "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/llm.py"
click node_media "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/media.py"
click node_pricing "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/pricing.py"
click node_market "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/market.py"
click node_seller "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/seller.py"
click node_orders "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/reservations.py"
click node_logistics "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/logistics.py"
click node_wallet "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/wallet.py"
click node_db "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/db.py"
click node_storefront "https://github.com/the-steelix-flame/kalakriti/blob/main/backend/storefront.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_app,node_home,node_api toneBlue
class node_camera,node_visionlocal,node_create,node_drafts,node_pipeline,node_imaging,node_vision,node_pricing toneAmber
class node_market,node_seller,node_orders,node_logistics,node_wallet,node_storefront toneMint
class node_backendapi,node_media,node_db toneRose
class node_llm,node_marketplaces,node_payment,node_courier,node_artisan,node_buyer toneIndigo
```

## Components

### Mobile app

- [App shell](https://github.com/the-steelix-flame/kalakriti/blob/main/app/App.tsx): `app/App.tsx`
- [Home and products](https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/screens/HomeTab.tsx): `app/src/screens/HomeTab.tsx`
- [API client](https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/lib/api.ts): `app/src/lib/api.ts`

### Listing workflow

- [Guided capture](https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/screens/GuidedCamera.tsx): `app/src/screens/GuidedCamera.tsx`
- [On-device vision](https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/lib/vision.ts): `app/src/lib/vision.ts`
- [Create listing](https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/screens/Create.tsx): `app/src/screens/Create.tsx`
- [Draft persistence](https://github.com/the-steelix-flame/kalakriti/blob/main/app/src/lib/drafts.ts): `app/src/lib/drafts.ts`
- [Image pipeline](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/pipeline.py): `backend/pipeline.py`
- [Image enhancement](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/imaging.py): `backend/imaging.py`
- [OCR and analysis](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/vision.py): `backend/vision.py`
- [Pricing](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/pricing.py): `backend/pricing.py`

### Commerce operations

- [Marketplace publishing](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/market.py): `backend/market.py`
- [Seller readiness](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/seller.py): `backend/seller.py`
- [Orders and reservations](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/reservations.py): `backend/reservations.py`
- [Logistics](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/logistics.py): `backend/logistics.py`
- [Wallet and payouts](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/wallet.py): `backend/wallet.py`
- [Buyer storefront](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/storefront.py): `backend/storefront.py`

### Backend services

- [API application](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/main.py): `backend/main.py`
- [Media storage](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/media.py): `backend/media.py`
- [Application database](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/db.py): `backend/db.py`

### External services

- [Language models](https://github.com/the-steelix-flame/kalakriti/blob/main/backend/llm.py): `backend/llm.py`
- **Sales channels**
- **Payment provider**
- **Courier services**

### Other components

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

## Connections

- Artisan → App shell: uses
- App shell → Home and products: opens
- App shell → Guided capture: starts capture
- Guided capture → On-device vision: checks framing
- Guided capture → Draft persistence: saves draft
- Artisan → Create listing: describes product
- Create listing → API client: requests listing
- API client → API application: sends requests
- API application → Image pipeline: processes image
- Image pipeline → Image enhancement: enhances image
- Image pipeline → OCR and analysis: runs OCR and analysis
- OCR and analysis → Language models: requests analysis
- Image pipeline → Media storage: stores images
- API application → Pricing: calculates prices
- API application → Seller readiness: checks readiness
- API application → Marketplace publishing: publishes listings
- Marketplace publishing → Sales channels: publishes to channels
- API application → Buyer storefront: serves shop
- Buyer → Buyer storefront: browses products
- API application → Orders and reservations: manages orders
- API application → Logistics: handles shipping
- Logistics → Courier services: books and tracks
- API application → Wallet and payouts: handles payouts
- Wallet and payouts → Payment provider: initiates payment
- API application → Application database: persists records
