# kishore1700/smart-procurement-system architecture

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

- Interactive diagram: https://gitdiagram.com/kishore1700/smart-procurement-system
- Repository: https://github.com/kishore1700/smart-procurement-system

## Overview

ProcureSmart is a procurement-management web application. Its visible domain spans purchase requests and approvals, quotations and purchase orders, then deliveries and invoices, with budget, vendor, reporting, and administration capabilities alongside that workflow. The sampled runtime shows a client-side global store backed largely by a localStorage mock database, with Supabase used for user lookup and sign-out; payment order creation calls Razorpay. Most route-page implementations were not excerpted, so their workflow links are shown as unverified.

Main entry points: [`src/lib/stores/globalStore.svelte.js`](https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/stores/globalStore.svelte.js) (Session and UI state), [`src/routes/+layout.svelte`](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/%2Blayout.svelte) (Root layout), [`src/routes/(dashboard)/+layout.svelte`](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/%2Blayout.svelte) (Dashboard shell), [`src/routes/(dashboard)/purchase-requests/+page.svelte`](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/purchase-requests/%2Bpage.svelte) (Purchase requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_home["Home<br/>[+page.svelte]"]
  node_login["Login<br/>[+page.svelte]"]
  node_dashboard_shell["Dashboard shell<br/>[+layout.svelte]"]
  node_root_layout["Root layout<br/>[+layout.svelte]"]
  node_toast["Toast UI<br/>[Toast.svelte]"]
end

subgraph group_procurement["Procurement workflow"]
  node_requests["Purchase requests<br/>[+page.svelte]"]
  node_approvals["Approvals<br/>[+page.svelte]"]
  node_quotations["Quotations<br/>[+page.svelte]"]
  node_purchase_orders["Purchase orders<br/>[+page.svelte]"]
  node_deliveries["Deliveries<br/>[+page.svelte]"]
  node_invoices["Invoices<br/>[+page.svelte]"]
end

subgraph group_oversight["Oversight"]
  node_budget["Budget<br/>[+page.svelte]"]
  node_vendors["Vendors<br/>[+page.svelte]"]
  node_reports["Reports<br/>[+page.svelte]"]
  node_admin["Administration<br/>[+page.svelte]"]
  node_dashboard["Dashboard<br/>[+page.svelte]"]
end

subgraph group_runtime["Client runtime"]
  node_global_store["Session and UI state"]
  node_mock_db[("Mock data store<br/>[mockDb.svelte.js]")]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_create_order["Create payment order<br/>[+server.js]"]
  node_verify_payment["Verify payment<br/>[+server.js]"]
end

node_user(("App user"))
node_razorpay["Razorpay"]

node_user -.->|"opens"| node_home
node_user -.->|"authenticates"| node_login
node_user -.->|"uses"| node_dashboard_shell
node_dashboard_shell -.->|"navigates"| node_requests
node_requests -.->|"submits for review"| node_approvals
node_approvals -.->|"advances to sourcing"| node_quotations
node_quotations -.->|"selects offer"| node_purchase_orders
node_purchase_orders -.->|"tracks fulfillment"| node_deliveries
node_deliveries -.->|"records billing"| node_invoices
node_root_layout -->|"renders"| node_toast
node_root_layout -->|"reads theme"| node_global_store
node_global_store -->|"reads and writes"| node_mock_db
node_global_store -->|"queries and signs out"| node_supabase_client
node_create_order -->|"creates order"| node_razorpay

click node_home "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/%2Bpage.svelte"
click node_login "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/login/%2Bpage.svelte"
click node_dashboard_shell "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/%2Blayout.svelte"
click node_requests "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/purchase-requests/%2Bpage.svelte"
click node_approvals "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/approvals/%2Bpage.svelte"
click node_quotations "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/quotations/%2Bpage.svelte"
click node_purchase_orders "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/purchase-orders/%2Bpage.svelte"
click node_deliveries "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/deliveries/%2Bpage.svelte"
click node_invoices "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/invoices/%2Bpage.svelte"
click node_budget "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/budget/%2Bpage.svelte"
click node_vendors "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/vendors/%2Bpage.svelte"
click node_reports "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/reports/%2Bpage.svelte"
click node_admin "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/admin/%2Bpage.svelte"
click node_dashboard "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/dashboard/%2Bpage.svelte"
click node_global_store "https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/stores/globalStore.svelte.js"
click node_mock_db "https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/db/mockDb.svelte.js"
click node_supabase_client "https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/supabase.js"
click node_root_layout "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/%2Blayout.svelte"
click node_toast "https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/components/ui/Toast.svelte"
click node_create_order "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/api/payment/create-order/%2Bserver.js"
click node_verify_payment "https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/api/payment/verify/%2Bserver.js"

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_login,node_dashboard_shell,node_root_layout,node_toast,node_user toneBlue
class node_requests,node_approvals,node_quotations,node_purchase_orders,node_deliveries,node_invoices toneAmber
class node_budget,node_vendors,node_reports,node_admin,node_dashboard toneMint
class node_global_store,node_mock_db,node_supabase_client,node_create_order,node_verify_payment toneRose
class node_razorpay toneIndigo
```

## Components

### App experience

- [Home](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/%2Bpage.svelte): `src/routes/+page.svelte`
- [Login](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/login/%2Bpage.svelte): `src/routes/login/+page.svelte`
- [Dashboard shell](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/%2Blayout.svelte): `src/routes/(dashboard)/+layout.svelte`
- [Root layout](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/%2Blayout.svelte): `src/routes/+layout.svelte`
- [Toast UI](https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/components/ui/Toast.svelte): `src/lib/components/ui/Toast.svelte`

### Procurement workflow

- [Purchase requests](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/purchase-requests/%2Bpage.svelte): `src/routes/(dashboard)/purchase-requests/+page.svelte`
- [Approvals](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/approvals/%2Bpage.svelte): `src/routes/(dashboard)/approvals/+page.svelte`
- [Quotations](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/quotations/%2Bpage.svelte): `src/routes/(dashboard)/quotations/+page.svelte`
- [Purchase orders](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/purchase-orders/%2Bpage.svelte): `src/routes/(dashboard)/purchase-orders/+page.svelte`
- [Deliveries](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/deliveries/%2Bpage.svelte): `src/routes/(dashboard)/deliveries/+page.svelte`
- [Invoices](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/invoices/%2Bpage.svelte): `src/routes/(dashboard)/invoices/+page.svelte`

### Oversight

- [Budget](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/budget/%2Bpage.svelte): `src/routes/(dashboard)/budget/+page.svelte`
- [Vendors](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/vendors/%2Bpage.svelte): `src/routes/(dashboard)/vendors/+page.svelte`
- [Reports](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/reports/%2Bpage.svelte): `src/routes/(dashboard)/reports/+page.svelte`
- [Administration](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/admin/%2Bpage.svelte): `src/routes/(dashboard)/admin/+page.svelte`
- [Dashboard](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/(dashboard)/dashboard/%2Bpage.svelte): `src/routes/(dashboard)/dashboard/+page.svelte`

### Client runtime

- [Session and UI state](https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/stores/globalStore.svelte.js): `src/lib/stores/globalStore.svelte.js`
- [Mock data store](https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/db/mockDb.svelte.js): `src/lib/db/mockDb.svelte.js`
- [Supabase client](https://github.com/kishore1700/smart-procurement-system/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [Create payment order](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/api/payment/create-order/%2Bserver.js): `src/routes/api/payment/create-order/+server.js`
- [Verify payment](https://github.com/kishore1700/smart-procurement-system/blob/main/src/routes/api/payment/verify/%2Bserver.js): `src/routes/api/payment/verify/+server.js`

### Other components

- **App user**
- **Razorpay**

## Connections

- App user → Home: opens
- App user → Login: authenticates
- App user → Dashboard shell: uses
- Dashboard shell → Purchase requests: navigates
- Purchase requests → Approvals: submits for review
- Approvals → Quotations: advances to sourcing
- Quotations → Purchase orders: selects offer
- Purchase orders → Deliveries: tracks fulfillment
- Deliveries → Invoices: records billing
- Root layout → Toast UI: renders (evidence: `src/routes/+layout.svelte`)
- Root layout → Session and UI state: reads theme (evidence: `src/routes/+layout.svelte`)
- Session and UI state → Mock data store: reads and writes (evidence: `src/lib/stores/globalStore.svelte.js`)
- Session and UI state → Supabase client: queries and signs out (evidence: `src/lib/stores/globalStore.svelte.js`)
- Create payment order → Razorpay: creates order (evidence: `src/routes/api/payment/create-order/+server.js`)
