# nihanth2006/pickle_bus architecture

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

- Interactive diagram: https://gitdiagram.com/nihanth2006/pickle_bus
- Repository: https://github.com/nihanth2006/pickle_bus

## Overview

This is a multi-role pickle-commerce and sourcing application: customers discover products and manage orders, while manufacturers and suppliers coordinate procurement, inventory, production, and fulfillment. The customer taste matcher and manufacturer procurement ranking are distinct decision-support capabilities; shared chat, notifications, onboarding, and verification support the role workflows. Repository evidence is partial: solid edges reflect source-index references or excerpts, while dashed edges mark plausible screen-to-screen flows whose wiring was not shown.

Main entry points: [`store/useAppStore.ts`](https://github.com/nihanth2006/pickle_bus/blob/main/store/useAppStore.ts) (Application state), [`app/supplier/publish-raw-material.tsx`](https://github.com/nihanth2006/pickle_bus/blob/main/app/supplier/publish-raw-material.tsx) (Supplier listings), [`app/manufacturer`](https://github.com/nihanth2006/pickle_bus/tree/main/app/manufacturer) (Manufacturer workspace), [`data/repositories/customerSupabaseRepository.ts`](https://github.com/nihanth2006/pickle_bus/blob/main/data/repositories/customerSupabaseRepository.ts) (Customer data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and onboarding"]
  node_routing["Role routing<br/>[_layout.tsx]"]
  node_auth["Sign-in and registration"]
  node_onboarding["Role onboarding"]
end

subgraph group_customer["Customer commerce"]
  node_customer_app["Customer storefront"]
  node_customer_order["Cart and orders"]
  node_taste_ui["Taste feedback<br/>[taste-feedback.tsx]"]
end

subgraph group_supply["Sourcing and operations"]
  node_manufacturer_app["Manufacturer workspace"]
  node_supplier_app["Supplier workspace"]
  node_procurement_ui["Procurement comparison"]
  node_procurement_tools["Procurement tools"]
  node_supplier_listing["Supplier listings"]
end

subgraph group_shared["Shared services"]
  node_taste_match["Taste matching<br/>[tasteMatcher.ts]"]
  node_ranking["FPO ranking"]
  node_shared_comms["Chat and notifications"]
  node_ui_components["Shared UI components"]
end

subgraph group_platform["Data and integrations"]
  node_state["Application state<br/>[useAppStore.ts]"]
  node_customer_repo["Customer data access"]
  node_b2b_repo["B2B data access"]
  node_manufacturer_repo["Manufacturer data access"]
  node_storage["File storage access<br/>[supabaseStorage.ts]"]
  node_supabase[("Supabase services<br/>[supabase.ts]")]
end

node_user(("App users"))

node_user -->|"opens app"| node_routing
node_routing -->|"reads state"| node_state
node_user -->|"signs in"| node_auth
node_auth -->|"updates state"| node_state
node_auth -->|"authenticates"| node_customer_repo
node_auth -.->|"continues to"| node_onboarding
node_onboarding -->|"updates state"| node_state
node_user -->|"shops"| node_customer_app
node_customer_app -->|"reads state"| node_state
node_customer_order -.->|"uses state"| node_state
node_customer_app -.->|"browses to"| node_customer_order
node_taste_ui -->|"updates state"| node_state
node_state -->|"parses profile"| node_taste_match
node_customer_repo -->|"parses attributes"| node_taste_match
node_user -->|"manages supply"| node_manufacturer_app
node_manufacturer_app -->|"uses state"| node_state
node_manufacturer_app -->|"ranks sourcing"| node_ranking
node_procurement_ui -->|"uses state"| node_state
node_procurement_ui -->|"evaluates offers"| node_ranking
node_procurement_ui -.->|"supports buying"| node_manufacturer_app
node_user -->|"fulfills supply"| node_supplier_app
node_supplier_app -->|"uses state"| node_state
node_supplier_app -->|"ranks sourcing"| node_ranking
node_supplier_listing -->|"updates state"| node_state
node_supplier_listing -->|"saves listing"| node_b2b_repo
node_supplier_listing -->|"uploads files"| node_storage
node_supplier_listing -->|"checks ranking"| node_ranking
node_supplier_app -.->|"publishes materials"| node_supplier_listing
node_manufacturer_app -.->|"opens tools"| node_procurement_tools
node_procurement_tools -->|"uses state"| node_state
node_user -->|"communicates"| node_shared_comms
node_shared_comms -->|"uses state"| node_state
node_state -->|"calls repository"| node_customer_repo
node_state -->|"calls repository"| node_b2b_repo
node_state -->|"calls repository"| node_manufacturer_repo
node_state -->|"uses engine"| node_ranking
node_customer_repo -->|"queries data"| node_supabase
node_b2b_repo -->|"queries data"| node_supabase
node_manufacturer_repo -->|"queries data"| node_supabase
node_manufacturer_repo -->|"fetches products"| node_customer_repo
node_manufacturer_repo -->|"signs document URLs"| node_storage
node_storage -->|"stores files"| node_supabase
node_ui_components -->|"reads shared state"| node_state

click node_routing "https://github.com/nihanth2006/pickle_bus/blob/main/app/_layout.tsx"
click node_auth "https://github.com/nihanth2006/pickle_bus/tree/main/app/auth"
click node_onboarding "https://github.com/nihanth2006/pickle_bus/tree/main/app/onboarding"
click node_customer_app "https://github.com/nihanth2006/pickle_bus/tree/main/app/customer"
click node_customer_order "https://github.com/nihanth2006/pickle_bus/tree/main/app/customer"
click node_taste_ui "https://github.com/nihanth2006/pickle_bus/blob/main/app/customer/taste-feedback.tsx"
click node_taste_match "https://github.com/nihanth2006/pickle_bus/blob/main/services/tasteMatcher.ts"
click node_manufacturer_app "https://github.com/nihanth2006/pickle_bus/tree/main/app/manufacturer"
click node_supplier_app "https://github.com/nihanth2006/pickle_bus/tree/main/app/supplier"
click node_procurement_ui "https://github.com/nihanth2006/pickle_bus/blob/main/app/manufacturer/quotation-comparison.tsx"
click node_ranking "https://github.com/nihanth2006/pickle_bus/blob/main/services/fpoRankingEngine.ts"
click node_shared_comms "https://github.com/nihanth2006/pickle_bus/tree/main/app/shared"
click node_state "https://github.com/nihanth2006/pickle_bus/blob/main/store/useAppStore.ts"
click node_customer_repo "https://github.com/nihanth2006/pickle_bus/blob/main/data/repositories/customerSupabaseRepository.ts"
click node_b2b_repo "https://github.com/nihanth2006/pickle_bus/blob/main/data/repositories/b2bSupabaseRepository.ts"
click node_manufacturer_repo "https://github.com/nihanth2006/pickle_bus/blob/main/data/repositories/manufacturerSupabaseRepository.ts"
click node_storage "https://github.com/nihanth2006/pickle_bus/blob/main/lib/supabaseStorage.ts"
click node_supabase "https://github.com/nihanth2006/pickle_bus/blob/main/lib/supabase.ts"
click node_procurement_tools "https://github.com/nihanth2006/pickle_bus/tree/main/app/manufacturer/tools"
click node_supplier_listing "https://github.com/nihanth2006/pickle_bus/blob/main/app/supplier/publish-raw-material.tsx"
click node_ui_components "https://github.com/nihanth2006/pickle_bus/tree/main/components/common"

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_routing,node_auth,node_onboarding,node_user toneBlue
class node_customer_app,node_customer_order,node_taste_ui toneAmber
class node_manufacturer_app,node_supplier_app,node_procurement_ui,node_procurement_tools,node_supplier_listing toneMint
class node_taste_match,node_ranking,node_shared_comms,node_ui_components toneRose
class node_state,node_customer_repo,node_b2b_repo,node_manufacturer_repo,node_storage,node_supabase toneIndigo
```

## Components

### App and onboarding

- [Role routing](https://github.com/nihanth2006/pickle_bus/blob/main/app/_layout.tsx): `app/_layout.tsx`
- [Sign-in and registration](https://github.com/nihanth2006/pickle_bus/tree/main/app/auth): `app/auth`
- [Role onboarding](https://github.com/nihanth2006/pickle_bus/tree/main/app/onboarding): `app/onboarding`

### Customer commerce

- [Customer storefront](https://github.com/nihanth2006/pickle_bus/tree/main/app/customer): `app/customer`
- [Cart and orders](https://github.com/nihanth2006/pickle_bus/tree/main/app/customer): `app/customer`
- [Taste feedback](https://github.com/nihanth2006/pickle_bus/blob/main/app/customer/taste-feedback.tsx): `app/customer/taste-feedback.tsx`

### Sourcing and operations

- [Manufacturer workspace](https://github.com/nihanth2006/pickle_bus/tree/main/app/manufacturer): `app/manufacturer`
- [Supplier workspace](https://github.com/nihanth2006/pickle_bus/tree/main/app/supplier): `app/supplier`
- [Procurement comparison](https://github.com/nihanth2006/pickle_bus/blob/main/app/manufacturer/quotation-comparison.tsx): `app/manufacturer/quotation-comparison.tsx`
- [Procurement tools](https://github.com/nihanth2006/pickle_bus/tree/main/app/manufacturer/tools): `app/manufacturer/tools`
- [Supplier listings](https://github.com/nihanth2006/pickle_bus/blob/main/app/supplier/publish-raw-material.tsx): `app/supplier/publish-raw-material.tsx`

### Shared services

- [Taste matching](https://github.com/nihanth2006/pickle_bus/blob/main/services/tasteMatcher.ts): `services/tasteMatcher.ts`
- [FPO ranking](https://github.com/nihanth2006/pickle_bus/blob/main/services/fpoRankingEngine.ts): `services/fpoRankingEngine.ts`
- [Chat and notifications](https://github.com/nihanth2006/pickle_bus/tree/main/app/shared): `app/shared`
- [Shared UI components](https://github.com/nihanth2006/pickle_bus/tree/main/components/common): `components/common`

### Data and integrations

- [Application state](https://github.com/nihanth2006/pickle_bus/blob/main/store/useAppStore.ts): `store/useAppStore.ts`
- [Customer data access](https://github.com/nihanth2006/pickle_bus/blob/main/data/repositories/customerSupabaseRepository.ts): `data/repositories/customerSupabaseRepository.ts`
- [B2B data access](https://github.com/nihanth2006/pickle_bus/blob/main/data/repositories/b2bSupabaseRepository.ts): `data/repositories/b2bSupabaseRepository.ts`
- [Manufacturer data access](https://github.com/nihanth2006/pickle_bus/blob/main/data/repositories/manufacturerSupabaseRepository.ts): `data/repositories/manufacturerSupabaseRepository.ts`
- [File storage access](https://github.com/nihanth2006/pickle_bus/blob/main/lib/supabaseStorage.ts): `lib/supabaseStorage.ts`
- [Supabase services](https://github.com/nihanth2006/pickle_bus/blob/main/lib/supabase.ts): `lib/supabase.ts`

### Other components

- **App users**

## Connections

- App users → Role routing: opens app
- Role routing → Application state: reads state
- App users → Sign-in and registration: signs in
- Sign-in and registration → Application state: updates state (evidence: `app/auth/login.tsx`)
- Sign-in and registration → Customer data access: authenticates (evidence: `app/auth/login.tsx`)
- Sign-in and registration → Role onboarding: continues to
- Role onboarding → Application state: updates state (evidence: `app/onboarding/index.tsx`)
- App users → Customer storefront: shops
- Customer storefront → Application state: reads state (evidence: `app/customer/(tabs)/index.tsx`)
- Cart and orders → Application state: uses state (evidence: `app/customer/taste-feedback.tsx`)
- Customer storefront → Cart and orders: browses to
- Taste feedback → Application state: updates state (evidence: `app/customer/taste-feedback.tsx`)
- Application state → Taste matching: parses profile (evidence: `store/useAppStore.ts`)
- Customer data access → Taste matching: parses attributes (evidence: `data/repositories/customerSupabaseRepository.ts`)
- App users → Manufacturer workspace: manages supply
- Manufacturer workspace → Application state: uses state (evidence: `app/manufacturer/(tabs)/index.tsx`)
- Manufacturer workspace → FPO ranking: ranks sourcing (evidence: `app/manufacturer/(tabs)/index.tsx`)
- Procurement comparison → Application state: uses state (evidence: `app/manufacturer/quotation-comparison.tsx`)
- Procurement comparison → FPO ranking: evaluates offers (evidence: `app/manufacturer/quotation-comparison.tsx`)
- Procurement comparison → Manufacturer workspace: supports buying
- App users → Supplier workspace: fulfills supply
- Supplier workspace → Application state: uses state (evidence: `app/supplier/(tabs)/index.tsx`)
- Supplier workspace → FPO ranking: ranks sourcing (evidence: `app/supplier/(tabs)/index.tsx`)
- Supplier listings → Application state: updates state (evidence: `app/supplier/publish-raw-material.tsx`)
- Supplier listings → B2B data access: saves listing (evidence: `app/supplier/publish-raw-material.tsx`)
- Supplier listings → File storage access: uploads files (evidence: `app/supplier/publish-raw-material.tsx`)
- Supplier listings → FPO ranking: checks ranking (evidence: `app/supplier/publish-raw-material.tsx`)
- Supplier workspace → Supplier listings: publishes materials
- Manufacturer workspace → Procurement tools: opens tools
- Procurement tools → Application state: uses state (evidence: `app/manufacturer/tools/cost-simulator.tsx`)
- App users → Chat and notifications: communicates
- Chat and notifications → Application state: uses state (evidence: `app/shared/chat.tsx`)
- Application state → Customer data access: calls repository (evidence: `store/useAppStore.ts`)
- Application state → B2B data access: calls repository (evidence: `store/useAppStore.ts`)
- Application state → Manufacturer data access: calls repository (evidence: `store/useAppStore.ts`)
- Application state → FPO ranking: uses engine (evidence: `store/useAppStore.ts`)
- Customer data access → Supabase services: queries data (evidence: `data/repositories/customerSupabaseRepository.ts`)
- B2B data access → Supabase services: queries data (evidence: `data/repositories/b2bSupabaseRepository.ts`)
- Manufacturer data access → Supabase services: queries data (evidence: `data/repositories/manufacturerSupabaseRepository.ts`)
- Manufacturer data access → Customer data access: fetches products (evidence: `data/repositories/manufacturerSupabaseRepository.ts`)
- Manufacturer data access → File storage access: signs document URLs (evidence: `data/repositories/manufacturerSupabaseRepository.ts`)
- File storage access → Supabase services: stores files (evidence: `lib/supabaseStorage.ts`)
- Shared UI components → Application state: reads shared state (evidence: `components/common/TopBar.tsx`)
