# yuth04/vendo-api architecture

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

- Interactive diagram: https://gitdiagram.com/yuth04/vendo-api
- Repository: https://github.com/yuth04/vendo-api

## Overview

VENDO is a Laravel REST backend for customer apps and an admin panel. The documented customer journey spans product/catalog discovery, cart and order handling, payment, and post-order returns, refunds, or exchanges; admin capabilities include inventory, discounts, reporting, and order/revenue statistics. The graph groups those domain areas and highlights shared persistence and notification layers. Most controller code is unsampled, so links based only on documented capabilities are marked dashed and unevidenced; sampled source supports the cited model and service relationships.

Main entry points: [`app/Http/Controllers/api/v1/Auth/AuthController.php`](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Auth/AuthController.php) (Authentication), [`app/Http/Controllers/api/v1/Orders/ReturnOrderController.php`](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Orders/ReturnOrderController.php) (Returns and Exchanges), [`routes/api.php`](https://github.com/yuth04/vendo-api/blob/Vendo/routes/api.php) (REST API Routes), [`app/Http/Controllers/api/v1/Orders/OrderController.php`](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Orders/OrderController.php) (Order Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Commerce API"]
  node_api["REST API Routes<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_users["User Accounts<br/>[User.php]"]
  node_cart["Shopping Cart<br/>[CartService.php]"]
  node_orders["Order Management"]
  node_order_data["Orders and Items<br/>[Order.php]"]
  node_payments["Payment Processing"]
  node_payment_services["Payment Providers<br/>[BakongService.php]"]
  node_payment_data["Payment Records<br/>[Payment.php]"]
end

subgraph group_catalog["Catalog and Marketing"]
  node_catalog_api["Product Catalog"]
  node_products["Products and Variants<br/>[Product.php]"]
  node_discounts["Discounts"]
end

subgraph group_aftercare["Order Aftercare"]
  node_returns["Returns and Exchanges"]
  node_refunds["Refund Processing<br/>[RefundService.php]"]
  node_exchanges["Exchange Processing"]
  node_return_data["Return Records<br/>[ReturnOrder.php]"]
end

subgraph group_admin["Admin Operations"]
  node_dashboard["Admin Dashboard"]
  node_reporting["Reports and Exports"]
end

subgraph group_shared["Shared Runtime"]
  node_notifications["User Notifications<br/>[NotifiesUsers.php]"]
  node_notification_data["Notification Records<br/>[Notification.php]"]
  node_logs["System Logging"]
  node_database[("PostgreSQL")]
end

node_customer(("Customer"))
node_admin_user(("Admin User"))
node_payment_gateway{{"Payment Gateway"}}

node_customer -.->|"calls API"| node_api
node_admin_user -.->|"calls API"| node_api
node_api -->|"routes requests"| node_auth
node_api -->|"routes requests"| node_catalog_api
node_auth -->|"manages accounts"| node_users
node_catalog_api -->|"reads catalog"| node_products
node_customer -.->|"manages cart"| node_cart
node_cart -.->|"supports checkout"| node_orders
node_orders -.->|"manages orders"| node_order_data
node_customer -.->|"places orders"| node_orders
node_orders -.->|"initiates payment"| node_payments
node_payments -->|"uses provider"| node_payment_services
node_payment_services -.->|"requests payment"| node_payment_gateway
node_payment_services -->|"updates records"| node_payment_data
node_order_data -->|"has payment"| node_payment_data
node_customer -.->|"requests return"| node_returns
node_returns -->|"manages returns"| node_return_data
node_returns -->|"processes refunds"| node_refunds
node_returns -->|"processes exchanges"| node_exchanges
node_admin_user -.->|"views statistics"| node_dashboard
node_admin_user -.->|"requests reports"| node_reporting
node_dashboard -->|"reads inventory"| node_products
node_dashboard -->|"reads order data"| node_order_data
node_auth -->|"creates notices"| node_notifications
node_notifications -->|"creates records"| node_notification_data
node_auth -->|"records activity"| node_logs
node_logs -.->|"persists logs"| node_database
node_order_data -.->|"persists orders"| node_database
node_products -.->|"persists catalog"| node_database
node_payment_data -.->|"persists payments"| node_database

click node_api "https://github.com/yuth04/vendo-api/blob/Vendo/routes/api.php"
click node_auth "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Auth/AuthController.php"
click node_users "https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/User.php"
click node_catalog_api "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/ProductController.php"
click node_products "https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Product.php"
click node_discounts "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Marketing/DiscountController.php"
click node_cart "https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/CartService.php"
click node_orders "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Orders/OrderController.php"
click node_order_data "https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Order.php"
click node_payments "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Payment/PaymentController.php"
click node_payment_services "https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/BakongService.php"
click node_payment_data "https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Payment.php"
click node_returns "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Orders/ReturnOrderController.php"
click node_refunds "https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/RefundService.php"
click node_exchanges "https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/ExchangeService.php"
click node_return_data "https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/ReturnOrder.php"
click node_dashboard "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Admin/DashboardController.php"
click node_reporting "https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Reports/ReportController.php"
click node_notifications "https://github.com/yuth04/vendo-api/blob/Vendo/app/Traits/NotifiesUsers.php"
click node_notification_data "https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Notification.php"
click node_logs "https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/SystemLogService.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_api,node_auth,node_users,node_cart,node_orders,node_order_data,node_payments,node_payment_services,node_payment_data,node_admin_user toneBlue
class node_catalog_api,node_products,node_discounts toneAmber
class node_returns,node_refunds,node_exchanges,node_return_data toneMint
class node_dashboard,node_reporting toneRose
class node_notifications,node_notification_data,node_logs,node_database,node_customer,node_payment_gateway toneIndigo
```

## Components

### Commerce API

- [REST API Routes](https://github.com/yuth04/vendo-api/blob/Vendo/routes/api.php): `routes/api.php`
- [Authentication](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Auth/AuthController.php): `app/Http/Controllers/api/v1/Auth/AuthController.php`
- [User Accounts](https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/User.php): `app/Models/User.php`
- [Shopping Cart](https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/CartService.php): `app/Services/CartService.php`
- [Order Management](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Orders/OrderController.php): `app/Http/Controllers/api/v1/Orders/OrderController.php`
- [Orders and Items](https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Order.php): `app/Models/Order.php`
- [Payment Processing](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Payment/PaymentController.php): `app/Http/Controllers/api/v1/Payment/PaymentController.php`
- [Payment Providers](https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/BakongService.php): `app/Services/BakongService.php`
- [Payment Records](https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Payment.php): `app/Models/Payment.php`

### Catalog and Marketing

- [Product Catalog](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/ProductController.php): `app/Http/Controllers/api/v1/ProductController.php`
- [Products and Variants](https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Product.php): `app/Models/Product.php`
- [Discounts](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Marketing/DiscountController.php): `app/Http/Controllers/api/v1/Marketing/DiscountController.php`

### Order Aftercare

- [Returns and Exchanges](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Orders/ReturnOrderController.php): `app/Http/Controllers/api/v1/Orders/ReturnOrderController.php`
- [Refund Processing](https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/RefundService.php): `app/Services/RefundService.php`
- [Exchange Processing](https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/ExchangeService.php): `app/Services/ExchangeService.php`
- [Return Records](https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/ReturnOrder.php): `app/Models/ReturnOrder.php`

### Admin Operations

- [Admin Dashboard](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Admin/DashboardController.php): `app/Http/Controllers/api/v1/Admin/DashboardController.php`
- [Reports and Exports](https://github.com/yuth04/vendo-api/blob/Vendo/app/Http/Controllers/api/v1/Reports/ReportController.php): `app/Http/Controllers/api/v1/Reports/ReportController.php`

### Shared Runtime

- [User Notifications](https://github.com/yuth04/vendo-api/blob/Vendo/app/Traits/NotifiesUsers.php): `app/Traits/NotifiesUsers.php`
- [Notification Records](https://github.com/yuth04/vendo-api/blob/Vendo/app/Models/Notification.php): `app/Models/Notification.php`
- [System Logging](https://github.com/yuth04/vendo-api/blob/Vendo/app/Services/SystemLogService.php): `app/Services/SystemLogService.php`
- **PostgreSQL**

### Other components

- **Customer**
- **Admin User**
- **Payment Gateway**

## Connections

- Customer → REST API Routes: calls API
- Admin User → REST API Routes: calls API
- REST API Routes → Authentication: routes requests (evidence: `routes/api.php`)
- REST API Routes → Product Catalog: routes requests (evidence: `routes/api.php`)
- Authentication → User Accounts: manages accounts (evidence: `app/Http/Controllers/api/v1/Auth/AuthController.php`)
- Product Catalog → Products and Variants: reads catalog (evidence: `app/Http/Controllers/api/v1/ProductController.php`)
- Customer → Shopping Cart: manages cart
- Shopping Cart → Order Management: supports checkout
- Order Management → Orders and Items: manages orders
- Customer → Order Management: places orders
- Order Management → Payment Processing: initiates payment
- Payment Processing → Payment Providers: uses provider (evidence: `app/Http/Controllers/api/v1/Payment/PaymentController.php`)
- Payment Providers → Payment Gateway: requests payment
- Payment Providers → Payment Records: updates records (evidence: `app/Services/BakongService.php`)
- Orders and Items → Payment Records: has payment (evidence: `app/Models/Order.php`)
- Customer → Returns and Exchanges: requests return
- Returns and Exchanges → Return Records: manages returns (evidence: `app/Http/Controllers/api/v1/Orders/ReturnOrderController.php`)
- Returns and Exchanges → Refund Processing: processes refunds (evidence: `app/Http/Controllers/api/v1/Orders/ReturnOrderController.php`)
- Returns and Exchanges → Exchange Processing: processes exchanges (evidence: `app/Http/Controllers/api/v1/Orders/ReturnOrderController.php`)
- Admin User → Admin Dashboard: views statistics
- Admin User → Reports and Exports: requests reports
- Admin Dashboard → Products and Variants: reads inventory (evidence: `app/Http/Controllers/api/v1/Admin/DashboardController.php`)
- Admin Dashboard → Orders and Items: reads order data (evidence: `app/Http/Controllers/api/v1/Admin/DashboardController.php`)
- Authentication → User Notifications: creates notices (evidence: `app/Http/Controllers/api/v1/Auth/AuthController.php`)
- User Notifications → Notification Records: creates records (evidence: `app/Traits/NotifiesUsers.php`)
- Authentication → System Logging: records activity (evidence: `app/Http/Controllers/api/v1/Auth/AuthController.php`)
- System Logging → PostgreSQL: persists logs
- Orders and Items → PostgreSQL: persists orders
- Products and Variants → PostgreSQL: persists catalog
- Payment Records → PostgreSQL: persists payments
