# danilubis10/monitoring-penjualan architecture

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

- Interactive diagram: https://gitdiagram.com/danilubis10/monitoring-penjualan
- Repository: https://github.com/danilubis10/monitoring-penjualan

## Overview

SinarNiaga Monitor is a Laravel sales and inventory monitoring application. Staff use its web interface to manage customers, categories, and products; record sales with stock synchronization; then inspect dashboard analytics and export filtered reports or invoices. The graph separates request handling, domain services, and persistent sales/master data. Dashboard, report, and export capabilities are retained from the README; unsampled implementations and view wiring are represented only where documented or evidenced by the source index.

Main entry points: [`routes/web.php`](https://github.com/danilubis10/monitoring-penjualan/blob/main/routes/web.php) (Web routes), [`app/Models/Sale.php`](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Sale.php) (Sales and line items), [`config/database.php`](https://github.com/danilubis10/monitoring-penjualan/blob/main/config/database.php) (Configured database), [`app/Http/Controllers/SaleController.php`](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/SaleController.php) (Sale handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_routes["Web routes<br/>[web.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_customers["Customer management"]
  node_categories["Category management"]
  node_products["Product and stock management"]
end

subgraph group_operations["Sales operations"]
  node_sales["Sale handling<br/>[SaleController.php]"]
  node_sale_service["Sale and stock service<br/>[SaleService.php]"]
end

subgraph group_insights["Analytics and exports"]
  node_dashboard["Dashboard"]
  node_analytics["Sales analytics"]
  node_reports["Report handling"]
  node_exports["Sales exports"]
end

subgraph group_data["Domain data"]
  node_sale_data["Sales and line items<br/>[Sale.php]"]
  node_sale_item["Sale item model<br/>[SaleItem.php]"]
  node_product_data["Product model<br/>[Product.php]"]
  node_customer_data["Customer model<br/>[Customer.php]"]
  node_category_data["Category model<br/>[Category.php]"]
  node_target_data["Sales targets<br/>[SalesTarget.php]"]
  node_user_data["User model<br/>[User.php]"]
  node_store[("Configured database<br/>[database.php]")]
end

node_staff(("Staff user"))

node_staff -->|"uses web app"| node_routes
node_routes -->|"routes requests"| node_auth
node_routes -->|"routes requests"| node_customers
node_routes -->|"routes requests"| node_categories
node_routes -->|"routes requests"| node_products
node_routes -->|"routes requests"| node_sales
node_routes -->|"routes requests"| node_dashboard
node_routes -->|"routes requests"| node_reports
node_products -->|"queries categories"| node_category_data
node_sales -->|"creates or updates"| node_sale_service
node_sales -->|"loads products"| node_product_data
node_sales -->|"loads customers"| node_customer_data
node_sales -->|"requests invoice PDF"| node_exports
node_sale_service -->|"locks and adjusts stock"| node_product_data
node_sale_service -->|"creates and updates"| node_sale_data
node_sale_service -->|"creates line items"| node_sale_item
node_sale_data -->|"has many"| node_sale_item
node_sale_item -->|"belongs to"| node_product_data
node_dashboard -->|"requests metrics"| node_analytics
node_dashboard -->|"reads targets"| node_target_data
node_analytics -->|"aggregates sales"| node_sale_data
node_analytics -->|"aggregates items"| node_sale_item
node_analytics -->|"analyzes products"| node_product_data
node_reports -->|"filters sales"| node_sale_data
node_reports -->|"requests report exports"| node_exports
node_exports -->|"reads invoice data"| node_sale_data
node_sale_data -.->|"persists sales"| node_store
node_product_data -.->|"persists inventory"| node_store
node_customer_data -.->|"persists customers"| node_store
node_category_data -.->|"persists categories"| node_store
node_target_data -.->|"persists targets"| node_store
node_user_data -.->|"persists accounts"| node_store

click node_routes "https://github.com/danilubis10/monitoring-penjualan/blob/main/routes/web.php"
click node_auth "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/Auth/AuthController.php"
click node_customers "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/CustomerController.php"
click node_categories "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/CategoryController.php"
click node_products "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/ProductController.php"
click node_sales "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/SaleController.php"
click node_sale_service "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Services/SaleService.php"
click node_dashboard "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/DashboardController.php"
click node_analytics "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Services/SalesAnalyticsService.php"
click node_reports "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/ReportController.php"
click node_exports "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Services/SalesExportService.php"
click node_sale_data "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Sale.php"
click node_sale_item "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/SaleItem.php"
click node_product_data "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Product.php"
click node_customer_data "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Customer.php"
click node_category_data "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Category.php"
click node_target_data "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/SalesTarget.php"
click node_user_data "https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/User.php"
click node_store "https://github.com/danilubis10/monitoring-penjualan/blob/main/config/database.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_routes,node_auth,node_customers,node_categories,node_products,node_staff toneBlue
class node_sales,node_sale_service toneAmber
class node_dashboard,node_analytics,node_reports,node_exports toneMint
class node_sale_data,node_sale_item,node_product_data,node_customer_data,node_category_data,node_target_data,node_user_data,node_store toneRose
```

## Components

### Web interface

- [Web routes](https://github.com/danilubis10/monitoring-penjualan/blob/main/routes/web.php): `routes/web.php`
- [Authentication](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/Auth/AuthController.php): `app/Http/Controllers/Auth/AuthController.php`
- [Customer management](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/CustomerController.php): `app/Http/Controllers/CustomerController.php`
- [Category management](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/CategoryController.php): `app/Http/Controllers/CategoryController.php`
- [Product and stock management](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/ProductController.php): `app/Http/Controllers/ProductController.php`

### Sales operations

- [Sale handling](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/SaleController.php): `app/Http/Controllers/SaleController.php`
- [Sale and stock service](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Services/SaleService.php): `app/Services/SaleService.php`

### Analytics and exports

- [Dashboard](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Sales analytics](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Services/SalesAnalyticsService.php): `app/Services/SalesAnalyticsService.php`
- [Report handling](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Http/Controllers/ReportController.php): `app/Http/Controllers/ReportController.php`
- [Sales exports](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Services/SalesExportService.php): `app/Services/SalesExportService.php`

### Domain data

- [Sales and line items](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Sale.php): `app/Models/Sale.php`
- [Sale item model](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/SaleItem.php): `app/Models/SaleItem.php`
- [Product model](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Customer model](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [Category model](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/Category.php): `app/Models/Category.php`
- [Sales targets](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/SalesTarget.php): `app/Models/SalesTarget.php`
- [User model](https://github.com/danilubis10/monitoring-penjualan/blob/main/app/Models/User.php): `app/Models/User.php`
- [Configured database](https://github.com/danilubis10/monitoring-penjualan/blob/main/config/database.php): `config/database.php`

### Other components

- **Staff user**

## Connections

- Staff user → Web routes: uses web app (evidence: `README.md`)
- Web routes → Authentication: routes requests (evidence: `routes/web.php`)
- Web routes → Customer management: routes requests (evidence: `routes/web.php`)
- Web routes → Category management: routes requests (evidence: `routes/web.php`)
- Web routes → Product and stock management: routes requests (evidence: `routes/web.php`)
- Web routes → Sale handling: routes requests (evidence: `routes/web.php`)
- Web routes → Dashboard: routes requests (evidence: `routes/web.php`)
- Web routes → Report handling: routes requests (evidence: `routes/web.php`)
- Product and stock management → Category model: queries categories (evidence: `app/Http/Controllers/ProductController.php`)
- Sale handling → Sale and stock service: creates or updates (evidence: `app/Http/Controllers/SaleController.php`)
- Sale handling → Product model: loads products (evidence: `app/Http/Controllers/SaleController.php`)
- Sale handling → Customer model: loads customers (evidence: `app/Http/Controllers/SaleController.php`)
- Sale handling → Sales exports: requests invoice PDF (evidence: `app/Http/Controllers/SaleController.php`)
- Sale and stock service → Product model: locks and adjusts stock (evidence: `app/Services/SaleService.php`)
- Sale and stock service → Sales and line items: creates and updates (evidence: `app/Services/SaleService.php`)
- Sale and stock service → Sale item model: creates line items (evidence: `app/Services/SaleService.php`)
- Sales and line items → Sale item model: has many (evidence: `app/Models/Sale.php`)
- Sale item model → Product model: belongs to (evidence: `app/Models/SaleItem.php`)
- Dashboard → Sales analytics: requests metrics (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard → Sales targets: reads targets (evidence: `app/Http/Controllers/DashboardController.php`)
- Sales analytics → Sales and line items: aggregates sales (evidence: `app/Services/SalesAnalyticsService.php`)
- Sales analytics → Sale item model: aggregates items (evidence: `app/Services/SalesAnalyticsService.php`)
- Sales analytics → Product model: analyzes products (evidence: `app/Services/SalesAnalyticsService.php`)
- Report handling → Sales and line items: filters sales (evidence: `app/Http/Controllers/ReportController.php`)
- Report handling → Sales exports: requests report exports (evidence: `app/Http/Controllers/ReportController.php`)
- Sales exports → Sales and line items: reads invoice data (evidence: `app/Services/SalesExportService.php`)
- Sales and line items → Configured database: persists sales
- Product model → Configured database: persists inventory
- Customer model → Configured database: persists customers
- Category model → Configured database: persists categories
- Sales targets → Configured database: persists targets
- User model → Configured database: persists accounts
