# nabielnx/motorku architecture

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

- Interactive diagram: https://gitdiagram.com/nabielnx/motorku
- Repository: https://github.com/nabielnx/motorku

## Overview

Motorku is a Laravel/React spare-parts POS and catalog. Customers browse the public catalog, find parts compatible with a motorcycle, place pickup orders, and check order/payment status; staff handle POS sales and owners manage stock, catalog, reporting, and store settings. The graph highlights these domain stages and the controller-to-service business-logic layer. The README documents several capabilities whose specific wiring is not visible in sampled code, so uncertain links are omitted.

Main entry points: [`app/Http/Controllers/Order/CustomerMenuController.php`](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Order/CustomerMenuController.php) (Customer Orders), [`app/Http/Controllers/Payment/DokuPaymentController.php`](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Payment/DokuPaymentController.php) (Payment Handling), [`resources/js/Pages/Order/Menu.jsx`](https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Order/Menu.jsx) (Browse Catalog), [`resources/js/Pages/Motorcycle/MotorSaya.jsx`](https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Motorcycle/MotorSaya.jsx) (Motor Compatibility)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Catalog"]
  node_menu["Browse Catalog<br/>[Menu.jsx]"]
  node_menu_controller["Catalog Controller"]
  node_motorcycle_page["Motor Compatibility<br/>[MotorSaya.jsx]"]
  node_orders_page["Order Status<br/>[Status.jsx]"]
end

subgraph group_sales["Orders and Payments"]
  node_customer_order["Customer Orders"]
  node_order_controller["Order Handling"]
  node_order_service["Order Logic<br/>[OrderService.php]"]
  node_pos["Cashier POS<br/>[Index.jsx]"]
  node_pos_controller["POS Handling<br/>[PosController.php]"]
  node_payment_controller["Payment Handling"]
  node_payment_gateway["DOKU QRIS"]
  node_doku{{"DOKU Gateway"}}
end

subgraph group_catalog["Catalog and Inventory"]
  node_motorcycle_controller["Motorcycle Management"]
  node_motorcycle_service["Compatibility Logic"]
  node_product_controller["Product Management"]
  node_product_service["Product Logic<br/>[ProductService.php]"]
  node_inventory_controller["Inventory Management"]
  node_inventory_service["Stock Logic"]
end

subgraph group_operations["Store Operations"]
  node_owner_dashboard["Owner Dashboard<br/>[Index.jsx]"]
  node_dashboard_controller["Dashboard Data"]
  node_dashboard_service["Dashboard Logic"]
  node_reports["Sales Reports"]
  node_report_service["Report Logic<br/>[ReportService.php]"]
end

subgraph group_ui["Inertia Interface"]
end

node_customer(("Customer"))
node_staff(("Owner / Cashier"))
node_database[("Application Database")]

node_customer -->|"browses"| node_menu
node_menu -->|"requests catalog"| node_menu_controller
node_menu_controller -->|"reads products, categories, settings"| node_database
node_customer -->|"selects motorcycle"| node_motorcycle_page
node_motorcycle_page -->|"requests parts"| node_motorcycle_controller
node_motorcycle_controller -->|"delegates mapping"| node_motorcycle_service
node_motorcycle_service -->|"reads mappings"| node_database
node_customer -->|"places order"| node_customer_order
node_menu_controller -->|"submits order"| node_customer_order
node_customer_order -->|"creates order"| node_order_service
node_customer_order -->|"processes stock"| node_inventory_service
node_order_service -->|"persists order"| node_database
node_customer -->|"checks status"| node_orders_page
node_orders_page -->|"polls status"| node_customer_order
node_staff -->|"records sale"| node_pos
node_pos -->|"submits sale"| node_pos_controller
node_staff -->|"manages catalog"| node_product_controller
node_product_controller -->|"delegates product changes"| node_product_service
node_product_service -->|"persists products"| node_database
node_staff -->|"manages stock"| node_inventory_controller
node_inventory_controller -->|"delegates stock changes"| node_inventory_service
node_staff -->|"initiates QRIS"| node_payment_controller
node_payment_controller -->|"requests payment"| node_payment_gateway
node_payment_gateway -.->|"creates invoice"| node_doku
node_payment_controller -->|"reads and updates payments"| node_database
node_staff -->|"views performance"| node_owner_dashboard
node_owner_dashboard -->|"requests metrics"| node_dashboard_controller
node_dashboard_controller -->|"gets statistics"| node_dashboard_service
node_staff -->|"requests reports"| node_reports
node_reports -->|"gets report data"| node_report_service
node_report_service -->|"queries sales"| node_database

click node_menu "https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Order/Menu.jsx"
click node_menu_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Order/CustomerMenuController.php"
click node_motorcycle_page "https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Motorcycle/MotorSaya.jsx"
click node_motorcycle_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Motorcycle/MotorcycleController.php"
click node_motorcycle_service "https://github.com/nabielnx/motorku/blob/main/app/Services/MotorcycleService.php"
click node_orders_page "https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Order/Status.jsx"
click node_customer_order "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Order/CustomerMenuController.php"
click node_order_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Order/OrderController.php"
click node_order_service "https://github.com/nabielnx/motorku/blob/main/app/Services/OrderService.php"
click node_pos "https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/POS/Index.jsx"
click node_pos_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Dashboard/PosController.php"
click node_payment_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Payment/DokuPaymentController.php"
click node_payment_gateway "https://github.com/nabielnx/motorku/blob/main/app/Services/DokuQrisService.php"
click node_product_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Product/ProductController.php"
click node_product_service "https://github.com/nabielnx/motorku/blob/main/app/Services/ProductService.php"
click node_inventory_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Inventory/InventoryController.php"
click node_inventory_service "https://github.com/nabielnx/motorku/blob/main/app/Services/InventoryService.php"
click node_owner_dashboard "https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Dashboard/Owner/Index.jsx"
click node_dashboard_controller "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Dashboard/DashboardController.php"
click node_dashboard_service "https://github.com/nabielnx/motorku/blob/main/app/Services/DashboardService.php"
click node_reports "https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Report/ReportController.php"
click node_report_service "https://github.com/nabielnx/motorku/blob/main/app/Services/ReportService.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_menu,node_menu_controller,node_motorcycle_page,node_orders_page toneBlue
class node_customer_order,node_order_controller,node_order_service,node_pos,node_pos_controller,node_payment_controller,node_payment_gateway,node_doku,node_database toneAmber
class node_motorcycle_controller,node_motorcycle_service,node_product_controller,node_product_service,node_inventory_controller,node_inventory_service toneMint
class node_owner_dashboard,node_dashboard_controller,node_dashboard_service,node_reports,node_report_service toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Customer Catalog

- [Browse Catalog](https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Order/Menu.jsx): `resources/js/Pages/Order/Menu.jsx`
- [Catalog Controller](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Order/CustomerMenuController.php): `app/Http/Controllers/Order/CustomerMenuController.php`
- [Motor Compatibility](https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Motorcycle/MotorSaya.jsx): `resources/js/Pages/Motorcycle/MotorSaya.jsx`
- [Order Status](https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Order/Status.jsx): `resources/js/Pages/Order/Status.jsx`

### Orders and Payments

- [Customer Orders](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Order/CustomerMenuController.php): `app/Http/Controllers/Order/CustomerMenuController.php`
- [Order Handling](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Order/OrderController.php): `app/Http/Controllers/Order/OrderController.php`
- [Order Logic](https://github.com/nabielnx/motorku/blob/main/app/Services/OrderService.php): `app/Services/OrderService.php`
- [Cashier POS](https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/POS/Index.jsx): `resources/js/Pages/POS/Index.jsx`
- [POS Handling](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Dashboard/PosController.php): `app/Http/Controllers/Dashboard/PosController.php`
- [Payment Handling](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Payment/DokuPaymentController.php): `app/Http/Controllers/Payment/DokuPaymentController.php`
- [DOKU QRIS](https://github.com/nabielnx/motorku/blob/main/app/Services/DokuQrisService.php): `app/Services/DokuQrisService.php`
- **DOKU Gateway**

### Catalog and Inventory

- [Motorcycle Management](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Motorcycle/MotorcycleController.php): `app/Http/Controllers/Motorcycle/MotorcycleController.php`
- [Compatibility Logic](https://github.com/nabielnx/motorku/blob/main/app/Services/MotorcycleService.php): `app/Services/MotorcycleService.php`
- [Product Management](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Product/ProductController.php): `app/Http/Controllers/Product/ProductController.php`
- [Product Logic](https://github.com/nabielnx/motorku/blob/main/app/Services/ProductService.php): `app/Services/ProductService.php`
- [Inventory Management](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Inventory/InventoryController.php): `app/Http/Controllers/Inventory/InventoryController.php`
- [Stock Logic](https://github.com/nabielnx/motorku/blob/main/app/Services/InventoryService.php): `app/Services/InventoryService.php`

### Store Operations

- [Owner Dashboard](https://github.com/nabielnx/motorku/blob/main/resources/js/Pages/Dashboard/Owner/Index.jsx): `resources/js/Pages/Dashboard/Owner/Index.jsx`
- [Dashboard Data](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Dashboard/DashboardController.php): `app/Http/Controllers/Dashboard/DashboardController.php`
- [Dashboard Logic](https://github.com/nabielnx/motorku/blob/main/app/Services/DashboardService.php): `app/Services/DashboardService.php`
- [Sales Reports](https://github.com/nabielnx/motorku/blob/main/app/Http/Controllers/Report/ReportController.php): `app/Http/Controllers/Report/ReportController.php`
- [Report Logic](https://github.com/nabielnx/motorku/blob/main/app/Services/ReportService.php): `app/Services/ReportService.php`

### Other components

- **Customer**
- **Owner / Cashier**
- **Application Database**

## Connections

- Customer → Browse Catalog: browses
- Browse Catalog → Catalog Controller: requests catalog
- Catalog Controller → Application Database: reads products, categories, settings
- Customer → Motor Compatibility: selects motorcycle
- Motor Compatibility → Motorcycle Management: requests parts
- Motorcycle Management → Compatibility Logic: delegates mapping
- Compatibility Logic → Application Database: reads mappings
- Customer → Customer Orders: places order
- Catalog Controller → Customer Orders: submits order
- Customer Orders → Order Logic: creates order
- Customer Orders → Stock Logic: processes stock
- Order Logic → Application Database: persists order
- Customer → Order Status: checks status
- Order Status → Customer Orders: polls status
- Owner / Cashier → Cashier POS: records sale
- Cashier POS → POS Handling: submits sale
- Owner / Cashier → Product Management: manages catalog
- Product Management → Product Logic: delegates product changes
- Product Logic → Application Database: persists products
- Owner / Cashier → Inventory Management: manages stock
- Inventory Management → Stock Logic: delegates stock changes
- Owner / Cashier → Payment Handling: initiates QRIS
- Payment Handling → DOKU QRIS: requests payment
- DOKU QRIS → DOKU Gateway: creates invoice
- Payment Handling → Application Database: reads and updates payments
- Owner / Cashier → Owner Dashboard: views performance
- Owner Dashboard → Dashboard Data: requests metrics
- Dashboard Data → Dashboard Logic: gets statistics
- Owner / Cashier → Sales Reports: requests reports
- Sales Reports → Report Logic: gets report data
- Report Logic → Application Database: queries sales
