# codewithjaswanth/inventra.ai-main architecture

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

- Interactive diagram: https://gitdiagram.com/codewithjaswanth/inventra.ai-main
- Repository: https://github.com/codewithjaswanth/inventra.ai-main

## Overview

Local-Inventory-AI is a hyperlocal inventory and shopping application: customers discover nearby shops and products, then manage a cart and checkout; shopkeepers maintain stock, including an AI-assisted image/audio update workflow. Admin routes provide operational oversight. The source index and excerpts support the AI pipeline and several UI-to-service links, but the short README documents no further capabilities. Some route families are unsampled, so their internal calls are not inferred.

Main entry points: [`services/ai/pipeline.service.ts`](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/pipeline.service.ts) (Update pipeline), [`app/page.tsx`](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/page.tsx) (Home discovery), [`app/checkout/page.tsx`](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/checkout/page.tsx) (Checkout), [`services/inventory.service.ts`](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/inventory.service.ts) (Inventory service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Local discovery"]
  node_home["Home discovery<br/>[page.tsx]"]
  node_search["Product search<br/>[SearchModal.tsx]"]
  node_catalog["Product catalog data<br/>[searchProducts.ts]"]
  node_shopdetail["Shop details<br/>[page.tsx]"]
end

subgraph group_commerce["Shopping"]
  node_cart["Cart state<br/>[CartContext.tsx]"]
  node_checkout["Checkout<br/>[page.tsx]"]
  node_orders["Order history<br/>[page.tsx]"]
end

subgraph group_seller["Seller operations"]
  node_aiupdate["AI inventory update<br/>[page.tsx]"]
  node_review["Inventory review UI"]
  node_inventory["Inventory management"]
  node_inventoryservice["Inventory service"]
end

subgraph group_ai["AI processing"]
  node_pipeline["Update pipeline"]
  node_storage["Media storage<br/>[storage.service.ts]"]
  node_whisper["Audio transcription<br/>[whisper.service.ts]"]
  node_florence["Image detection"]
  node_groq["Inventory extraction<br/>[groq.service.ts]"]
  node_bge["Embeddings<br/>[bge.service.ts]"]
  node_n8n["Workflow webhook<br/>[n8n.service.ts]"]
end

subgraph group_platform["Identity and data"]
  node_login["Login and signup<br/>[page.tsx]"]
  node_authservice["Authentication service<br/>[auth.service.ts]"]
  node_supabase["Supabase client<br/>[supabase.ts]"]
  node_admin["Admin console<br/>[page.tsx]"]
end

node_customer(("Customer"))
node_seller(("Shopkeeper"))

node_customer -->|"browses"| node_home
node_home -->|"opens search"| node_search
node_search -->|"reads products"| node_catalog
node_home -.->|"opens shop"| node_shopdetail
node_customer -->|"checks out"| node_checkout
node_checkout -->|"reads cart"| node_cart
node_checkout -->|"uses auth"| node_login
node_customer -->|"views orders"| node_orders
node_seller -.->|"submits update"| node_aiupdate
node_aiupdate -->|"renders review"| node_review
node_seller -.->|"manages stock"| node_inventory
node_inventory -->|"calls inventory"| node_inventoryservice
node_pipeline -->|"uploads media"| node_storage
node_pipeline -->|"transcribes audio"| node_whisper
node_pipeline -->|"detects products"| node_florence
node_pipeline -->|"extracts items"| node_groq
node_pipeline -->|"generates embeddings"| node_bge
node_pipeline -->|"saves inventory"| node_inventoryservice
node_pipeline -->|"triggers webhook"| node_n8n
node_login -->|"calls auth"| node_authservice
node_authservice -->|"uses client"| node_supabase
node_inventoryservice -->|"uses client"| node_supabase
node_admin -.->|"data access"| node_supabase

click node_home "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/page.tsx"
click node_search "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/components/SearchModal.tsx"
click node_catalog "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/data/searchProducts.ts"
click node_shopdetail "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/shop/%5Bid%5D/page.tsx"
click node_cart "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/context/CartContext.tsx"
click node_checkout "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/checkout/page.tsx"
click node_orders "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/orders/page.tsx"
click node_aiupdate "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/ai-update/page.tsx"
click node_review "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/components/ai-update/InventoryReviewTable.tsx"
click node_inventory "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/components/inventory/InventoryManager.tsx"
click node_inventoryservice "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/inventory.service.ts"
click node_pipeline "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/pipeline.service.ts"
click node_storage "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/storage.service.ts"
click node_whisper "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/whisper.service.ts"
click node_florence "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/florence.service.ts"
click node_groq "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/groq.service.ts"
click node_bge "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/bge.service.ts"
click node_n8n "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/n8n.service.ts"
click node_login "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/login/page.tsx"
click node_authservice "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/auth.service.ts"
click node_supabase "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/lib/supabase.ts"
click node_admin "https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/admin/page.tsx"

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_home,node_search,node_catalog,node_shopdetail toneBlue
class node_cart,node_checkout,node_orders toneAmber
class node_aiupdate,node_review,node_inventory,node_inventoryservice toneMint
class node_pipeline,node_storage,node_whisper,node_florence,node_groq,node_bge,node_n8n toneRose
class node_login,node_authservice,node_supabase,node_admin,node_customer,node_seller toneIndigo
```

## Components

### Local discovery

- [Home discovery](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/page.tsx): `app/page.tsx`
- [Product search](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/components/SearchModal.tsx): `components/SearchModal.tsx`
- [Product catalog data](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/data/searchProducts.ts): `data/searchProducts.ts`
- [Shop details](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/shop/%5Bid%5D/page.tsx): `app/shop/[id]/page.tsx`

### Shopping

- [Cart state](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/context/CartContext.tsx): `context/CartContext.tsx`
- [Checkout](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/checkout/page.tsx): `app/checkout/page.tsx`
- [Order history](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/orders/page.tsx): `app/orders/page.tsx`

### Seller operations

- [AI inventory update](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/ai-update/page.tsx): `app/ai-update/page.tsx`
- [Inventory review UI](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/components/ai-update/InventoryReviewTable.tsx): `components/ai-update/InventoryReviewTable.tsx`
- [Inventory management](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/components/inventory/InventoryManager.tsx): `components/inventory/InventoryManager.tsx`
- [Inventory service](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/inventory.service.ts): `services/inventory.service.ts`

### AI processing

- [Update pipeline](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/pipeline.service.ts): `services/ai/pipeline.service.ts`
- [Media storage](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/storage.service.ts): `services/storage.service.ts`
- [Audio transcription](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/whisper.service.ts): `services/ai/whisper.service.ts`
- [Image detection](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/florence.service.ts): `services/ai/florence.service.ts`
- [Inventory extraction](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/groq.service.ts): `services/ai/groq.service.ts`
- [Embeddings](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/bge.service.ts): `services/ai/bge.service.ts`
- [Workflow webhook](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/ai/n8n.service.ts): `services/ai/n8n.service.ts`

### Identity and data

- [Login and signup](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Authentication service](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/services/auth.service.ts): `services/auth.service.ts`
- [Supabase client](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/lib/supabase.ts): `lib/supabase.ts`
- [Admin console](https://github.com/codewithjaswanth/inventra.ai-main/blob/main/app/admin/page.tsx): `app/admin/page.tsx`

### Other components

- **Customer**
- **Shopkeeper**

## Connections

- Customer → Home discovery: browses (evidence: `app/page.tsx`)
- Home discovery → Product search: opens search (evidence: `app/page.tsx`)
- Product search → Product catalog data: reads products (evidence: `components/SearchModal.tsx`)
- Home discovery → Shop details: opens shop
- Customer → Checkout: checks out (evidence: `app/checkout/page.tsx`)
- Checkout → Cart state: reads cart (evidence: `app/checkout/page.tsx`)
- Checkout → Login and signup: uses auth (evidence: `app/checkout/page.tsx`)
- Customer → Order history: views orders (evidence: `app/orders/page.tsx`)
- Shopkeeper → AI inventory update: submits update
- AI inventory update → Inventory review UI: renders review (evidence: `app/ai-update/page.tsx`)
- Shopkeeper → Inventory management: manages stock
- Inventory management → Inventory service: calls inventory (evidence: `components/inventory/InventoryManager.tsx`)
- Update pipeline → Media storage: uploads media (evidence: `services/ai/pipeline.service.ts`)
- Update pipeline → Audio transcription: transcribes audio (evidence: `services/ai/pipeline.service.ts`)
- Update pipeline → Image detection: detects products (evidence: `services/ai/pipeline.service.ts`)
- Update pipeline → Inventory extraction: extracts items (evidence: `services/ai/pipeline.service.ts`)
- Update pipeline → Embeddings: generates embeddings (evidence: `services/ai/pipeline.service.ts`)
- Update pipeline → Inventory service: saves inventory (evidence: `services/ai/pipeline.service.ts`)
- Update pipeline → Workflow webhook: triggers webhook (evidence: `services/ai/pipeline.service.ts`)
- Login and signup → Authentication service: calls auth (evidence: `app/login/page.tsx`)
- Authentication service → Supabase client: uses client (evidence: `services/auth.service.ts`)
- Inventory service → Supabase client: uses client (evidence: `services/inventory.service.ts`)
- Admin console → Supabase client: data access
