# kavitharan-dev/sun-enterprices-hardware-system architecture

> Architecture diagram of the GitHub repository kavitharan-dev/sun-enterprices-hardware-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kavitharan-dev/sun-enterprices-hardware-system
- Repository: https://github.com/kavitharan-dev/sun-enterprices-hardware-system

## Overview

This is a Laravel hardware-store and construction-management application. Staff use role-specific screens to manage the catalog, purchases and stock, complete sales and record receipts, and coordinate project requests, material issues, workers and expenses. A shared cashier cash book records business-day movements; reports and administrative tools provide oversight. The README documents these domain workflows, while the sampled excerpts show selected service and model relationships. Several controllers, routes and integrations were not sampled, so uncertain call paths are omitted.

Main entry points: [`app/Services/DailyAccountService.php`](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/DailyAccountService.php) (Cash book service), [`app/Services/MaterialIssueService.php`](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/MaterialIssueService.php) (Material issues), [`app/Services/SaleService.php`](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/SaleService.php) (Sales and invoices), [`app/Services/StockService.php`](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/StockService.php) (Stock ledger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store["Store operations"]
  node_catalog["Catalog and inventory"]
  node_purchases["Purchases"]
  node_sales["Sales and invoices<br/>[SaleService.php]"]
  node_stock["Stock ledger<br/>[StockService.php]"]
end

subgraph group_construction["Construction operations"]
  node_projects["Projects and progress"]
  node_requests["Material requests"]
  node_review["Request review"]
  node_issues["Material issues"]
  node_workers["Workers and payroll"]
  node_projectfinance["Project expenses<br/>[ProjectExpense.php]"]
end

subgraph group_cash["Cash and finance"]
  node_cashier["Cashier daily accounts"]
  node_cashservice["Cash book service"]
  node_cashdata[("Daily account records")]
end

subgraph group_oversight["Oversight and support"]
  node_reports["Business reports"]
  node_reportservice["Report queries<br/>[ReportService.php]"]
  node_admin["Users and settings<br/>[UserController.php]"]
  node_alerts["Notifications and alerts"]
end

node_staff(("Business staff"))
node_sms["Text.lk SMS"]

node_staff -->|"manage stock"| node_catalog
node_staff -->|"receive goods"| node_purchases
node_staff -->|"complete sales"| node_sales
node_sales -->|"records sale out"| node_stock
node_purchases -->|"records receipts"| node_stock
node_staff -->|"manage projects"| node_projects
node_projects -->|"submit requests"| node_requests
node_staff -->|"review requests"| node_review
node_review -->|"approves or rejects"| node_requests
node_staff -->|"issue materials"| node_issues
node_issues -->|"records issue out"| node_stock
node_issues -->|"creates material expense"| node_projectfinance
node_staff -->|"record work and pay"| node_workers
node_workers -->|"posts labour expense"| node_projectfinance
node_staff -->|"record cash movements"| node_cashier
node_cashier -->|"uses account service"| node_cashservice
node_cashservice -->|"posts entries"| node_cashdata
node_cashservice -->|"posts sale payments"| node_sales
node_cashservice -->|"posts expenses"| node_projectfinance
node_staff -->|"view reports"| node_reports
node_reports -->|"queries reports"| node_reportservice
node_staff -->|"administer users"| node_admin
node_staff -->|"receive alerts"| node_alerts
node_alerts -.->|"sends queued SMS"| node_sms

click node_catalog "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Store/InventoryController.php"
click node_purchases "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Store/PurchaseController.php"
click node_sales "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/SaleService.php"
click node_stock "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/StockService.php"
click node_projects "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Construction/ProjectController.php"
click node_requests "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/MaterialRequestService.php"
click node_review "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Store/MaterialRequestReviewController.php"
click node_issues "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/MaterialIssueService.php"
click node_workers "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/WorkerPayrollService.php"
click node_projectfinance "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Models/ProjectExpense.php"
click node_cashier "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Cashier/DailyAccountController.php"
click node_cashservice "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/DailyAccountService.php"
click node_cashdata "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Models/DailyAccountEntry.php"
click node_reports "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/ReportController.php"
click node_reportservice "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/ReportService.php"
click node_admin "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Admin/UserController.php"
click node_alerts "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/NotificationService.php"
click node_sms "https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/Sms/TextLkSmsProvider.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_catalog,node_purchases,node_sales,node_stock toneBlue
class node_projects,node_requests,node_review,node_issues,node_workers,node_projectfinance toneAmber
class node_cashier,node_cashservice,node_cashdata toneMint
class node_reports,node_reportservice,node_admin,node_alerts toneRose
class node_staff toneIndigo
class node_sms toneTeal
```

## Components

### Store operations

- [Catalog and inventory](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Store/InventoryController.php): `app/Http/Controllers/Store/InventoryController.php`
- [Purchases](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Store/PurchaseController.php): `app/Http/Controllers/Store/PurchaseController.php`
- [Sales and invoices](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/SaleService.php): `app/Services/SaleService.php`
- [Stock ledger](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/StockService.php): `app/Services/StockService.php`

### Construction operations

- [Projects and progress](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Construction/ProjectController.php): `app/Http/Controllers/Construction/ProjectController.php`
- [Material requests](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/MaterialRequestService.php): `app/Services/MaterialRequestService.php`
- [Request review](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Store/MaterialRequestReviewController.php): `app/Http/Controllers/Store/MaterialRequestReviewController.php`
- [Material issues](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/MaterialIssueService.php): `app/Services/MaterialIssueService.php`
- [Workers and payroll](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/WorkerPayrollService.php): `app/Services/WorkerPayrollService.php`
- [Project expenses](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Models/ProjectExpense.php): `app/Models/ProjectExpense.php`

### Cash and finance

- [Cashier daily accounts](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Cashier/DailyAccountController.php): `app/Http/Controllers/Cashier/DailyAccountController.php`
- [Cash book service](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/DailyAccountService.php): `app/Services/DailyAccountService.php`
- [Daily account records](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Models/DailyAccountEntry.php): `app/Models/DailyAccountEntry.php`

### Oversight and support

- [Business reports](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/ReportController.php): `app/Http/Controllers/ReportController.php`
- [Report queries](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/ReportService.php): `app/Services/ReportService.php`
- [Users and settings](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Http/Controllers/Admin/UserController.php): `app/Http/Controllers/Admin/UserController.php`
- [Notifications and alerts](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/NotificationService.php): `app/Services/NotificationService.php`

### Other components

- **Business staff**
- [Text.lk SMS](https://github.com/kavitharan-dev/sun-enterprices-hardware-system/blob/main/app/Services/Sms/TextLkSmsProvider.php): `app/Services/Sms/TextLkSmsProvider.php`

## Connections

- Business staff → Catalog and inventory: manage stock
- Business staff → Purchases: receive goods
- Business staff → Sales and invoices: complete sales
- Sales and invoices → Stock ledger: records sale out (evidence: `app/Services/SaleService.php`)
- Purchases → Stock ledger: records receipts
- Business staff → Projects and progress: manage projects
- Projects and progress → Material requests: submit requests
- Business staff → Request review: review requests
- Request review → Material requests: approves or rejects (evidence: `app/Http/Controllers/Store/MaterialRequestReviewController.php`)
- Business staff → Material issues: issue materials
- Material issues → Stock ledger: records issue out
- Material issues → Project expenses: creates material expense
- Business staff → Workers and payroll: record work and pay
- Workers and payroll → Project expenses: posts labour expense
- Business staff → Cashier daily accounts: record cash movements
- Cashier daily accounts → Cash book service: uses account service (evidence: `app/Http/Controllers/Cashier/DailyAccountController.php`)
- Cash book service → Daily account records: posts entries (evidence: `app/Services/DailyAccountService.php`)
- Cash book service → Sales and invoices: posts sale payments (evidence: `app/Services/DailyAccountService.php`)
- Cash book service → Project expenses: posts expenses (evidence: `app/Services/DailyAccountService.php`)
- Business staff → Business reports: view reports
- Business reports → Report queries: queries reports (evidence: `app/Http/Controllers/ReportController.php`)
- Business staff → Users and settings: administer users
- Business staff → Notifications and alerts: receive alerts
- Notifications and alerts → Text.lk SMS: sends queued SMS
