# bagus-26/projectuts-papb architecture

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

- Interactive diagram: https://gitdiagram.com/bagus-26/projectuts-papb
- Repository: https://github.com/bagus-26/projectuts-papb

## Overview

MakanYuk is a ready-to-eat food ordering system: customers use a Flutter app against a Laravel/MySQL REST API to browse products, manage a cart, check out, and track orders; staff manage products, store hours, and order states through a web admin panel. The README documents these capabilities, but the supplied tree and excerpts do not include Flutter’s `lib/` sources or API route definitions, so those internal links are shown only where documented; unverified wiring is omitted.

Main entry points: [`backend/routes/api.php`](https://github.com/bagus-26/projectuts-papb/blob/main/backend/routes/api.php) (REST API), [`backend/app/Services/CheckoutService.php`](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/CheckoutService.php) (Checkout), [`backend/app/Services/PesananService.php`](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/PesananService.php) (Order transitions), [`backend/app/Models/Pesanan.php`](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Pesanan.php) (Orders and details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer ordering"]
  node_flutter["Flutter app"]
end

subgraph group_backend["Ordering backend"]
  node_api["REST API<br/>[api.php]"]
  node_catalog["Product catalog"]
  node_cart["Cart management"]
  node_checkout["Checkout"]
  node_orders["Order history"]
  node_references["API references"]
end

subgraph group_operations["Admin operations"]
  node_admin["Admin panel<br/>[web.php]"]
  node_admin_orders["Admin order actions"]
  node_admin_products["Admin product CRUD"]
  node_admin_store["Store settings<br/>[TokoController.php]"]
end

subgraph group_domain["Domain and state"]
  node_order_service["Order transitions<br/>[PesananService.php]"]
  node_product_service["Product rules<br/>[ProdukService.php]"]
  node_store_hours["Store hours<br/>[JamOperasiToko.php]"]
  node_order_states["Order state machine<br/>[StatusPesanan.php]"]
  node_products[("Products and variants<br/>[Produk.php]")]
  node_cart_data[("Cart data<br/>[Keranjang.php]")]
  node_order_data[("Orders and details<br/>[Pesanan.php]")]
  node_delivery_payment[("Delivery and payment<br/>[Kurir.php]")]
  node_response["API response format<br/>[ResponsApi.php]"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_flutter
node_flutter -->|"calls API"| node_api
node_api -.->|"routes requests"| node_catalog
node_api -.->|"routes requests"| node_cart
node_api -.->|"routes checkout"| node_checkout
node_api -.->|"routes requests"| node_orders
node_api -.->|"serves lookups"| node_references
node_checkout -->|"checks hours"| node_store_hours
node_checkout -->|"reads and clears"| node_cart_data
node_checkout -->|"checks stock"| node_products
node_checkout -->|"creates order"| node_order_data
node_checkout -->|"validates choices"| node_delivery_payment
node_catalog -->|"delegates changes"| node_product_service
node_product_service -->|"manages products"| node_products
node_orders -->|"delegates status"| node_order_service
node_orders -->|"reads history"| node_order_data
node_order_service -->|"updates state"| node_order_data
node_order_service -->|"checks transitions"| node_order_states
node_admin -->|"routes admin"| node_admin_orders
node_admin -->|"routes admin"| node_admin_products
node_admin -->|"routes admin"| node_admin_store
node_admin_orders -->|"changes status"| node_order_service
node_admin_orders -->|"offers transitions"| node_order_states
node_admin_products -->|"delegates CRUD"| node_product_service
node_admin_store -->|"configures hours"| node_store_hours
node_api -->|"formats errors"| node_response
node_order_data -->|"relates details"| node_products

click node_api "https://github.com/bagus-26/projectuts-papb/blob/main/backend/routes/api.php"
click node_catalog "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/ProdukController.php"
click node_cart "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/KeranjangController.php"
click node_checkout "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/CheckoutService.php"
click node_orders "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/PesananController.php"
click node_order_service "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/PesananService.php"
click node_product_service "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/ProdukService.php"
click node_store_hours "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Support/JamOperasiToko.php"
click node_order_states "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Support/StatusPesanan.php"
click node_products "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Produk.php"
click node_cart_data "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Keranjang.php"
click node_order_data "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Pesanan.php"
click node_admin "https://github.com/bagus-26/projectuts-papb/blob/main/backend/routes/web.php"
click node_admin_orders "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Admin/PesananController.php"
click node_admin_products "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Admin/ProdukController.php"
click node_admin_store "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Admin/TokoController.php"
click node_references "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/KategoriController.php"
click node_delivery_payment "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Kurir.php"
click node_response "https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Support/ResponsApi.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_flutter toneBlue
class node_api,node_catalog,node_cart,node_checkout,node_orders,node_references toneAmber
class node_admin,node_admin_orders,node_admin_products,node_admin_store toneMint
class node_order_service,node_product_service,node_store_hours,node_order_states,node_products,node_cart_data,node_order_data,node_delivery_payment,node_response toneRose
class node_customer toneIndigo
```

## Components

### Customer ordering

- **Flutter app**

### Ordering backend

- [REST API](https://github.com/bagus-26/projectuts-papb/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Product catalog](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/ProdukController.php): `backend/app/Http/Controllers/Api/ProdukController.php`
- [Cart management](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/KeranjangController.php): `backend/app/Http/Controllers/Api/KeranjangController.php`
- [Checkout](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/CheckoutService.php): `backend/app/Services/CheckoutService.php`
- [Order history](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/PesananController.php): `backend/app/Http/Controllers/Api/PesananController.php`
- [API references](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Api/KategoriController.php): `backend/app/Http/Controllers/Api/KategoriController.php`

### Admin operations

- [Admin panel](https://github.com/bagus-26/projectuts-papb/blob/main/backend/routes/web.php): `backend/routes/web.php`
- [Admin order actions](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Admin/PesananController.php): `backend/app/Http/Controllers/Admin/PesananController.php`
- [Admin product CRUD](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Admin/ProdukController.php): `backend/app/Http/Controllers/Admin/ProdukController.php`
- [Store settings](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Http/Controllers/Admin/TokoController.php): `backend/app/Http/Controllers/Admin/TokoController.php`

### Domain and state

- [Order transitions](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/PesananService.php): `backend/app/Services/PesananService.php`
- [Product rules](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Services/ProdukService.php): `backend/app/Services/ProdukService.php`
- [Store hours](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Support/JamOperasiToko.php): `backend/app/Support/JamOperasiToko.php`
- [Order state machine](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Support/StatusPesanan.php): `backend/app/Support/StatusPesanan.php`
- [Products and variants](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Produk.php): `backend/app/Models/Produk.php`
- [Cart data](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Keranjang.php): `backend/app/Models/Keranjang.php`
- [Orders and details](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Pesanan.php): `backend/app/Models/Pesanan.php`
- [Delivery and payment](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Models/Kurir.php): `backend/app/Models/Kurir.php`
- [API response format](https://github.com/bagus-26/projectuts-papb/blob/main/backend/app/Support/ResponsApi.php): `backend/app/Support/ResponsApi.php`

### Other components

- **Customer**

## Connections

- Customer → Flutter app: uses (evidence: `README.md`)
- Flutter app → REST API: calls API (evidence: `README.md`)
- REST API → Product catalog: routes requests
- REST API → Cart management: routes requests
- REST API → Checkout: routes checkout
- REST API → Order history: routes requests
- REST API → API references: serves lookups
- Checkout → Store hours: checks hours (evidence: `backend/app/Services/CheckoutService.php`)
- Checkout → Cart data: reads and clears (evidence: `backend/app/Services/CheckoutService.php`)
- Checkout → Products and variants: checks stock (evidence: `backend/app/Services/CheckoutService.php`)
- Checkout → Orders and details: creates order (evidence: `backend/app/Services/CheckoutService.php`)
- Checkout → Delivery and payment: validates choices (evidence: `backend/app/Services/CheckoutService.php`)
- Product catalog → Product rules: delegates changes (evidence: `backend/app/Http/Controllers/Api/ProdukController.php`)
- Product rules → Products and variants: manages products (evidence: `backend/app/Services/ProdukService.php`)
- Order history → Order transitions: delegates status (evidence: `backend/app/Http/Controllers/Api/PesananController.php`)
- Order history → Orders and details: reads history (evidence: `backend/app/Http/Controllers/Api/PesananController.php`)
- Order transitions → Orders and details: updates state (evidence: `backend/app/Services/PesananService.php`)
- Order transitions → Order state machine: checks transitions (evidence: `backend/app/Services/PesananService.php`)
- Admin panel → Admin order actions: routes admin (evidence: `backend/routes/web.php`)
- Admin panel → Admin product CRUD: routes admin (evidence: `backend/routes/web.php`)
- Admin panel → Store settings: routes admin (evidence: `backend/routes/web.php`)
- Admin order actions → Order transitions: changes status (evidence: `backend/app/Http/Controllers/Admin/PesananController.php`)
- Admin order actions → Order state machine: offers transitions (evidence: `backend/app/Http/Controllers/Admin/PesananController.php`)
- Admin product CRUD → Product rules: delegates CRUD (evidence: `backend/app/Http/Controllers/Admin/ProdukController.php`)
- Store settings → Store hours: configures hours (evidence: `backend/app/Http/Controllers/Admin/TokoController.php`)
- REST API → API response format: formats errors
- Orders and details → Products and variants: relates details (evidence: `backend/app/Models/Pesanan.php`)
