# abdulrahman-alholo/syrian-souq architecture

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

- Interactive diagram: https://gitdiagram.com/abdulrahman-alholo/syrian-souq
- Repository: https://github.com/abdulrahman-alholo/syrian-souq

## Overview

Syrian-Souq is a Laravel multi-vendor marketplace. Customers browse products, manage a multi-vendor cart, check out, and pay; orders can then be split into vendor-specific fulfillment records. The wider product includes vendor and platform-admin panels, order state enforcement, a financial ledger and payout lifecycle, and payment webhooks. The graph emphasizes documented capabilities and relationships visible in excerpts or the source index; some administrative and finance links are intentionally left unconnected because their implementation was not sampled.

Main entry points: [`app/Modules/Cart/Services/CheckoutService.php`](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Services/CheckoutService.php) (Checkout), [`app/Modules/Cart/Controllers/CartController.php`](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Controllers/CartController.php) (Cart endpoints), [`app/Modules/Payment/Services/PaymentService.php`](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Services/PaymentService.php) (Payment service), [`app/Jobs/ProcessPaymentWebhookJob.php`](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Jobs/ProcessPaymentWebhookJob.php) (Webhook processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront commerce"]
  node_catalog["Product catalog"]
  node_variants["Product variants<br/>[ProductVariant.php]"]
  node_cart_api["Cart endpoints<br/>[CartController.php]"]
  node_cart_service["Cart management<br/>[CartService.php]"]
  node_checkout["Checkout"]
end

subgraph group_orders["Orders and fulfillment"]
  node_order_service["Order service<br/>[OrderService.php]"]
  node_split_job["Vendor order splitting"]
  node_vendor_orders["Vendor orders<br/>[VendorOrder.php]"]
  node_order_workflow["Order state workflow"]
  node_vendor_observer["Vendor order observer"]
end

subgraph group_payments["Payments and finance"]
  node_payment_service["Payment service<br/>[PaymentService.php]"]
  node_gateway_factory["Gateway selection"]
  node_stripe["Stripe gateway<br/>[StripeGateway.php]"]
  node_webhook_controller["Webhook intake"]
  node_webhook_job["Webhook processing"]
  node_payment_records[("Payment and webhook records<br/>[Payment.php]")]
  node_ledger["Financial ledger<br/>[LedgerService.php]"]
  node_payouts["Payout lifecycle<br/>[PayoutService.php]"]
end

subgraph group_operations["Marketplace operations"]
  node_panels["Admin and vendor panels"]
  node_resources["Marketplace management"]
end

node_customer(("Customer"))
node_stripe_service{{"Stripe"}}

node_customer -.->|"browses"| node_catalog
node_customer -.->|"manages cart"| node_cart_api
node_cart_api -->|"delegates to"| node_cart_service
node_cart_api -->|"starts checkout"| node_checkout
node_cart_api -->|"initiates payment"| node_payment_service
node_cart_service -->|"uses"| node_variants
node_checkout -->|"locks and checks"| node_variants
node_checkout -->|"dispatches"| node_split_job
node_checkout -->|"delegates cancellation"| node_order_service
node_split_job -->|"creates via splitter"| node_vendor_orders
node_vendor_observer -->|"invokes"| node_order_workflow
node_payment_service -->|"selects gateway"| node_gateway_factory
node_gateway_factory -->|"creates gateway"| node_stripe
node_payment_service -->|"creates and updates"| node_payment_records
node_stripe -.->|"calls"| node_stripe_service
node_stripe_service -.->|"sends events"| node_webhook_controller
node_webhook_controller -->|"dispatches"| node_webhook_job
node_webhook_job -->|"selects gateway"| node_gateway_factory
node_webhook_job -->|"reads and updates"| node_payment_records
node_vendor_orders -->|"ledger inputs"| node_ledger
node_panels -.->|"provides dashboards"| node_resources
node_customer -.->|"places order"| node_checkout
node_panels -.->|"manages payouts"| node_payouts

click node_catalog "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Catalog/Services/CatalogQueryService.php"
click node_variants "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Catalog/Models/ProductVariant.php"
click node_cart_api "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Controllers/CartController.php"
click node_cart_service "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Services/CartService.php"
click node_checkout "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Services/CheckoutService.php"
click node_order_service "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Services/OrderService.php"
click node_split_job "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Jobs/SplitOrderIntoVendorOrdersJob.php"
click node_vendor_orders "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Models/VendorOrder.php"
click node_order_workflow "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Services/OrderWorkflowService.php"
click node_vendor_observer "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Observers/VendorOrderObserver.php"
click node_payment_service "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Services/PaymentService.php"
click node_gateway_factory "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Factories/PaymentGatewayFactory.php"
click node_stripe "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Gateways/StripeGateway.php"
click node_webhook_controller "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Controllers/WebhookController.php"
click node_webhook_job "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Jobs/ProcessPaymentWebhookJob.php"
click node_payment_records "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Models/Payment.php"
click node_ledger "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Finance/Services/LedgerService.php"
click node_payouts "https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Finance/Services/PayoutService.php"
click node_panels "https://github.com/abdulrahman-alholo/syrian-souq/tree/main/app/Providers/Filament"
click node_resources "https://github.com/abdulrahman-alholo/syrian-souq/tree/main/app/Filament/Resources"

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_catalog,node_variants,node_cart_api,node_cart_service,node_checkout toneBlue
class node_order_service,node_split_job,node_vendor_orders,node_order_workflow,node_vendor_observer toneAmber
class node_payment_service,node_gateway_factory,node_stripe,node_webhook_controller,node_webhook_job,node_payment_records,node_ledger,node_payouts toneMint
class node_panels,node_resources toneRose
class node_customer,node_stripe_service toneIndigo
```

## Components

### Storefront commerce

- [Product catalog](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Catalog/Services/CatalogQueryService.php): `app/Modules/Catalog/Services/CatalogQueryService.php`
- [Product variants](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Catalog/Models/ProductVariant.php): `app/Modules/Catalog/Models/ProductVariant.php`
- [Cart endpoints](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Controllers/CartController.php): `app/Modules/Cart/Controllers/CartController.php`
- [Cart management](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Services/CartService.php): `app/Modules/Cart/Services/CartService.php`
- [Checkout](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Cart/Services/CheckoutService.php): `app/Modules/Cart/Services/CheckoutService.php`

### Orders and fulfillment

- [Order service](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Services/OrderService.php): `app/Modules/Order/Services/OrderService.php`
- [Vendor order splitting](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Jobs/SplitOrderIntoVendorOrdersJob.php): `app/Jobs/SplitOrderIntoVendorOrdersJob.php`
- [Vendor orders](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Models/VendorOrder.php): `app/Modules/Order/Models/VendorOrder.php`
- [Order state workflow](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Services/OrderWorkflowService.php): `app/Modules/Order/Services/OrderWorkflowService.php`
- [Vendor order observer](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Order/Observers/VendorOrderObserver.php): `app/Modules/Order/Observers/VendorOrderObserver.php`

### Payments and finance

- [Payment service](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Services/PaymentService.php): `app/Modules/Payment/Services/PaymentService.php`
- [Gateway selection](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Factories/PaymentGatewayFactory.php): `app/Modules/Payment/Factories/PaymentGatewayFactory.php`
- [Stripe gateway](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Gateways/StripeGateway.php): `app/Modules/Payment/Gateways/StripeGateway.php`
- [Webhook intake](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Controllers/WebhookController.php): `app/Modules/Payment/Controllers/WebhookController.php`
- [Webhook processing](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Jobs/ProcessPaymentWebhookJob.php): `app/Jobs/ProcessPaymentWebhookJob.php`
- [Payment and webhook records](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Payment/Models/Payment.php): `app/Modules/Payment/Models/Payment.php`
- [Financial ledger](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Finance/Services/LedgerService.php): `app/Modules/Finance/Services/LedgerService.php`
- [Payout lifecycle](https://github.com/abdulrahman-alholo/syrian-souq/blob/main/app/Modules/Finance/Services/PayoutService.php): `app/Modules/Finance/Services/PayoutService.php`

### Marketplace operations

- [Admin and vendor panels](https://github.com/abdulrahman-alholo/syrian-souq/tree/main/app/Providers/Filament): `app/Providers/Filament`
- [Marketplace management](https://github.com/abdulrahman-alholo/syrian-souq/tree/main/app/Filament/Resources): `app/Filament/Resources`

### Other components

- **Customer**
- **Stripe**

## Connections

- Customer → Product catalog: browses (evidence: `README.md`)
- Customer → Cart endpoints: manages cart (evidence: `README.md`)
- Cart endpoints → Cart management: delegates to (evidence: `app/Modules/Cart/Controllers/CartController.php`)
- Cart endpoints → Checkout: starts checkout (evidence: `app/Modules/Cart/Controllers/CartController.php`)
- Cart endpoints → Payment service: initiates payment (evidence: `app/Modules/Cart/Controllers/CartController.php`)
- Cart management → Product variants: uses (evidence: `app/Modules/Cart/Services/CartService.php`)
- Checkout → Product variants: locks and checks (evidence: `app/Modules/Cart/Services/CheckoutService.php`)
- Checkout → Vendor order splitting: dispatches (evidence: `app/Modules/Cart/Services/CheckoutService.php`)
- Checkout → Order service: delegates cancellation (evidence: `app/Modules/Cart/Services/CheckoutService.php`)
- Vendor order splitting → Vendor orders: creates via splitter (evidence: `app/Jobs/SplitOrderIntoVendorOrdersJob.php`)
- Vendor order observer → Order state workflow: invokes (evidence: `app/Modules/Order/Observers/VendorOrderObserver.php`)
- Payment service → Gateway selection: selects gateway (evidence: `app/Modules/Payment/Services/PaymentService.php`)
- Gateway selection → Stripe gateway: creates gateway (evidence: `app/Modules/Payment/Factories/PaymentGatewayFactory.php`)
- Payment service → Payment and webhook records: creates and updates (evidence: `app/Modules/Payment/Services/PaymentService.php`)
- Stripe gateway → Stripe: calls
- Stripe → Webhook intake: sends events
- Webhook intake → Webhook processing: dispatches (evidence: `app/Modules/Payment/Controllers/WebhookController.php`)
- Webhook processing → Gateway selection: selects gateway (evidence: `app/Jobs/ProcessPaymentWebhookJob.php`)
- Webhook processing → Payment and webhook records: reads and updates (evidence: `app/Jobs/ProcessPaymentWebhookJob.php`)
- Vendor orders → Financial ledger: ledger inputs (evidence: `app/Modules/Finance/Services/LedgerService.php`)
- Admin and vendor panels → Marketplace management: provides dashboards (evidence: `README.md`)
- Customer → Checkout: places order (evidence: `README.md`)
- Admin and vendor panels → Payout lifecycle: manages payouts (evidence: `README.md`)
