# kfflyan/agroordergpa architecture

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

- Interactive diagram: https://gitdiagram.com/kfflyan/agroordergpa
- Repository: https://github.com/kfflyan/agroordergpa

## Overview

AgroOrder GPA is a Laravel web system for the Green Pasundan Agriculture cooperative, connecting clients and five internal roles across commodity availability, orders, billing, payments, and delivery. Its main business flow runs from client catalog and order activity through staff verification and invoicing, payment review, then dispatch and proof of delivery; coordinators maintain harvest stock, while directors oversee governance and reporting. The README documents these capabilities and role boundaries. Some controller and routing implementations were not sampled, so uncertain cross-module links are omitted or marked unverified.

Main entry points: [`app/Services/OrderService.php`](https://github.com/kfflyan/agroordergpa/blob/main/app/Services/OrderService.php) (Order processing), [`app/Models/Order.php`](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Order.php) (Orders and items), [`app/Models/Payment.php`](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Payment.php) (Payments), [`app/Models/Product.php`](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Product.php) (Products)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and catalog"]
  node_auth["Authentication"]
  node_public_catalog["Public catalog"]
  node_client_order_ui["Client ordering"]
  node_users[("User accounts<br/>[User.php]")]
end

subgraph group_commerce["Orders and finance"]
  node_order_service["Order processing<br/>[OrderService.php]"]
  node_orders[("Orders and items<br/>[Order.php]")]
  node_contracts[("Client contracts<br/>[Contract.php]")]
  node_invoices[("Invoices<br/>[Invoice.php]")]
  node_payments[("Payments<br/>[Payment.php]")]
  node_secretariat["Order and payment desk"]
end

subgraph group_supply["Stock and delivery"]
  node_product[("Products<br/>[Product.php]")]
  node_stock["Stock operations<br/>[StockService.php]"]
  node_harvest[("Harvest batches<br/>[HarvestBatch.php]")]
  node_fleet["Fleet delivery"]
end

subgraph group_oversight["Governance and reporting"]
  node_director["Director oversight"]
  node_governance["Governance controls"]
  node_reports["Reports and printing"]
end

node_client(("Client"))
node_staff(("GPA staff"))

node_client -.->|"signs in"| node_auth
node_client -.->|"browses"| node_public_catalog
node_client -.->|"orders"| node_client_order_ui
node_staff -.->|"administers"| node_secretariat
node_staff -.->|"delivers"| node_fleet
node_staff -.->|"oversees"| node_director
node_public_catalog -.->|"reads catalog"| node_product
node_client_order_ui -.->|"submits orders"| node_order_service
node_secretariat -->|"creates orders"| node_order_service
node_order_service -->|"persists"| node_orders
node_order_service -->|"allocates stock"| node_stock
node_order_service -->|"checks terms"| node_contracts
node_order_service -->|"issues billing"| node_invoices
node_secretariat -.->|"reviews payments"| node_payments
node_client_order_ui -.->|"submits proof"| node_payments
node_product -->|"has batches"| node_harvest
node_stock -->|"updates stock"| node_product
node_fleet -->|"records delivery"| node_orders
node_director -.->|"manages controls"| node_governance
node_director -.->|"requests reports"| node_reports
node_reports -->|"reads transactions"| node_orders
node_reports -->|"reads payments"| node_payments
node_users -->|"owns orders"| node_orders
node_orders -->|"references invoice"| node_invoices
node_orders -->|"has payments"| node_payments
node_invoices -->|"has payments"| node_payments
node_contracts -->|"binds product"| node_product

click node_auth "https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Auth"
click node_public_catalog "https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Public"
click node_client_order_ui "https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Klien"
click node_users "https://github.com/kfflyan/agroordergpa/blob/main/app/Models/User.php"
click node_product "https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Product.php"
click node_stock "https://github.com/kfflyan/agroordergpa/blob/main/app/Services/StockService.php"
click node_harvest "https://github.com/kfflyan/agroordergpa/blob/main/app/Models/HarvestBatch.php"
click node_order_service "https://github.com/kfflyan/agroordergpa/blob/main/app/Services/OrderService.php"
click node_orders "https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Order.php"
click node_contracts "https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Contract.php"
click node_invoices "https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Invoice.php"
click node_payments "https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Payment.php"
click node_secretariat "https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Sekretaris"
click node_fleet "https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Armada"
click node_director "https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Direktur"
click node_governance "https://github.com/kfflyan/agroordergpa/blob/main/app/Services/TataKelolaService.php"
click node_reports "https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Prints"

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_auth,node_public_catalog,node_client_order_ui,node_users,node_client toneBlue
class node_order_service,node_orders,node_contracts,node_invoices,node_payments,node_secretariat toneAmber
class node_product,node_stock,node_harvest,node_fleet toneMint
class node_director,node_governance,node_reports toneRose
class node_staff toneIndigo
```

## Components

### Access and catalog

- [Authentication](https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Auth): `app/Http/Controllers/Auth`
- [Public catalog](https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Public): `app/Http/Controllers/Public`
- [Client ordering](https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Klien): `app/Http/Controllers/Klien`
- [User accounts](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/User.php): `app/Models/User.php`

### Orders and finance

- [Order processing](https://github.com/kfflyan/agroordergpa/blob/main/app/Services/OrderService.php): `app/Services/OrderService.php`
- [Orders and items](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Client contracts](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Contract.php): `app/Models/Contract.php`
- [Invoices](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Invoice.php): `app/Models/Invoice.php`
- [Payments](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Payment.php): `app/Models/Payment.php`
- [Order and payment desk](https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Sekretaris): `app/Http/Controllers/Sekretaris`

### Stock and delivery

- [Products](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Stock operations](https://github.com/kfflyan/agroordergpa/blob/main/app/Services/StockService.php): `app/Services/StockService.php`
- [Harvest batches](https://github.com/kfflyan/agroordergpa/blob/main/app/Models/HarvestBatch.php): `app/Models/HarvestBatch.php`
- [Fleet delivery](https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Armada): `app/Http/Controllers/Armada`

### Governance and reporting

- [Director oversight](https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Direktur): `app/Http/Controllers/Direktur`
- [Governance controls](https://github.com/kfflyan/agroordergpa/blob/main/app/Services/TataKelolaService.php): `app/Services/TataKelolaService.php`
- [Reports and printing](https://github.com/kfflyan/agroordergpa/tree/main/app/Http/Controllers/Prints): `app/Http/Controllers/Prints`

### Other components

- **Client**
- **GPA staff**

## Connections

- Client → Authentication: signs in
- Client → Public catalog: browses
- Client → Client ordering: orders
- GPA staff → Order and payment desk: administers
- GPA staff → Fleet delivery: delivers
- GPA staff → Director oversight: oversees
- Public catalog → Products: reads catalog (evidence: `app/Http/Controllers/Public/HomeController.php`)
- Client ordering → Order processing: submits orders
- Order and payment desk → Order processing: creates orders (evidence: `app/Http/Controllers/Sekretaris/PesananManualController.php`)
- Order processing → Orders and items: persists (evidence: `app/Services/OrderService.php`)
- Order processing → Stock operations: allocates stock (evidence: `app/Services/OrderService.php`)
- Order processing → Client contracts: checks terms (evidence: `app/Services/OrderService.php`)
- Order processing → Invoices: issues billing (evidence: `app/Services/OrderService.php`)
- Order and payment desk → Payments: reviews payments (evidence: `app/Http/Controllers/Sekretaris/PesananManualController.php`)
- Client ordering → Payments: submits proof (evidence: `app/Http/Controllers/Klien/DashboardController.php`)
- Products → Harvest batches: has batches (evidence: `app/Models/Product.php`)
- Stock operations → Products: updates stock (evidence: `app/Services/StockService.php`)
- Fleet delivery → Orders and items: records delivery (evidence: `app/Http/Controllers/Armada/BuktiTerimaController.php`)
- Director oversight → Governance controls: manages controls
- Director oversight → Reports and printing: requests reports
- Reports and printing → Orders and items: reads transactions (evidence: `app/Http/Controllers/Prints/PrintLaporanController.php`)
- Reports and printing → Payments: reads payments (evidence: `app/Http/Controllers/Prints/PrintLaporanController.php`)
- User accounts → Orders and items: owns orders (evidence: `app/Models/User.php`)
- Orders and items → Invoices: references invoice (evidence: `app/Models/Order.php`)
- Orders and items → Payments: has payments (evidence: `app/Models/Order.php`)
- Invoices → Payments: has payments (evidence: `app/Models/Invoice.php`)
- Client contracts → Products: binds product (evidence: `app/Models/Contract.php`)
