# pupariaa/ivx-inventory architecture

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

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

## Overview

IVX is a desktop inventory-management application. Users manage categories and products, record stock movements, review dashboard and client information, and configure or print product labels; scanning and reporting provide additional workflows. The React interface is hosted by an Electron main process, with SQLite-backed data and printer, scan, settings, and subscription services. The README is empty, so product capabilities are inferred from the source index, routes, and sampled code; several renderer-to-main IPC details and unsampled feature implementations are not shown.

Main entry points: [`src/App.tsx`](https://github.com/pupariaa/ivx-inventory/blob/main/src/App.tsx) (Route shell), [`electron/main.ts`](https://github.com/pupariaa/ivx-inventory/blob/main/electron/main.ts) (Electron main process), [`electron/printer.ts`](https://github.com/pupariaa/ivx-inventory/blob/main/electron/printer.ts) (Printer orchestration), [`electron/database.ts`](https://github.com/pupariaa/ivx-inventory/blob/main/electron/database.ts) (SQLite inventory store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_renderer["Inventory interface"]
  node_app["Route shell<br/>[App.tsx]"]
  node_layout["Navigation and scanning UI<br/>[Layout.tsx]"]
end

subgraph group_domain["Inventory workflows"]
  node_categories["Category management<br/>[Categories.tsx]"]
  node_category_detail["Category details<br/>[CategoryDetail.tsx]"]
  node_category_edit["Category and label setup<br/>[CategoryEdit.tsx]"]
  node_products["Product records<br/>[ProductForm.tsx]"]
  node_product_detail["Product details<br/>[ProductDetail.tsx]"]
  node_stock["Stock movements<br/>[StockEntryForm.tsx]"]
  node_stock_out["Stock outflow<br/>[StockOutForm.tsx]"]
  node_clients["Client records<br/>[Clients.tsx]"]
end

subgraph group_desktop["Desktop services"]
  node_electron_main["Electron main process<br/>[main.ts]"]
  node_database[("SQLite inventory store<br/>[database.ts]")]
  node_ai["AI assistance<br/>[ai.ts]"]
  node_settings["Application settings<br/>[settings.ts]"]
end

subgraph group_devices["Device operations"]
  node_impression["Label printing screen<br/>[Impression.tsx]"]
  node_scan_resolve["Scan product resolution<br/>[scan-resolve.ts]"]
  node_printer["Printer orchestration<br/>[printer.ts]"]
  node_printer_settings["Printer settings"]
  node_m120_driver["Phomemo M120 driver"]
  node_label_editor["Label editor"]
end

subgraph group_insights["Analytics and reporting"]
  node_dashboard["Dashboard view<br/>[Dashboard.tsx]"]
  node_metrics["Dashboard metrics"]
  node_custom_widgets["Custom dashboard widgets"]
  node_analytics["Usage analytics<br/>[analytics.ts]"]
end

node_user(("Inventory user"))
node_external_analytics[("Analytics endpoint")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_categories
node_app -->|"routes to"| node_category_detail
node_app -->|"routes to"| node_category_edit
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_product_detail
node_app -->|"routes to"| node_stock
node_app -->|"routes to"| node_stock_out
node_app -->|"routes to"| node_clients
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_impression
node_app -->|"renders"| node_layout
node_layout -.->|"requests scan"| node_electron_main
node_electron_main -->|"uses"| node_database
node_electron_main -->|"resolves scans"| node_scan_resolve
node_electron_main -->|"loads AI settings"| node_settings
node_electron_main -->|"prints labels"| node_printer
node_electron_main -->|"loads settings"| node_printer_settings
node_electron_main -->|"registers service"| node_ai
node_printer -->|"loads settings"| node_printer_settings
node_printer -->|"uses driver"| node_m120_driver
node_electron_main -->|"reads products"| node_database
node_electron_main -->|"writes photos"| node_database
node_category_edit -->|"uses editor"| node_label_editor
node_dashboard -.->|"computes metrics"| node_metrics
node_custom_widgets -->|"uses metrics"| node_metrics
node_clients -->|"tracks usage"| node_analytics
node_analytics -->|"posts batches"| node_external_analytics

click node_app "https://github.com/pupariaa/ivx-inventory/blob/main/src/App.tsx"
click node_layout "https://github.com/pupariaa/ivx-inventory/blob/main/src/components/Layout.tsx"
click node_categories "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Categories.tsx"
click node_category_detail "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/CategoryDetail.tsx"
click node_category_edit "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/CategoryEdit.tsx"
click node_products "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/ProductForm.tsx"
click node_product_detail "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/ProductDetail.tsx"
click node_stock "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/StockEntryForm.tsx"
click node_stock_out "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/StockOutForm.tsx"
click node_clients "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Clients.tsx"
click node_dashboard "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Dashboard.tsx"
click node_metrics "https://github.com/pupariaa/ivx-inventory/blob/main/src/lib/dashboard-metrics.ts"
click node_custom_widgets "https://github.com/pupariaa/ivx-inventory/blob/main/src/lib/dashboard-custom.ts"
click node_impression "https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Impression.tsx"
click node_electron_main "https://github.com/pupariaa/ivx-inventory/blob/main/electron/main.ts"
click node_database "https://github.com/pupariaa/ivx-inventory/blob/main/electron/database.ts"
click node_scan_resolve "https://github.com/pupariaa/ivx-inventory/blob/main/electron/scan-resolve.ts"
click node_printer "https://github.com/pupariaa/ivx-inventory/blob/main/electron/printer.ts"
click node_printer_settings "https://github.com/pupariaa/ivx-inventory/blob/main/electron/printer-settings.ts"
click node_m120_driver "https://github.com/pupariaa/ivx-inventory/blob/main/electron/phomemo-m120-dll.ts"
click node_ai "https://github.com/pupariaa/ivx-inventory/blob/main/electron/ai.ts"
click node_settings "https://github.com/pupariaa/ivx-inventory/blob/main/electron/settings.ts"
click node_analytics "https://github.com/pupariaa/ivx-inventory/blob/main/src/lib/analytics.ts"
click node_label_editor "https://github.com/pupariaa/ivx-inventory/blob/main/src/components/label-editors/LabelEditorD11s_12x22.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_app,node_layout,node_user toneBlue
class node_categories,node_category_detail,node_category_edit,node_products,node_product_detail,node_stock,node_stock_out,node_clients,node_external_analytics toneAmber
class node_electron_main,node_database,node_ai,node_settings toneMint
class node_impression,node_scan_resolve,node_printer,node_printer_settings,node_m120_driver,node_label_editor toneRose
class node_dashboard,node_metrics,node_custom_widgets,node_analytics toneIndigo
```

## Components

### Inventory interface

- [Route shell](https://github.com/pupariaa/ivx-inventory/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation and scanning UI](https://github.com/pupariaa/ivx-inventory/blob/main/src/components/Layout.tsx): `src/components/Layout.tsx`

### Inventory workflows

- [Category management](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Categories.tsx): `src/pages/Categories.tsx`
- [Category details](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/CategoryDetail.tsx): `src/pages/CategoryDetail.tsx`
- [Category and label setup](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/CategoryEdit.tsx): `src/pages/CategoryEdit.tsx`
- [Product records](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/ProductForm.tsx): `src/pages/ProductForm.tsx`
- [Product details](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/ProductDetail.tsx): `src/pages/ProductDetail.tsx`
- [Stock movements](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/StockEntryForm.tsx): `src/pages/StockEntryForm.tsx`
- [Stock outflow](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/StockOutForm.tsx): `src/pages/StockOutForm.tsx`
- [Client records](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Clients.tsx): `src/pages/Clients.tsx`

### Desktop services

- [Electron main process](https://github.com/pupariaa/ivx-inventory/blob/main/electron/main.ts): `electron/main.ts`
- [SQLite inventory store](https://github.com/pupariaa/ivx-inventory/blob/main/electron/database.ts): `electron/database.ts`
- [AI assistance](https://github.com/pupariaa/ivx-inventory/blob/main/electron/ai.ts): `electron/ai.ts`
- [Application settings](https://github.com/pupariaa/ivx-inventory/blob/main/electron/settings.ts): `electron/settings.ts`

### Device operations

- [Label printing screen](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Impression.tsx): `src/pages/Impression.tsx`
- [Scan product resolution](https://github.com/pupariaa/ivx-inventory/blob/main/electron/scan-resolve.ts): `electron/scan-resolve.ts`
- [Printer orchestration](https://github.com/pupariaa/ivx-inventory/blob/main/electron/printer.ts): `electron/printer.ts`
- [Printer settings](https://github.com/pupariaa/ivx-inventory/blob/main/electron/printer-settings.ts): `electron/printer-settings.ts`
- [Phomemo M120 driver](https://github.com/pupariaa/ivx-inventory/blob/main/electron/phomemo-m120-dll.ts): `electron/phomemo-m120-dll.ts`
- [Label editor](https://github.com/pupariaa/ivx-inventory/blob/main/src/components/label-editors/LabelEditorD11s_12x22.tsx): `src/components/label-editors/LabelEditorD11s_12x22.tsx`

### Analytics and reporting

- [Dashboard view](https://github.com/pupariaa/ivx-inventory/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Dashboard metrics](https://github.com/pupariaa/ivx-inventory/blob/main/src/lib/dashboard-metrics.ts): `src/lib/dashboard-metrics.ts`
- [Custom dashboard widgets](https://github.com/pupariaa/ivx-inventory/blob/main/src/lib/dashboard-custom.ts): `src/lib/dashboard-custom.ts`
- [Usage analytics](https://github.com/pupariaa/ivx-inventory/blob/main/src/lib/analytics.ts): `src/lib/analytics.ts`

### Other components

- **Inventory user**
- **Analytics endpoint**

## Connections

- Inventory user → Route shell: uses
- Route shell → Category management: routes to (evidence: `src/App.tsx`)
- Route shell → Category details: routes to (evidence: `src/App.tsx`)
- Route shell → Category and label setup: routes to (evidence: `src/App.tsx`)
- Route shell → Product records: routes to (evidence: `src/App.tsx`)
- Route shell → Product details: routes to (evidence: `src/App.tsx`)
- Route shell → Stock movements: routes to (evidence: `src/App.tsx`)
- Route shell → Stock outflow: routes to (evidence: `src/App.tsx`)
- Route shell → Client records: routes to (evidence: `src/App.tsx`)
- Route shell → Dashboard view: routes to (evidence: `src/App.tsx`)
- Route shell → Label printing screen: routes to (evidence: `src/App.tsx`)
- Route shell → Navigation and scanning UI: renders (evidence: `src/App.tsx`)
- Navigation and scanning UI → Electron main process: requests scan
- Electron main process → SQLite inventory store: uses (evidence: `electron/main.ts`)
- Electron main process → Scan product resolution: resolves scans (evidence: `electron/main.ts`)
- Electron main process → Application settings: loads AI settings (evidence: `electron/main.ts`)
- Electron main process → Printer orchestration: prints labels (evidence: `electron/main.ts`)
- Electron main process → Printer settings: loads settings (evidence: `electron/main.ts`)
- Electron main process → AI assistance: registers service (evidence: `electron/main.ts`)
- Printer orchestration → Printer settings: loads settings (evidence: `electron/printer.ts`)
- Printer orchestration → Phomemo M120 driver: uses driver (evidence: `electron/printer.ts`)
- Electron main process → SQLite inventory store: reads products (evidence: `electron/main.ts`)
- Electron main process → SQLite inventory store: writes photos (evidence: `electron/main.ts`)
- Category and label setup → Label editor: uses editor (evidence: `src/pages/CategoryEdit.tsx`)
- Dashboard view → Dashboard metrics: computes metrics
- Custom dashboard widgets → Dashboard metrics: uses metrics (evidence: `src/lib/dashboard-custom.ts`)
- Client records → Usage analytics: tracks usage (evidence: `src/pages/Clients.tsx`)
- Usage analytics → Analytics endpoint: posts batches (evidence: `src/lib/analytics.ts`)
