# blinkkishi-del/salesinventoryapp architecture

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

- Interactive diagram: https://gitdiagram.com/blinkkishi-del/salesinventoryapp
- Repository: https://github.com/blinkkishi-del/salesinventoryapp

## Overview

This is a Windows Forms sales-and-inventory application: staff sign in, then administrators manage inventory and view reports while cashiers build a cart, take payment, record sales, and print receipts. The sampled code shows sales recording and stock deduction through controllers and repositories; the cart is persisted separately. Product persistence uses SQL Server tables and stored procedures. Several UI and repository connections are supported only by the SOURCE INDEX, so edges are limited to those references; unsampled report, stock, and database behavior is not inferred.

Main entry points: [`UI/PointofSales.cs`](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/PointofSales.cs) (Point of Sale), [`BusinessLogic/Controller/ProductController.cs`](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/ProductController.cs) (Product Controller), [`UI/Login.cs`](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/Login.cs) (Login), [`UI/AdminDashboard.cs`](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/AdminDashboard.cs) (Admin Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop UI"]
  node_login["Login<br/>[Login.cs]"]
  node_admin["Admin Dashboard<br/>[AdminDashboard.cs]"]
  node_cashier["Cashier Dashboard"]
  node_inventory["Inventory Management"]
  node_stockreport["Stock Report<br/>[StockReport.cs]"]
  node_salesreport["Sales Report<br/>[SalesReport.cs]"]
  node_pos["Point of Sale<br/>[PointofSales.cs]"]
end

subgraph group_logic["Business Logic"]
  node_userctrl["User Controller<br/>[UserController.cs]"]
  node_productctrl["Product Controller"]
  node_orderctrl["Order Controller"]
  node_salesctrl["Sales Controller<br/>[SalesController.cs]"]
  node_stockctrl["Stock Controller<br/>[StockController.cs]"]
end

subgraph group_data["Persistence"]
  node_userrepo["User Repository<br/>[UserRepository.cs]"]
  node_productrepo["Product Repository"]
  node_orderrepo["Order Repository"]
  node_salesrepo["Sales Repository<br/>[SalesRepository.cs]"]
  node_stockrepo["Stock Repository<br/>[StockRepository.cs]"]
  node_productdb[("Product SQL<br/>[tblProduct.sql]")]
  node_orderdb[("Order SQL")]
  node_salesdb[("Sales SQL<br/>[tblSales.sql]")]
end

subgraph group_models["Domain Models"]
  node_productmodel["Product Details"]
  node_ordermodel["Order Item"]
  node_usermodel["User<br/>[UserModel.cs]"]
end

node_staff(("Staff"))

node_staff -->|"signs in"| node_login
node_login -->|"validates login"| node_userctrl
node_userctrl -->|"checks credentials"| node_userrepo
node_login -->|"opens admin"| node_admin
node_login -->|"opens cashier"| node_cashier
node_admin -->|"opens inventory"| node_inventory
node_admin -->|"opens report"| node_stockreport
node_admin -->|"opens report"| node_salesreport
node_cashier -->|"opens sales"| node_pos
node_inventory -->|"uses products"| node_productctrl
node_stockreport -->|"requests stock"| node_stockctrl
node_salesreport -->|"requests sales"| node_salesctrl
node_pos -->|"loads products"| node_productctrl
node_pos -->|"manages cart"| node_orderctrl
node_pos -->|"records checkout"| node_salesctrl
node_productctrl -->|"delegates product work"| node_productrepo
node_orderctrl -->|"delegates cart work"| node_orderrepo
node_salesctrl -->|"records and queries"| node_salesrepo
node_salesctrl -->|"deducts stock"| node_productctrl
node_stockctrl -->|"delegates stock work"| node_stockrepo
node_productrepo -->|"queries and updates"| node_productdb
node_orderrepo -->|"reads and writes cart"| node_orderdb
node_pos -->|"builds cart items"| node_ordermodel
node_productctrl -->|"accepts product data"| node_productmodel
node_userctrl -->|"returns user"| node_usermodel
node_salesrepo -.-> node_salesdb

click node_login "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/Login.cs"
click node_admin "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/AdminDashboard.cs"
click node_cashier "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/CashierDashboard.cs"
click node_inventory "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/InventoryManagement.cs"
click node_stockreport "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/StockReport.cs"
click node_salesreport "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/SalesReport.cs"
click node_pos "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/PointofSales.cs"
click node_userctrl "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/UserController.cs"
click node_productctrl "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/ProductController.cs"
click node_orderctrl "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/OrderProductController.cs"
click node_salesctrl "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/SalesController.cs"
click node_stockctrl "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/StockController.cs"
click node_userrepo "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/UserRepository.cs"
click node_productrepo "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/ProductRepository.cs"
click node_orderrepo "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/ProductOrderRepository.cs"
click node_salesrepo "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/SalesRepository.cs"
click node_stockrepo "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/StockRepository.cs"
click node_productdb "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/DB/Table/tblProduct.sql"
click node_orderdb "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/DB/Table/tblOrderProduct.sql"
click node_salesdb "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/DB/Table/tblSales.sql"
click node_productmodel "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/Model/ProductDetailsModel.cs"
click node_ordermodel "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/Model/OrderProductModel.cs"
click node_usermodel "https://github.com/blinkkishi-del/salesinventoryapp/blob/master/Model/UserModel.cs"

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_login,node_admin,node_cashier,node_inventory,node_stockreport,node_salesreport,node_pos toneBlue
class node_userctrl,node_productctrl,node_orderctrl,node_salesctrl,node_stockctrl toneAmber
class node_userrepo,node_productrepo,node_orderrepo,node_salesrepo,node_stockrepo,node_productdb,node_orderdb,node_salesdb toneMint
class node_productmodel,node_ordermodel,node_usermodel toneRose
class node_staff toneIndigo
```

## Components

### Desktop UI

- [Login](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/Login.cs): `UI/Login.cs`
- [Admin Dashboard](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/AdminDashboard.cs): `UI/AdminDashboard.cs`
- [Cashier Dashboard](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/CashierDashboard.cs): `UI/CashierDashboard.cs`
- [Inventory Management](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/InventoryManagement.cs): `UI/InventoryManagement.cs`
- [Stock Report](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/StockReport.cs): `UI/StockReport.cs`
- [Sales Report](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/SalesReport.cs): `UI/SalesReport.cs`
- [Point of Sale](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/UI/PointofSales.cs): `UI/PointofSales.cs`

### Business Logic

- [User Controller](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/UserController.cs): `BusinessLogic/Controller/UserController.cs`
- [Product Controller](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/ProductController.cs): `BusinessLogic/Controller/ProductController.cs`
- [Order Controller](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/OrderProductController.cs): `BusinessLogic/Controller/OrderProductController.cs`
- [Sales Controller](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/SalesController.cs): `BusinessLogic/Controller/SalesController.cs`
- [Stock Controller](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Controller/StockController.cs): `BusinessLogic/Controller/StockController.cs`

### Persistence

- [User Repository](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/UserRepository.cs): `BusinessLogic/Repository/UserRepository.cs`
- [Product Repository](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/ProductRepository.cs): `BusinessLogic/Repository/ProductRepository.cs`
- [Order Repository](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/ProductOrderRepository.cs): `BusinessLogic/Repository/ProductOrderRepository.cs`
- [Sales Repository](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/SalesRepository.cs): `BusinessLogic/Repository/SalesRepository.cs`
- [Stock Repository](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/BusinessLogic/Repository/StockRepository.cs): `BusinessLogic/Repository/StockRepository.cs`
- [Product SQL](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/DB/Table/tblProduct.sql): `DB/Table/tblProduct.sql`
- [Order SQL](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/DB/Table/tblOrderProduct.sql): `DB/Table/tblOrderProduct.sql`
- [Sales SQL](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/DB/Table/tblSales.sql): `DB/Table/tblSales.sql`

### Domain Models

- [Product Details](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/Model/ProductDetailsModel.cs): `Model/ProductDetailsModel.cs`
- [Order Item](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/Model/OrderProductModel.cs): `Model/OrderProductModel.cs`
- [User](https://github.com/blinkkishi-del/salesinventoryapp/blob/master/Model/UserModel.cs): `Model/UserModel.cs`

### Other components

- **Staff**

## Connections

- Staff → Login: signs in (evidence: `UI/Login.cs`)
- Login → User Controller: validates login (evidence: `UI/Login.cs`)
- User Controller → User Repository: checks credentials (evidence: `BusinessLogic/Controller/UserController.cs`)
- Login → Admin Dashboard: opens admin (evidence: `UI/Login.cs`)
- Login → Cashier Dashboard: opens cashier (evidence: `UI/Login.cs`)
- Admin Dashboard → Inventory Management: opens inventory (evidence: `UI/AdminDashboard.cs`)
- Admin Dashboard → Stock Report: opens report (evidence: `UI/AdminDashboard.cs`)
- Admin Dashboard → Sales Report: opens report (evidence: `UI/AdminDashboard.cs`)
- Cashier Dashboard → Point of Sale: opens sales (evidence: `UI/CashierDashboard.cs`)
- Inventory Management → Product Controller: uses products (evidence: `UI/InventoryManagement.cs`)
- Stock Report → Stock Controller: requests stock (evidence: `UI/StockReport.cs`)
- Sales Report → Sales Controller: requests sales (evidence: `UI/SalesReport.cs`)
- Point of Sale → Product Controller: loads products (evidence: `UI/PointofSales.cs`)
- Point of Sale → Order Controller: manages cart (evidence: `UI/PointofSales.cs`)
- Point of Sale → Sales Controller: records checkout (evidence: `UI/PointofSales.cs`)
- Product Controller → Product Repository: delegates product work (evidence: `BusinessLogic/Controller/ProductController.cs`)
- Order Controller → Order Repository: delegates cart work (evidence: `BusinessLogic/Controller/OrderProductController.cs`)
- Sales Controller → Sales Repository: records and queries (evidence: `BusinessLogic/Controller/SalesController.cs`)
- Sales Controller → Product Controller: deducts stock (evidence: `BusinessLogic/Controller/SalesController.cs`)
- Stock Controller → Stock Repository: delegates stock work (evidence: `BusinessLogic/Controller/StockController.cs`)
- Product Repository → Product SQL: queries and updates (evidence: `BusinessLogic/Repository/ProductRepository.cs`)
- Order Repository → Order SQL: reads and writes cart (evidence: `BusinessLogic/Repository/ProductOrderRepository.cs`)
- Point of Sale → Order Item: builds cart items (evidence: `UI/PointofSales.cs`)
- Product Controller → Product Details: accepts product data (evidence: `BusinessLogic/Controller/ProductController.cs`)
- User Controller → User: returns user (evidence: `BusinessLogic/Controller/UserController.cs`)
- Sales Repository → Sales SQL
