# waddi3/twiva-social-e-commerce- architecture

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

- Interactive diagram: https://gitdiagram.com/waddi3/twiva-social-e-commerce-
- Repository: https://github.com/waddi3/twiva-social-e-commerce-

## Overview

Twiva is a commerce and creator-marketing platform: buyers browse influencer shops and check out, while businesses and influencers manage products and campaigns. The graph emphasizes the sampled checkout path plus buyer, order, transaction, and notification domain stages, and retains the documented-by-tree Admin, campaign, and AliExpress capabilities as distinct branches. Connections for unsampled areas are omitted rather than inferred; paths for those nodes use existing directories.

Main entry points: [`twiva-new/Modules/Order/Entities/Order.php`](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Order/Entities/Order.php) (Orders), [`twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php) (Shop Checkout), [`twiva-new/Modules/Buyer/Entities/Buyer.php`](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Buyer/Entities/Buyer.php) (Buyer Records), [`twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php`](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php) (E-commerce Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Shopping &amp; Checkout"]
  node_checkout["Shop Checkout"]
  node_ecommerce_checkout["E-commerce Checkout"]
  node_shop_catalog["Influencer Shops"]
  node_buyer_account["Buyer Accounts"]
  node_buyer_model[("Buyer Records<br/>[Buyer.php]")]
  node_invoice[("Invoices<br/>[Invoice.php]")]
end

subgraph group_order["Orders &amp; Payments"]
  node_orders[("Orders<br/>[Order.php]")]
  node_shipping[("Shipping Addresses")]
  node_transactions[("Transactions<br/>[Transaction.php]")]
  node_delivery["Delivery Tracking"]
end

subgraph group_marketplace["Creator Marketplace"]
  node_user[("User &amp; Creator<br/>[User.php]")]
  node_influencer_api["Influencer Features"]
  node_campaigns["Campaign Management"]
  node_products["Product Management"]
  node_caption_service["AI Captions"]
end

subgraph group_operations["Platform Operations"]
  node_notifications[("Notifications<br/>[Notification.php]")]
  node_admin["Admin Console"]
  node_aliexpress["AliExpress Import"]
end

node_buyer_actor(("Buyer"))
node_external_ai{{"ChatGPT API"}}

node_buyer_actor -->|"starts checkout"| node_checkout
node_checkout -->|"loads buyer"| node_buyer_model
node_checkout -->|"creates orders"| node_orders
node_checkout -->|"checks payment"| node_transactions
node_checkout -->|"loads products"| node_shop_catalog
node_checkout -->|"stores address"| node_shipping
node_ecommerce_checkout -->|"creates orders"| node_orders
node_ecommerce_checkout -->|"uses payment"| node_transactions
node_ecommerce_checkout -->|"uses address"| node_shipping
node_ecommerce_checkout -->|"uses invoice"| node_invoice
node_orders -->|"belongs to"| node_buyer_model
node_orders -->|"references address"| node_shipping
node_orders -->|"links transactions"| node_transactions
node_delivery -->|"reads order"| node_orders
node_delivery -->|"notifies buyer"| node_notifications
node_buyer_account -->|"manages account"| node_buyer_model
node_buyer_model -->|"has orders"| node_orders
node_buyer_model -->|"has invoices"| node_invoice
node_user -.->|"owns shop"| node_shop_catalog
node_influencer_api -->|"updates profile"| node_user
node_caption_service -->|"requests captions"| node_external_ai
node_campaigns -.->|"serves creators"| node_user
node_admin -.->|"administers"| node_campaigns
node_aliexpress -.->|"imports products"| node_products

click node_checkout "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php"
click node_ecommerce_checkout "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php"
click node_shop_catalog "https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Shop"
click node_buyer_account "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Buyer/Http/Controllers/BuyerController.php"
click node_buyer_model "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Buyer/Entities/Buyer.php"
click node_invoice "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Buyer/Entities/Invoice.php"
click node_orders "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Order/Entities/Order.php"
click node_shipping "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Order/Entities/ShippingAddress.php"
click node_transactions "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Home/Entities/Transaction.php"
click node_delivery "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Order/Http/Controllers/OrderDeliveryCodeController.php"
click node_notifications "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Notification/Entities/Notification.php"
click node_user "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/User/Entities/User.php"
click node_influencer_api "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Home/Http/Controllers/API/V2/InfluencerController.php"
click node_campaigns "https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Campaign"
click node_products "https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Products"
click node_caption_service "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Products/Services/LLMCaptionService.php"
click node_admin "https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Admin"
click node_aliexpress "https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/AliExpress/Http/Controllers/AliExpressController.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_checkout,node_ecommerce_checkout,node_shop_catalog,node_buyer_account,node_buyer_model,node_invoice toneBlue
class node_orders,node_shipping,node_transactions,node_delivery toneAmber
class node_user,node_influencer_api,node_campaigns,node_products,node_caption_service,node_external_ai toneMint
class node_notifications,node_admin,node_aliexpress toneRose
class node_buyer_actor toneIndigo
```

## Components

### Shopping & Checkout

- [Shop Checkout](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php): `twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`
- [E-commerce Checkout](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php): `twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php`
- [Influencer Shops](https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Shop): `twiva-new/Modules/Shop`
- [Buyer Accounts](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Buyer/Http/Controllers/BuyerController.php): `twiva-new/Modules/Buyer/Http/Controllers/BuyerController.php`
- [Buyer Records](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Buyer/Entities/Buyer.php): `twiva-new/Modules/Buyer/Entities/Buyer.php`
- [Invoices](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Buyer/Entities/Invoice.php): `twiva-new/Modules/Buyer/Entities/Invoice.php`

### Orders & Payments

- [Orders](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Order/Entities/Order.php): `twiva-new/Modules/Order/Entities/Order.php`
- [Shipping Addresses](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Order/Entities/ShippingAddress.php): `twiva-new/Modules/Order/Entities/ShippingAddress.php`
- [Transactions](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Home/Entities/Transaction.php): `twiva-new/Modules/Home/Entities/Transaction.php`
- [Delivery Tracking](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Order/Http/Controllers/OrderDeliveryCodeController.php): `twiva-new/Modules/Order/Http/Controllers/OrderDeliveryCodeController.php`

### Creator Marketplace

- [User & Creator](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/User/Entities/User.php): `twiva-new/Modules/User/Entities/User.php`
- [Influencer Features](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Home/Http/Controllers/API/V2/InfluencerController.php): `twiva-new/Modules/Home/Http/Controllers/API/V2/InfluencerController.php`
- [Campaign Management](https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Campaign): `twiva-new/Modules/Campaign`
- [Product Management](https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Products): `twiva-new/Modules/Products`
- [AI Captions](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Products/Services/LLMCaptionService.php): `twiva-new/Modules/Products/Services/LLMCaptionService.php`

### Platform Operations

- [Notifications](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/Notification/Entities/Notification.php): `twiva-new/Modules/Notification/Entities/Notification.php`
- [Admin Console](https://github.com/waddi3/twiva-social-e-commerce-/tree/main/twiva-new/Modules/Admin): `twiva-new/Modules/Admin`
- [AliExpress Import](https://github.com/waddi3/twiva-social-e-commerce-/blob/main/twiva-new/Modules/AliExpress/Http/Controllers/AliExpressController.php): `twiva-new/Modules/AliExpress/Http/Controllers/AliExpressController.php`

### Other components

- **Buyer**
- **ChatGPT API**

## Connections

- Buyer → Shop Checkout: starts checkout (evidence: `twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`)
- Shop Checkout → Buyer Records: loads buyer (evidence: `twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`)
- Shop Checkout → Orders: creates orders (evidence: `twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`)
- Shop Checkout → Transactions: checks payment (evidence: `twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`)
- Shop Checkout → Influencer Shops: loads products (evidence: `twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`)
- Shop Checkout → Shipping Addresses: stores address (evidence: `twiva-new/Modules/Shop/Http/Controllers/CheckoutController.php`)
- E-commerce Checkout → Orders: creates orders (evidence: `twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php`)
- E-commerce Checkout → Transactions: uses payment (evidence: `twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php`)
- E-commerce Checkout → Shipping Addresses: uses address (evidence: `twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php`)
- E-commerce Checkout → Invoices: uses invoice (evidence: `twiva-new/Modules/Shop/Http/Controllers/ECommerce/ECommerceCheckoutController.php`)
- Orders → Buyer Records: belongs to (evidence: `twiva-new/Modules/Order/Entities/Order.php`)
- Orders → Shipping Addresses: references address (evidence: `twiva-new/Modules/Order/Entities/Order.php`)
- Orders → Transactions: links transactions (evidence: `twiva-new/Modules/Order/Entities/Order.php`)
- Delivery Tracking → Orders: reads order (evidence: `twiva-new/Modules/Order/Http/Controllers/OrderDeliveryCodeController.php`)
- Delivery Tracking → Notifications: notifies buyer (evidence: `twiva-new/Modules/Order/Http/Controllers/OrderDeliveryCodeController.php`)
- Buyer Accounts → Buyer Records: manages account (evidence: `twiva-new/Modules/Buyer/Http/Controllers/BuyerController.php`)
- Buyer Records → Orders: has orders (evidence: `twiva-new/Modules/Buyer/Entities/Buyer.php`)
- Buyer Records → Invoices: has invoices (evidence: `twiva-new/Modules/Buyer/Entities/Buyer.php`)
- User & Creator → Influencer Shops: owns shop (evidence: `twiva-new/Modules/User/Entities/User.php`)
- Influencer Features → User & Creator: updates profile (evidence: `twiva-new/Modules/Home/Http/Controllers/API/V2/InfluencerController.php`)
- AI Captions → ChatGPT API: requests captions (evidence: `twiva-new/Modules/Products/Services/LLMCaptionService.php`)
- Campaign Management → User & Creator: serves creators
- Admin Console → Campaign Management: administers
- AliExpress Import → Product Management: imports products
