# satyasahu8317/sih26090-artisan-platform architecture

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

- Interactive diagram: https://gitdiagram.com/satyasahu8317/sih26090-artisan-platform
- Repository: https://github.com/satyasahu8317/sih26090-artisan-platform

## Overview

SIH26090 is an artisan market-linkage and smart-cataloguing platform: artisans create product listings, while buyers discover products and place orders. The backend owns authentication, persistence, marketplace workflows, and orchestration; the Python service provides stateless ML inference. The tree shows Flutter platform shells but not the Dart application source, so mobile is represented only as the client. ML routers and model implementations are mapped from the README and tree; their internal calls were not sampled, so those links are omitted.

Main entry points: [`ml-service/app/main.py`](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/main.py) (Inference API), [`backend-service/src/config/db.js`](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/config/db.js) (Database), [`ml-service/app/models`](https://github.com/satyasahu8317/sih26090-artisan-platform/tree/master/ml-service/app/models) (Inference models), [`backend-service/src/app.js`](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/app.js) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_mobile["Flutter app"]
end

subgraph group_backend["Marketplace Backend"]
  node_api["HTTP API<br/>[app.js]"]
  node_auth["Authentication<br/>[authController.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_airoutes["AI routes<br/>[aiRoutes.js]"]
  node_ai["AI orchestration<br/>[aiController.js]"]
  node_mlclient["ML client<br/>[mlClient.js]"]
  node_catalog["Product catalog"]
  node_media["Media storage<br/>[b2Storage.js]"]
  node_orders["Orders and checkout<br/>[orderController.js]"]
  node_reviews["Reviews"]
  node_db[("Database<br/>[db.js]")]
end

subgraph group_ml["ML Inference"]
  node_mlapi["Inference API<br/>[main.py]"]
  node_pricing["Pricing inference<br/>[pricing.py]"]
  node_image["Image inference<br/>[image.py]"]
  node_audio["Audio transcription<br/>[audio.py]"]
  node_text["Text processing<br/>[text.py]"]
  node_models["Inference models"]
end

node_artisan(("Artisan"))
node_buyer(("Buyer"))
node_b2[("Backblaze B2")]
node_groq["Groq LLM"]

node_artisan -->|"uses"| node_mobile
node_buyer -->|"uses"| node_mobile
node_mobile -->|"sends requests"| node_api
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_airoutes
node_authroutes -->|"dispatches"| node_auth
node_airoutes -->|"dispatches"| node_ai
node_auth -->|"reads and writes"| node_db
node_orders -->|"reads and writes"| node_db
node_reviews -->|"reads and writes"| node_db
node_catalog -->|"reads and writes"| node_db
node_ai -->|"calls"| node_mlclient
node_mlclient -->|"requests inference"| node_mlapi
node_mlapi -->|"mounts router"| node_pricing
node_mlapi -->|"mounts router"| node_image
node_mlapi -->|"mounts router"| node_audio
node_mlapi -->|"mounts router"| node_text
node_pricing -->|"uses models"| node_models
node_image -->|"uses models"| node_models
node_audio -->|"uses models"| node_models
node_text -->|"uses models"| node_models
node_media -->|"uploads media"| node_b2
node_ai -.->|"generates catalogue"| node_groq

click node_mobile "https://github.com/satyasahu8317/sih26090-artisan-platform/tree/master/mobile"
click node_api "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/app.js"
click node_auth "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/authController.js"
click node_authroutes "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/routes/authRoutes.js"
click node_airoutes "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/routes/aiRoutes.js"
click node_ai "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/aiController.js"
click node_mlclient "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/services/mlClient.js"
click node_catalog "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/productController.js"
click node_media "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/services/b2Storage.js"
click node_orders "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/orderController.js"
click node_reviews "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/reviewController.js"
click node_db "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/config/db.js"
click node_mlapi "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/main.py"
click node_pricing "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/pricing.py"
click node_image "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/image.py"
click node_audio "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/audio.py"
click node_text "https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/text.py"
click node_models "https://github.com/satyasahu8317/sih26090-artisan-platform/tree/master/ml-service/app/models"

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_mobile toneBlue
class node_api,node_auth,node_authroutes,node_airoutes,node_ai,node_mlclient,node_catalog,node_media,node_orders,node_reviews,node_db,node_b2 toneAmber
class node_mlapi,node_pricing,node_image,node_audio,node_text,node_models toneMint
class node_artisan,node_buyer,node_groq toneIndigo
```

## Components

### Client

- [Flutter app](https://github.com/satyasahu8317/sih26090-artisan-platform/tree/master/mobile): `mobile`

### Marketplace Backend

- [HTTP API](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/app.js): `backend-service/src/app.js`
- [Authentication](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/authController.js): `backend-service/src/controllers/authController.js`
- [Auth routes](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/routes/authRoutes.js): `backend-service/src/routes/authRoutes.js`
- [AI routes](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/routes/aiRoutes.js): `backend-service/src/routes/aiRoutes.js`
- [AI orchestration](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/aiController.js): `backend-service/src/controllers/aiController.js`
- [ML client](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/services/mlClient.js): `backend-service/src/services/mlClient.js`
- [Product catalog](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/productController.js): `backend-service/src/controllers/productController.js`
- [Media storage](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/services/b2Storage.js): `backend-service/src/services/b2Storage.js`
- [Orders and checkout](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/orderController.js): `backend-service/src/controllers/orderController.js`
- [Reviews](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/controllers/reviewController.js): `backend-service/src/controllers/reviewController.js`
- [Database](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/backend-service/src/config/db.js): `backend-service/src/config/db.js`

### ML Inference

- [Inference API](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/main.py): `ml-service/app/main.py`
- [Pricing inference](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/pricing.py): `ml-service/app/routers/pricing.py`
- [Image inference](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/image.py): `ml-service/app/routers/image.py`
- [Audio transcription](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/audio.py): `ml-service/app/routers/audio.py`
- [Text processing](https://github.com/satyasahu8317/sih26090-artisan-platform/blob/master/ml-service/app/routers/text.py): `ml-service/app/routers/text.py`
- [Inference models](https://github.com/satyasahu8317/sih26090-artisan-platform/tree/master/ml-service/app/models): `ml-service/app/models`

### Other components

- **Artisan**
- **Buyer**
- **Backblaze B2**
- **Groq LLM**

## Connections

- Artisan → Flutter app: uses
- Buyer → Flutter app: uses
- Flutter app → HTTP API: sends requests
- HTTP API → Auth routes: mounts
- HTTP API → AI routes: mounts
- Auth routes → Authentication: dispatches
- AI routes → AI orchestration: dispatches
- Authentication → Database: reads and writes
- Orders and checkout → Database: reads and writes
- Reviews → Database: reads and writes
- Product catalog → Database: reads and writes
- AI orchestration → ML client: calls
- ML client → Inference API: requests inference
- Inference API → Pricing inference: mounts router
- Inference API → Image inference: mounts router
- Inference API → Audio transcription: mounts router
- Inference API → Text processing: mounts router
- Pricing inference → Inference models: uses models
- Image inference → Inference models: uses models
- Audio transcription → Inference models: uses models
- Text processing → Inference models: uses models
- Media storage → Backblaze B2: uploads media
- AI orchestration → Groq LLM: generates catalogue
