# lalitkumarjogi/inventory architecture

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

- Interactive diagram: https://gitdiagram.com/lalitkumarjogi/inventory
- Repository: https://github.com/lalitkumarjogi/inventory

## Overview

InventoryPro is a Google Apps Script inventory web app backed by Google Sheets. Users work through the dashboard and stock screens; the UI invokes server-side operations over google.script.run, which manage master data, purchase orders, receipts and stock movements. The README also documents caching, concurrency protection and duplicate-submission guards. Code.js is the only indexed core module; its excerpt is partial, so the detailed subsystem links below rely on README documentation rather than inspected implementation for several capabilities.

Main entry points: [`Code.js`](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js) (Apps Script RPC), [`Dashboard.html`](https://github.com/lalitkumarjogi/inventory/blob/master/Dashboard.html) (Dashboard UI), [`stock.html`](https://github.com/lalitkumarjogi/inventory/blob/master/stock.html) (Stock UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_dashboard["Dashboard UI<br/>[Dashboard.html]"]
  node_stock_ui["Stock UI<br/>[stock.html]"]
end

subgraph group_operations["Inventory operations"]
  node_rpc["Apps Script RPC<br/>[Code.js]"]
  node_master["Item and vendor setup<br/>[Code.js]"]
  node_po["Purchase orders<br/>[Code.js]"]
  node_receiving["Receiving and backorders<br/>[Code.js]"]
  node_movement["Stock movements<br/>[Code.js]"]
  node_audit["Stock adjustments<br/>[Code.js]"]
  node_reporting["Inventory summaries<br/>[Code.js]"]
end

subgraph group_reliability["Runtime safeguards"]
  node_cache["Chunked cache<br/>[Code.js]"]
  node_locks["Concurrency locks<br/>[Code.js]"]
  node_dedupe["Duplicate guard<br/>[Code.js]"]
end

subgraph group_storage["Data storage"]
  node_sheets[("Google Sheets")]
end

node_staff(("Inventory staff"))

node_staff -->|"uses"| node_dashboard
node_staff -->|"uses"| node_stock_ui
node_dashboard -->|"calls RPC"| node_rpc
node_stock_ui -->|"calls RPC"| node_rpc
node_rpc -->|"reads and writes"| node_sheets
node_rpc -->|"serves"| node_master
node_rpc -->|"serves"| node_po
node_rpc -->|"processes"| node_receiving
node_rpc -->|"processes"| node_movement
node_rpc -->|"processes"| node_audit
node_rpc -->|"serves"| node_reporting
node_rpc -->|"uses"| node_cache
node_rpc -->|"uses"| node_locks
node_rpc -->|"guards submissions"| node_dedupe
node_master -->|"stores master data"| node_sheets
node_po -->|"stores orders"| node_sheets
node_receiving -->|"updates receipts"| node_sheets
node_movement -->|"updates balances"| node_sheets
node_audit -->|"stores adjustments"| node_sheets
node_reporting -->|"reads summaries"| node_sheets

click node_dashboard "https://github.com/lalitkumarjogi/inventory/blob/master/Dashboard.html"
click node_stock_ui "https://github.com/lalitkumarjogi/inventory/blob/master/stock.html"
click node_rpc "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_master "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_po "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_receiving "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_movement "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_audit "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_reporting "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_cache "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_locks "https://github.com/lalitkumarjogi/inventory/blob/master/Code.js"
click node_dedupe "https://github.com/lalitkumarjogi/inventory/blob/master/Code.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_dashboard,node_stock_ui toneBlue
class node_rpc,node_master,node_po,node_receiving,node_movement,node_audit,node_reporting toneAmber
class node_cache,node_locks,node_dedupe toneMint
class node_sheets toneRose
class node_staff toneIndigo
```

## Components

### User interface

- [Dashboard UI](https://github.com/lalitkumarjogi/inventory/blob/master/Dashboard.html): `Dashboard.html`
- [Stock UI](https://github.com/lalitkumarjogi/inventory/blob/master/stock.html): `stock.html`

### Inventory operations

- [Apps Script RPC](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Item and vendor setup](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Purchase orders](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Receiving and backorders](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Stock movements](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Stock adjustments](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Inventory summaries](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`

### Runtime safeguards

- [Chunked cache](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Concurrency locks](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`
- [Duplicate guard](https://github.com/lalitkumarjogi/inventory/blob/master/Code.js): `Code.js`

### Data storage

- **Google Sheets**

### Other components

- **Inventory staff**

## Connections

- Inventory staff → Dashboard UI: uses (evidence: `README.md`)
- Inventory staff → Stock UI: uses (evidence: `README.md`)
- Dashboard UI → Apps Script RPC: calls RPC (evidence: `README.md`)
- Stock UI → Apps Script RPC: calls RPC (evidence: `README.md`)
- Apps Script RPC → Google Sheets: reads and writes (evidence: `README.md`)
- Apps Script RPC → Item and vendor setup: serves (evidence: `Code.js`)
- Apps Script RPC → Purchase orders: serves (evidence: `README.md`)
- Apps Script RPC → Receiving and backorders: processes (evidence: `README.md`)
- Apps Script RPC → Stock movements: processes (evidence: `Code.js`)
- Apps Script RPC → Stock adjustments: processes (evidence: `Code.js`)
- Apps Script RPC → Inventory summaries: serves (evidence: `Code.js`)
- Apps Script RPC → Chunked cache: uses (evidence: `README.md`)
- Apps Script RPC → Concurrency locks: uses (evidence: `README.md`)
- Apps Script RPC → Duplicate guard: guards submissions (evidence: `README.md`)
- Item and vendor setup → Google Sheets: stores master data (evidence: `README.md`)
- Purchase orders → Google Sheets: stores orders (evidence: `README.md`)
- Receiving and backorders → Google Sheets: updates receipts (evidence: `README.md`)
- Stock movements → Google Sheets: updates balances (evidence: `README.md`)
- Stock adjustments → Google Sheets: stores adjustments (evidence: `Code.js`)
- Inventory summaries → Google Sheets: reads summaries (evidence: `Code.js`)
