# nowshadhalimzai2/irfan-bahar-company architecture

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

- Interactive diagram: https://gitdiagram.com/nowshadhalimzai2/irfan-bahar-company
- Repository: https://github.com/nowshadhalimzai2/irfan-bahar-company

## Overview

This Laravel/Inertia application supports shop and factory operations: staff manage items and stock, record sales and receipts, process production and transfers, and review operational reports. The sampled sale handler demonstrates the sales-to-inventory path; the inventory helper updates balances and records movements. Other major capabilities are represented from the file tree and source index, but their internal call paths are not asserted where source was not sampled. No README was provided.

Main entry points: [`app/Http/Controllers/SaleController.php`](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/SaleController.php) (Sales), [`app/Services/ReportService.php`](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/ReportService.php) (Operational Reports), [`app/Custome/InvMovement.php`](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Custome/InvMovement.php) (Stock Movement), [`app/Models/Item.php`](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Item.php) (Items And Units)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Shop Operations"]
  node_sale_handler["Sales<br/>[SaleController.php]"]
  node_sale_ui["Sale Screens<br/>[create.tsx]"]
  node_sale_record[("Sale Records<br/>[Sale.php]")]
  node_invoice_record[("Invoices<br/>[Invoice.php]")]
  node_payment_record[("Payments<br/>[Payment.php]")]
  node_item_record[("Items And Units<br/>[Item.php]")]
  node_location_record[("Locations<br/>[Location.php]")]
  node_stock_helper["Stock Movement<br/>[InvMovement.php]"]
  node_stock_balance[("Stock Balances")]
  node_movement_record[("Movement Records")]
  node_receipt_handler["Goods Receipts"]
  node_transfer_handler["Transfers"]
  node_return_handler["Sale Returns"]
end

subgraph group_factory["Factory Operations"]
  node_production_handler["Production Orders"]
  node_production_service["Production Processing"]
  node_factory_dashboard["Factory Dashboard"]
end

subgraph group_insight["Dashboards And Reports"]
  node_reports["Operational Reports<br/>[ReportService.php]"]
  node_report_exports["Report Exports<br/>[ReportExport.php]"]
  node_shop_dashboard["Shop Dashboard"]
end

subgraph group_platform["Application Platform"]
  node_web_entry["Web Entry<br/>[index.php]"]
  node_app_boot["Laravel Bootstrap<br/>[app.php]"]
  node_user_record[("Users And Roles<br/>[User.php]")]
  node_sales_logs["Activity Logging<br/>[Log.php]"]
end

node_staff(("Staff"))

node_staff -->|"uses"| node_web_entry
node_web_entry -->|"starts"| node_app_boot
node_sale_handler -->|"renders"| node_sale_ui
node_sale_handler -->|"records sales"| node_sale_record
node_sale_handler -->|"loads items"| node_item_record
node_sale_handler -->|"loads locations"| node_location_record
node_sale_handler -->|"moves stock"| node_stock_helper
node_sale_handler -->|"creates invoices"| node_invoice_record
node_sale_handler -->|"alerts admins"| node_user_record
node_stock_helper -->|"updates"| node_stock_balance
node_stock_helper -->|"records movement"| node_movement_record
node_receipt_handler -->|"moves stock"| node_stock_helper
node_production_handler -->|"delegates to"| node_production_service
node_reports -->|"queries"| node_sale_record
node_reports -->|"queries"| node_payment_record
node_reports -->|"queries"| node_movement_record
node_reports -->|"queries"| node_item_record
node_report_exports -->|"exports data"| node_item_record
node_sale_handler -->|"logs activity"| node_sales_logs

click node_web_entry "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/public/index.php"
click node_app_boot "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/bootstrap/app.php"
click node_sale_handler "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/SaleController.php"
click node_sale_ui "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/resources/js/pages/sale/create.tsx"
click node_sale_record "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Sale.php"
click node_invoice_record "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Invoice.php"
click node_payment_record "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Payment.php"
click node_item_record "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Item.php"
click node_location_record "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Location.php"
click node_stock_helper "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Custome/InvMovement.php"
click node_stock_balance "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/InventoryBalance.php"
click node_movement_record "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/InventoryMovement.php"
click node_receipt_handler "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/GoodsReceiptController.php"
click node_transfer_handler "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/TransferController.php"
click node_return_handler "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/SaleReturnController.php"
click node_production_handler "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/ProductionOrderController.php"
click node_production_service "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/ProductionOrderService.php"
click node_factory_dashboard "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/FactoryDashboardService.php"
click node_reports "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/ReportService.php"
click node_report_exports "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Exports/ReportExport.php"
click node_shop_dashboard "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/DashboardService.php"
click node_user_record "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/User.php"
click node_sales_logs "https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Custome/Log.php"

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_sale_handler,node_sale_ui,node_sale_record,node_invoice_record,node_payment_record,node_item_record,node_location_record,node_stock_helper,node_stock_balance,node_movement_record,node_receipt_handler,node_transfer_handler,node_return_handler toneBlue
class node_production_handler,node_production_service,node_factory_dashboard toneAmber
class node_reports,node_report_exports,node_shop_dashboard toneMint
class node_web_entry,node_app_boot,node_user_record,node_sales_logs toneRose
class node_staff toneIndigo
```

## Components

### Shop Operations

- [Sales](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/SaleController.php): `app/Http/Controllers/SaleController.php`
- [Sale Screens](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/resources/js/pages/sale/create.tsx): `resources/js/pages/sale/create.tsx`
- [Sale Records](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Sale.php): `app/Models/Sale.php`
- [Invoices](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Invoice.php): `app/Models/Invoice.php`
- [Payments](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Payment.php): `app/Models/Payment.php`
- [Items And Units](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Item.php): `app/Models/Item.php`
- [Locations](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/Location.php): `app/Models/Location.php`
- [Stock Movement](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Custome/InvMovement.php): `app/Custome/InvMovement.php`
- [Stock Balances](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/InventoryBalance.php): `app/Models/InventoryBalance.php`
- [Movement Records](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/InventoryMovement.php): `app/Models/InventoryMovement.php`
- [Goods Receipts](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/GoodsReceiptController.php): `app/Http/Controllers/GoodsReceiptController.php`
- [Transfers](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/TransferController.php): `app/Http/Controllers/TransferController.php`
- [Sale Returns](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/SaleReturnController.php): `app/Http/Controllers/SaleReturnController.php`

### Factory Operations

- [Production Orders](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Http/Controllers/ProductionOrderController.php): `app/Http/Controllers/ProductionOrderController.php`
- [Production Processing](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/ProductionOrderService.php): `app/Services/ProductionOrderService.php`
- [Factory Dashboard](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/FactoryDashboardService.php): `app/Services/FactoryDashboardService.php`

### Dashboards And Reports

- [Operational Reports](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/ReportService.php): `app/Services/ReportService.php`
- [Report Exports](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Exports/ReportExport.php): `app/Exports/ReportExport.php`
- [Shop Dashboard](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Services/DashboardService.php): `app/Services/DashboardService.php`

### Application Platform

- [Web Entry](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/public/index.php): `public/index.php`
- [Laravel Bootstrap](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [Users And Roles](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Models/User.php): `app/Models/User.php`
- [Activity Logging](https://github.com/nowshadhalimzai2/irfan-bahar-company/blob/main/app/Custome/Log.php): `app/Custome/Log.php`

### Other components

- **Staff**

## Connections

- Staff → Web Entry: uses
- Web Entry → Laravel Bootstrap: starts (evidence: `public/index.php`)
- Sales → Sale Screens: renders (evidence: `app/Http/Controllers/SaleController.php`)
- Sales → Sale Records: records sales (evidence: `app/Http/Controllers/SaleController.php`)
- Sales → Items And Units: loads items (evidence: `app/Http/Controllers/SaleController.php`)
- Sales → Locations: loads locations (evidence: `app/Http/Controllers/SaleController.php`)
- Sales → Stock Movement: moves stock (evidence: `app/Http/Controllers/SaleController.php`)
- Sales → Invoices: creates invoices (evidence: `app/Http/Controllers/SaleController.php`)
- Sales → Users And Roles: alerts admins (evidence: `app/Http/Controllers/SaleController.php`)
- Stock Movement → Stock Balances: updates (evidence: `app/Custome/InvMovement.php`)
- Stock Movement → Movement Records: records movement (evidence: `app/Custome/InvMovement.php`)
- Goods Receipts → Stock Movement: moves stock (evidence: `app/Http/Controllers/GoodsReceiptController.php`)
- Production Orders → Production Processing: delegates to
- Operational Reports → Sale Records: queries (evidence: `app/Services/ReportService.php`)
- Operational Reports → Payments: queries (evidence: `app/Services/ReportService.php`)
- Operational Reports → Movement Records: queries (evidence: `app/Services/ReportService.php`)
- Operational Reports → Items And Units: queries (evidence: `app/Services/ReportService.php`)
- Report Exports → Items And Units: exports data (evidence: `app/Exports/ReportExport.php`)
- Sales → Activity Logging: logs activity (evidence: `app/Http/Controllers/SaleController.php`)
