# parvincodes/kgcinventorymgmt architecture

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

- Interactive diagram: https://gitdiagram.com/parvincodes/kgcinventorymgmt
- Repository: https://github.com/parvincodes/kgcinventorymgmt

## Overview

Langar Pantry supports reviewers signing in, maintaining pantry items, recording weekly counts, reviewing an automatically drafted shopping list, and sharing it with the sewa family; family members can mark purchases without changing inventory. The graph combines explicit UI/API and scan calls with README-documented workflow links. Several server routes and screens are only partially sampled, so their interactions are included only where the README or excerpts support them.

Main entry points: [`client/src/App.tsx`](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/App.tsx) (App routing), [`client/src/api.ts`](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/api.ts) (API client), [`client/src/screens/List.tsx`](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/List.tsx) (Shopping list review), [`server/index.ts`](https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/index.ts) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_review["Reviewer experience"]
  node_home["Week dashboard<br/>[Home.tsx]"]
  node_login["PIN sign-in<br/>[Login.tsx]"]
  node_count["Weekly count<br/>[Count.tsx]"]
  node_catalog["Item catalog<br/>[Catalog.tsx]"]
  node_edit["Item editor<br/>[ItemEdit.tsx]"]
  node_photo_scan["Shelf photo scan<br/>[Scan.tsx]"]
  node_shopping["Shopping list review<br/>[List.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_routes["App routing<br/>[App.tsx]"]
end

subgraph group_family["Family shopping"]
  node_family_list["Family list<br/>[Family.tsx]"]
end

subgraph group_service["Pantry services"]
  node_http_api["HTTP API<br/>[index.ts]"]
  node_pantry_logic["Week and list rules<br/>[logic.ts]"]
  node_photo_logic["Photo identification<br/>[scan.ts]"]
  node_photo_store["Product photos<br/>[product-photos.ts]"]
end

subgraph group_state["Persistence and vocabulary"]
  node_glossary["Grocery glossary"]
  node_database[("SQLite pantry data<br/>[db.ts]")]
end

node_reviewer(("Reviewer"))
node_family_actor(("Sewa family"))
node_claude{{"Claude vision API"}}
node_whatsapp{{"WhatsApp"}}

node_reviewer -->|"signs in"| node_login
node_routes -->|"routes unauthenticated"| node_login
node_routes -->|"routes signed-in"| node_home
node_routes -->|"routes to"| node_count
node_routes -->|"routes to"| node_shopping
node_routes -->|"routes to"| node_catalog
node_routes -->|"routes to"| node_edit
node_routes -->|"routes to"| node_photo_scan
node_routes -->|"routes family link"| node_family_list
node_login -->|"calls"| node_api_client
node_home -->|"calls"| node_api_client
node_count -->|"calls"| node_api_client
node_catalog -->|"calls"| node_api_client
node_edit -->|"calls"| node_api_client
node_photo_scan -->|"submits scan"| node_api_client
node_shopping -->|"updates list"| node_api_client
node_family_list -->|"calls"| node_api_client
node_api_client -.->|"sends HTTP requests"| node_http_api
node_http_api -->|"calls"| node_pantry_logic
node_http_api -->|"calls"| node_photo_logic
node_http_api -->|"reads and saves photos"| node_photo_store
node_pantry_logic -->|"reads and writes"| node_database
node_photo_logic -->|"reads catalog"| node_database
node_photo_logic -->|"normalizes names"| node_glossary
node_photo_logic -->|"requests identification"| node_claude
node_photo_scan -->|"confirmed items saved"| node_catalog
node_count -->|"count drafts list"| node_shopping
node_shopping -->|"shares approved list"| node_whatsapp
node_family_actor -->|"opens shared link"| node_family_list
node_family_list -.->|"updates purchase status"| node_shopping

click node_home "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Home.tsx"
click node_login "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Login.tsx"
click node_count "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Count.tsx"
click node_catalog "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Catalog.tsx"
click node_edit "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/ItemEdit.tsx"
click node_photo_scan "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Scan.tsx"
click node_shopping "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/List.tsx"
click node_family_list "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Family.tsx"
click node_api_client "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/api.ts"
click node_routes "https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/App.tsx"
click node_http_api "https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/index.ts"
click node_pantry_logic "https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/logic.ts"
click node_photo_logic "https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/scan.ts"
click node_photo_store "https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/product-photos.ts"
click node_glossary "https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/grocery-glossary.ts"
click node_database "https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/db.ts"

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_count,node_catalog,node_edit,node_photo_scan,node_shopping,node_api_client,node_routes,node_reviewer toneBlue
class node_family_list toneAmber
class node_http_api,node_pantry_logic,node_photo_logic,node_photo_store,node_claude toneMint
class node_glossary,node_database toneRose
class node_family_actor,node_whatsapp toneIndigo
```

## Components

### Reviewer experience

- [Week dashboard](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Home.tsx): `client/src/screens/Home.tsx`
- [PIN sign-in](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Login.tsx): `client/src/screens/Login.tsx`
- [Weekly count](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Count.tsx): `client/src/screens/Count.tsx`
- [Item catalog](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Catalog.tsx): `client/src/screens/Catalog.tsx`
- [Item editor](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/ItemEdit.tsx): `client/src/screens/ItemEdit.tsx`
- [Shelf photo scan](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Scan.tsx): `client/src/screens/Scan.tsx`
- [Shopping list review](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/List.tsx): `client/src/screens/List.tsx`
- [API client](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/api.ts): `client/src/api.ts`
- [App routing](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/App.tsx): `client/src/App.tsx`

### Family shopping

- [Family list](https://github.com/parvincodes/kgcinventorymgmt/blob/main/client/src/screens/Family.tsx): `client/src/screens/Family.tsx`

### Pantry services

- [HTTP API](https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/index.ts): `server/index.ts`
- [Week and list rules](https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/logic.ts): `server/logic.ts`
- [Photo identification](https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/scan.ts): `server/scan.ts`
- [Product photos](https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/product-photos.ts): `server/product-photos.ts`

### Persistence and vocabulary

- [Grocery glossary](https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/grocery-glossary.ts): `server/grocery-glossary.ts`
- [SQLite pantry data](https://github.com/parvincodes/kgcinventorymgmt/blob/main/server/db.ts): `server/db.ts`

### Other components

- **Reviewer**
- **Sewa family**
- **Claude vision API**
- **WhatsApp**

## Connections

- Reviewer → PIN sign-in: signs in (evidence: `README.md`)
- App routing → PIN sign-in: routes unauthenticated (evidence: `client/src/App.tsx`)
- App routing → Week dashboard: routes signed-in (evidence: `client/src/App.tsx`)
- App routing → Weekly count: routes to (evidence: `client/src/App.tsx`)
- App routing → Shopping list review: routes to (evidence: `client/src/App.tsx`)
- App routing → Item catalog: routes to (evidence: `client/src/App.tsx`)
- App routing → Item editor: routes to (evidence: `client/src/App.tsx`)
- App routing → Shelf photo scan: routes to (evidence: `client/src/App.tsx`)
- App routing → Family list: routes family link (evidence: `client/src/App.tsx`)
- PIN sign-in → API client: calls (evidence: `client/src/screens/Login.tsx`)
- Week dashboard → API client: calls (evidence: `client/src/screens/Home.tsx`)
- Weekly count → API client: calls (evidence: `client/src/screens/Count.tsx`)
- Item catalog → API client: calls (evidence: `client/src/screens/Catalog.tsx`)
- Item editor → API client: calls (evidence: `client/src/screens/ItemEdit.tsx`)
- Shelf photo scan → API client: submits scan (evidence: `client/src/screens/Scan.tsx`)
- Shopping list review → API client: updates list (evidence: `client/src/screens/List.tsx`)
- Family list → API client: calls (evidence: `client/src/screens/Family.tsx`)
- API client → HTTP API: sends HTTP requests
- HTTP API → Week and list rules: calls (evidence: `server/index.ts`)
- HTTP API → Photo identification: calls (evidence: `server/index.ts`)
- HTTP API → Product photos: reads and saves photos (evidence: `server/index.ts`)
- Week and list rules → SQLite pantry data: reads and writes (evidence: `server/logic.ts`)
- Photo identification → SQLite pantry data: reads catalog (evidence: `server/scan.ts`)
- Photo identification → Grocery glossary: normalizes names (evidence: `server/scan.ts`)
- Photo identification → Claude vision API: requests identification (evidence: `README.md`)
- Shelf photo scan → Item catalog: confirmed items saved (evidence: `README.md`)
- Weekly count → Shopping list review: count drafts list (evidence: `README.md`)
- Shopping list review → WhatsApp: shares approved list (evidence: `README.md`)
- Sewa family → Family list: opens shared link (evidence: `README.md`)
- Family list → Shopping list review: updates purchase status
