# lohahola/tubes-pec architecture

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

- Interactive diagram: https://gitdiagram.com/lohahola/tubes-pec
- Repository: https://github.com/lohahola/tubes-pec

## Overview

Arbyte is a Laravel e-commerce application. Customers browse products, manage accounts and shipping details, build a cart, check out into reserved-stock orders, pay through Midtrans, then track orders and submit eligible reviews; admins manage catalog, customers, orders, and homepage promotions. The graph emphasizes controllers and services shown in the source index, plus documented capabilities whose specific implementation details were not sampled. Region data is documented as local JSON; some route-to-controller links and feature links rely on the README or routes index.

Main entry points: [`routes/web.php`](https://github.com/lohahola/tubes-pec/blob/main/routes/web.php) (Web routes), [`app/Models/Product.php`](https://github.com/lohahola/tubes-pec/blob/main/app/Models/Product.php) (Product catalog), [`app/Http/Controllers/PaymentController.php`](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/PaymentController.php) (Payment handling), [`app/Models/Order.php`](https://github.com/lohahola/tubes-pec/blob/main/app/Models/Order.php) (Order records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Storefront &amp; Catalog"]
  node_storefront["Storefront browsing"]
  node_products[("Product catalog<br/>[Product.php]")]
  node_reviews["Product reviews"]
end

subgraph group_buy["Cart &amp; Orders"]
  node_cart["Cart management<br/>[CartController.php]"]
  node_cart_state[("Cart state<br/>[Cart.php]")]
  node_checkout["Checkout &amp; reservation"]
  node_orders["Order tracking"]
  node_cancellation["Order cancellation"]
  node_reservation_expiry["Reservation expiry"]
  node_order_model[("Order records<br/>[Order.php]")]
end

subgraph group_pay["Payments"]
  node_payment_flow["Payment handling"]
  node_payment_sync["Payment synchronization"]
  node_payment_model[("Payment records<br/>[Payment.php]")]
  node_notification_model[("Payment notifications")]
end

subgraph group_admin["Store Administration"]
  node_admin_catalog["Catalog administration"]
  node_admin_categories["Category administration"]
  node_admin_features["Homepage promotions"]
  node_admin_orders["Order administration"]
  node_admin_customers["Customer administration"]
end

subgraph group_accounts["Accounts &amp; Address"]
  node_auth_profile["Account &amp; profile<br/>[AuthController.php]"]
  node_profile["Profile management"]
  node_regions["Region lookup"]
  node_region_endpoint["Region endpoints"]
  node_user_model[("Customer accounts<br/>[User.php]")]
end

node_customer(("Customer"))
node_web_routes["Web routes<br/>[web.php]"]
node_midtrans{{"Midtrans Snap"}}
node_admin_actor(("Store admin"))

node_customer -->|"requests"| node_web_routes
node_web_routes -->|"routes to"| node_storefront
node_web_routes -->|"routes to"| node_cart
node_web_routes -->|"routes to"| node_checkout
node_web_routes -->|"routes to"| node_payment_flow
node_web_routes -->|"routes to"| node_orders
node_web_routes -->|"routes to"| node_reviews
node_web_routes -->|"routes to"| node_auth_profile
node_web_routes -->|"routes to"| node_profile
node_web_routes -->|"routes to"| node_region_endpoint
node_web_routes -->|"routes to"| node_admin_catalog
node_web_routes -->|"routes to"| node_admin_categories
node_web_routes -->|"routes to"| node_admin_features
node_web_routes -->|"routes to"| node_admin_orders
node_web_routes -->|"routes to"| node_admin_customers
node_storefront -->|"queries"| node_products
node_products -->|"has reviews"| node_reviews
node_customer -->|"manages"| node_cart
node_cart -->|"updates"| node_cart_state
node_cart -->|"reads"| node_products
node_checkout -->|"reads"| node_cart_state
node_checkout -->|"reserves stock"| node_products
node_checkout -->|"creates"| node_order_model
node_customer -->|"places order"| node_checkout
node_orders -->|"reads"| node_order_model
node_orders -->|"synchronizes"| node_payment_sync
node_orders -->|"delegates cancellation"| node_cancellation
node_reservation_expiry -->|"releases expired"| node_order_model
node_reservation_expiry -->|"restores stock"| node_products
node_payment_flow -->|"loads order"| node_order_model
node_payment_flow -->|"records attempt"| node_payment_model
node_payment_flow -->|"creates Snap session"| node_midtrans
node_midtrans -->|"notifies"| node_payment_flow
node_payment_flow -->|"records notification"| node_notification_model
node_payment_flow -->|"restores stock"| node_products
node_cancellation -->|"updates attempts"| node_payment_model
node_cancellation -->|"cancels payment"| node_midtrans
node_cancellation -->|"restores stock"| node_products
node_admin_actor -->|"manages store"| node_web_routes
node_admin_catalog -->|"manages"| node_products
node_admin_catalog -->|"uses categories"| node_admin_categories
node_admin_features -->|"selects products"| node_products
node_admin_orders -->|"manages"| node_order_model
node_admin_customers -->|"reads customers"| node_user_model
node_admin_customers -->|"reads history"| node_order_model
node_admin_categories -->|"manages categories"| node_products
node_auth_profile -->|"authenticates"| node_user_model
node_profile -->|"validates address"| node_regions

click node_web_routes "https://github.com/lohahola/tubes-pec/blob/main/routes/web.php"
click node_storefront "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/StorefrontController.php"
click node_products "https://github.com/lohahola/tubes-pec/blob/main/app/Models/Product.php"
click node_reviews "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/ProductReviewController.php"
click node_cart "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/CartController.php"
click node_cart_state "https://github.com/lohahola/tubes-pec/blob/main/app/Models/Cart.php"
click node_checkout "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/CheckoutController.php"
click node_orders "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/OrderController.php"
click node_cancellation "https://github.com/lohahola/tubes-pec/blob/main/app/Services/OrderCancellationService.php"
click node_reservation_expiry "https://github.com/lohahola/tubes-pec/blob/main/app/Console/Commands/ReleaseExpiredOrderReservations.php"
click node_payment_flow "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/PaymentController.php"
click node_payment_sync "https://github.com/lohahola/tubes-pec/blob/main/app/Services/MidtransPaymentSynchronizer.php"
click node_admin_catalog "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/ProductController.php"
click node_admin_categories "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/CategoryController.php"
click node_admin_features "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/HomepageFeatureController.php"
click node_admin_orders "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/OrderController.php"
click node_admin_customers "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/CustomerController.php"
click node_auth_profile "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/AuthController.php"
click node_profile "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Customer/ProfileController.php"
click node_regions "https://github.com/lohahola/tubes-pec/blob/main/app/Services/IndonesiaRegionService.php"
click node_region_endpoint "https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/IndonesiaRegionController.php"
click node_user_model "https://github.com/lohahola/tubes-pec/blob/main/app/Models/User.php"
click node_order_model "https://github.com/lohahola/tubes-pec/blob/main/app/Models/Order.php"
click node_payment_model "https://github.com/lohahola/tubes-pec/blob/main/app/Models/Payment.php"
click node_notification_model "https://github.com/lohahola/tubes-pec/blob/main/app/Models/PaymentNotification.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_storefront,node_products,node_reviews toneBlue
class node_cart,node_cart_state,node_checkout,node_orders,node_cancellation,node_reservation_expiry,node_order_model toneAmber
class node_payment_flow,node_payment_sync,node_payment_model,node_notification_model,node_web_routes toneMint
class node_admin_catalog,node_admin_categories,node_admin_features,node_admin_orders,node_admin_customers toneRose
class node_auth_profile,node_profile,node_regions,node_region_endpoint,node_user_model,node_customer,node_midtrans,node_admin_actor toneIndigo
```

## Components

### Storefront & Catalog

- [Storefront browsing](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/StorefrontController.php): `app/Http/Controllers/StorefrontController.php`
- [Product catalog](https://github.com/lohahola/tubes-pec/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Product reviews](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/ProductReviewController.php): `app/Http/Controllers/ProductReviewController.php`

### Cart & Orders

- [Cart management](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/CartController.php): `app/Http/Controllers/CartController.php`
- [Cart state](https://github.com/lohahola/tubes-pec/blob/main/app/Models/Cart.php): `app/Models/Cart.php`
- [Checkout & reservation](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/CheckoutController.php): `app/Http/Controllers/CheckoutController.php`
- [Order tracking](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/OrderController.php): `app/Http/Controllers/OrderController.php`
- [Order cancellation](https://github.com/lohahola/tubes-pec/blob/main/app/Services/OrderCancellationService.php): `app/Services/OrderCancellationService.php`
- [Reservation expiry](https://github.com/lohahola/tubes-pec/blob/main/app/Console/Commands/ReleaseExpiredOrderReservations.php): `app/Console/Commands/ReleaseExpiredOrderReservations.php`
- [Order records](https://github.com/lohahola/tubes-pec/blob/main/app/Models/Order.php): `app/Models/Order.php`

### Payments

- [Payment handling](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/PaymentController.php): `app/Http/Controllers/PaymentController.php`
- [Payment synchronization](https://github.com/lohahola/tubes-pec/blob/main/app/Services/MidtransPaymentSynchronizer.php): `app/Services/MidtransPaymentSynchronizer.php`
- [Payment records](https://github.com/lohahola/tubes-pec/blob/main/app/Models/Payment.php): `app/Models/Payment.php`
- [Payment notifications](https://github.com/lohahola/tubes-pec/blob/main/app/Models/PaymentNotification.php): `app/Models/PaymentNotification.php`

### Store Administration

- [Catalog administration](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/ProductController.php): `app/Http/Controllers/Admin/ProductController.php`
- [Category administration](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/CategoryController.php): `app/Http/Controllers/Admin/CategoryController.php`
- [Homepage promotions](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/HomepageFeatureController.php): `app/Http/Controllers/Admin/HomepageFeatureController.php`
- [Order administration](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/OrderController.php): `app/Http/Controllers/Admin/OrderController.php`
- [Customer administration](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Admin/CustomerController.php): `app/Http/Controllers/Admin/CustomerController.php`

### Accounts & Address

- [Account & profile](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Profile management](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/Customer/ProfileController.php): `app/Http/Controllers/Customer/ProfileController.php`
- [Region lookup](https://github.com/lohahola/tubes-pec/blob/main/app/Services/IndonesiaRegionService.php): `app/Services/IndonesiaRegionService.php`
- [Region endpoints](https://github.com/lohahola/tubes-pec/blob/main/app/Http/Controllers/IndonesiaRegionController.php): `app/Http/Controllers/IndonesiaRegionController.php`
- [Customer accounts](https://github.com/lohahola/tubes-pec/blob/main/app/Models/User.php): `app/Models/User.php`

### Other components

- **Customer**
- [Web routes](https://github.com/lohahola/tubes-pec/blob/main/routes/web.php): `routes/web.php`
- **Midtrans Snap**
- **Store admin**

## Connections

- Customer → Web routes: requests (evidence: `routes/web.php`)
- Web routes → Storefront browsing: routes to (evidence: `routes/web.php`)
- Web routes → Cart management: routes to (evidence: `routes/web.php`)
- Web routes → Checkout & reservation: routes to (evidence: `routes/web.php`)
- Web routes → Payment handling: routes to (evidence: `routes/web.php`)
- Web routes → Order tracking: routes to (evidence: `routes/web.php`)
- Web routes → Product reviews: routes to (evidence: `routes/web.php`)
- Web routes → Account & profile: routes to (evidence: `routes/web.php`)
- Web routes → Profile management: routes to (evidence: `routes/web.php`)
- Web routes → Region endpoints: routes to (evidence: `routes/web.php`)
- Web routes → Catalog administration: routes to (evidence: `routes/web.php`)
- Web routes → Category administration: routes to (evidence: `routes/web.php`)
- Web routes → Homepage promotions: routes to (evidence: `routes/web.php`)
- Web routes → Order administration: routes to (evidence: `routes/web.php`)
- Web routes → Customer administration: routes to (evidence: `routes/web.php`)
- Storefront browsing → Product catalog: queries (evidence: `app/Http/Controllers/StorefrontController.php`)
- Product catalog → Product reviews: has reviews (evidence: `app/Models/Product.php`)
- Customer → Cart management: manages
- Cart management → Cart state: updates (evidence: `app/Http/Controllers/CartController.php`)
- Cart management → Product catalog: reads (evidence: `app/Http/Controllers/CartController.php`)
- Checkout & reservation → Cart state: reads (evidence: `app/Http/Controllers/CheckoutController.php`)
- Checkout & reservation → Product catalog: reserves stock (evidence: `app/Http/Controllers/CheckoutController.php`)
- Checkout & reservation → Order records: creates (evidence: `app/Http/Controllers/CheckoutController.php`)
- Customer → Checkout & reservation: places order
- Order tracking → Order records: reads (evidence: `app/Http/Controllers/OrderController.php`)
- Order tracking → Payment synchronization: synchronizes (evidence: `app/Http/Controllers/OrderController.php`)
- Order tracking → Order cancellation: delegates cancellation (evidence: `app/Http/Controllers/OrderController.php`)
- Reservation expiry → Order records: releases expired (evidence: `app/Console/Commands/ReleaseExpiredOrderReservations.php`)
- Reservation expiry → Product catalog: restores stock (evidence: `app/Console/Commands/ReleaseExpiredOrderReservations.php`)
- Payment handling → Order records: loads order (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment handling → Payment records: records attempt (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment handling → Midtrans Snap: creates Snap session (evidence: `app/Http/Controllers/PaymentController.php`)
- Midtrans Snap → Payment handling: notifies (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment handling → Payment notifications: records notification (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment handling → Product catalog: restores stock (evidence: `app/Http/Controllers/PaymentController.php`)
- Order cancellation → Payment records: updates attempts (evidence: `app/Services/OrderCancellationService.php`)
- Order cancellation → Midtrans Snap: cancels payment (evidence: `app/Services/OrderCancellationService.php`)
- Order cancellation → Product catalog: restores stock (evidence: `app/Services/OrderCancellationService.php`)
- Store admin → Web routes: manages store (evidence: `routes/web.php`)
- Catalog administration → Product catalog: manages (evidence: `app/Http/Controllers/Admin/ProductController.php`)
- Catalog administration → Category administration: uses categories (evidence: `app/Http/Controllers/Admin/ProductController.php`)
- Homepage promotions → Product catalog: selects products (evidence: `app/Http/Controllers/Admin/HomepageFeatureController.php`)
- Order administration → Order records: manages (evidence: `app/Http/Controllers/Admin/OrderController.php`)
- Customer administration → Customer accounts: reads customers (evidence: `app/Http/Controllers/Admin/CustomerController.php`)
- Customer administration → Order records: reads history (evidence: `app/Http/Controllers/Admin/CustomerController.php`)
- Category administration → Product catalog: manages categories (evidence: `app/Http/Controllers/Admin/CategoryController.php`)
- Account & profile → Customer accounts: authenticates (evidence: `app/Http/Controllers/AuthController.php`)
- Profile management → Region lookup: validates address (evidence: `app/Http/Controllers/Customer/ProfileController.php`)
