# vibeswithraj/smart-inventory-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/vibeswithraj/smart-inventory-management-system
- Repository: https://github.com/vibeswithraj/smart-inventory-management-system

## Overview

Smart Inventory is a full-stack inventory dashboard with a Next.js interface, Express API, and SQLite persistence. The principal workflow is a manager viewing inventory totals, stock movements, alerts, suggestions, vendors, and trends; the dashboard requests dashboard, vendor, and analytics data from the API. The API also exposes product search and creation and stock adjustment. The excerpts establish API-to-database calls and dashboard fetches, but do not show the internals of every database query or any frontend product-editing flow.

Main entry points: [`backend/src/server.js`](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/server.js) (Express API routes), [`backend/src/db.js`](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js) (SQLite inventory store), [`frontend/src/app/page.tsx`](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/frontend/src/app/page.tsx) (Inventory dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard interface"]
  node_dashboard["Inventory dashboard<br/>[page.tsx]"]
end

subgraph group_service["Inventory API"]
  node_api["Express API routes<br/>[server.js]"]
end

subgraph group_data["Inventory data"]
  node_dashboarddata["Dashboard snapshot<br/>[db.js]"]
  node_products["Product catalog<br/>[db.js]"]
  node_stock["Stock adjustments<br/>[db.js]"]
  node_vendors["Vendor directory<br/>[db.js]"]
  node_analytics["Inventory analytics<br/>[db.js]"]
  node_sqlite[("SQLite inventory store<br/>[db.js]")]
end

node_manager(("Inventory manager"))

node_manager -->|"views"| node_dashboard
node_dashboard -->|"requests dashboard data"| node_api
node_dashboard -->|"requests vendors"| node_api
node_dashboard -->|"requests analytics"| node_api
node_api -->|"calls snapshot"| node_dashboarddata
node_api -->|"calls product queries"| node_products
node_api -->|"calls stock adjustment"| node_stock
node_api -->|"calls vendor query"| node_vendors
node_api -->|"calls analytics query"| node_analytics
node_dashboarddata -->|"reads and writes"| node_sqlite
node_products -->|"reads and writes"| node_sqlite
node_stock -->|"updates stock and movements"| node_sqlite
node_vendors -->|"reads vendors"| node_sqlite
node_analytics -->|"reads products"| node_sqlite

click node_dashboard "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/frontend/src/app/page.tsx"
click node_api "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/server.js"
click node_dashboarddata "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js"
click node_products "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js"
click node_stock "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js"
click node_vendors "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js"
click node_analytics "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js"
click node_sqlite "https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.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 toneBlue
class node_api toneAmber
class node_dashboarddata,node_products,node_stock,node_vendors,node_analytics,node_sqlite toneMint
class node_manager toneIndigo
```

## Components

### Dashboard interface

- [Inventory dashboard](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`

### Inventory API

- [Express API routes](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/server.js): `backend/src/server.js`

### Inventory data

- [Dashboard snapshot](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js): `backend/src/db.js`
- [Product catalog](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js): `backend/src/db.js`
- [Stock adjustments](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js): `backend/src/db.js`
- [Vendor directory](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js): `backend/src/db.js`
- [Inventory analytics](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js): `backend/src/db.js`
- [SQLite inventory store](https://github.com/vibeswithraj/smart-inventory-management-system/blob/main/backend/src/db.js): `backend/src/db.js`

### Other components

- **Inventory manager**

## Connections

- Inventory manager → Inventory dashboard: views (evidence: `README.md`)
- Inventory dashboard → Express API routes: requests dashboard data (evidence: `frontend/src/app/page.tsx`)
- Inventory dashboard → Express API routes: requests vendors (evidence: `frontend/src/app/page.tsx`)
- Inventory dashboard → Express API routes: requests analytics (evidence: `frontend/src/app/page.tsx`)
- Express API routes → Dashboard snapshot: calls snapshot (evidence: `backend/src/server.js`)
- Express API routes → Product catalog: calls product queries (evidence: `backend/src/server.js`)
- Express API routes → Stock adjustments: calls stock adjustment (evidence: `backend/src/server.js`)
- Express API routes → Vendor directory: calls vendor query (evidence: `backend/src/server.js`)
- Express API routes → Inventory analytics: calls analytics query (evidence: `backend/src/server.js`)
- Dashboard snapshot → SQLite inventory store: reads and writes (evidence: `backend/src/db.js`)
- Product catalog → SQLite inventory store: reads and writes (evidence: `backend/src/db.js`)
- Stock adjustments → SQLite inventory store: updates stock and movements (evidence: `backend/src/db.js`)
- Vendor directory → SQLite inventory store: reads vendors (evidence: `backend/src/db.js`)
- Inventory analytics → SQLite inventory store: reads products (evidence: `backend/src/db.js`)
