# gongfuxiang/shopxo architecture

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

- Interactive diagram: https://gitdiagram.com/gongfuxiang/shopxo
- Repository: https://github.com/gongfuxiang/shopxo

## Overview

ShopXO is a PHP e-commerce platform with storefront, API, and administration surfaces. The main shopper journey is product discovery, cart/checkout, and order handling, with payment as a distinct capability. Internal services implement these domains and shared concerns such as user accounts, configuration, localization, and resources. The README documents broader capabilities including visual DIY, forms, multi-warehouse and multi-merchant operation, and extensible payment methods. Some connections rely on documented capability or indexed references because the relevant source was not excerpted.

Main entry points: [`app/admin/controller`](https://github.com/gongfuxiang/shopxo/tree/master/app/admin/controller) (Admin Console), [`app/index/controller`](https://github.com/gongfuxiang/shopxo/tree/master/app/index/controller) (Storefront), [`app/service/SearchService.php`](https://github.com/gongfuxiang/shopxo/blob/master/app/service/SearchService.php) (Product Search), [`app/service/GoodsService.php`](https://github.com/gongfuxiang/shopxo/blob/master/app/service/GoodsService.php) (Product Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surfaces["User Surfaces"]
  node_storefront["Storefront"]
  node_api["Application API"]
  node_admin["Admin Console"]
end

subgraph group_commerce["Commerce Flow"]
  node_search["Product Search<br/>[SearchService.php]"]
  node_catalog["Product Catalog<br/>[GoodsService.php]"]
  node_cart["Cart"]
  node_checkout["Purchase Flow<br/>[BuyService.php]"]
  node_orders["Order Management<br/>[OrderService.php]"]
  node_payments["Payments<br/>[PaymentService.php]"]
end

subgraph group_content["Content Tools"]
  node_diy["Visual DIY<br/>[DiyModule.php]"]
  node_forms["Form Builder"]
  node_themes["Theme Management"]
end

subgraph group_platform["Shared Platform"]
  node_users["Accounts<br/>[UserService.php]"]
  node_database[("Application Database")]
  node_configuration["System Configuration<br/>[ConfigService.php]"]
  node_resources["Site Resources"]
  node_localization["Localization<br/>[I18nService.php]"]
end

subgraph group_operations["Operations"]
  node_warehouses["Warehouse Inventory"]
  node_plugins["Plugin System<br/>[PluginsService.php]"]
end

node_shopper(("Shopper"))
node_admin_actor(("Administrator"))
node_payment_provider(("Payment Provider"))

node_shopper -->|"browses"| node_storefront
node_shopper -->|"uses"| node_api
node_admin_actor -->|"manages"| node_admin
node_storefront -->|"searches via"| node_search
node_api -->|"searches via"| node_search
node_search -->|"queries"| node_catalog
node_storefront -.->|"cart actions"| node_cart
node_storefront -.->|"starts purchase"| node_checkout
node_checkout -.->|"creates orders"| node_orders
node_orders -->|"coordinates payment"| node_payments
node_payments -.->|"calls provider"| node_payment_provider
node_search -->|"reads"| node_database
node_catalog -->|"reads and writes"| node_database
node_orders -->|"reads and writes"| node_database
node_users -->|"reads and writes"| node_database
node_admin -.->|"configures"| node_diy
node_admin -.->|"configures"| node_forms
node_admin -.->|"manages"| node_themes
node_admin -.->|"manages"| node_warehouses
node_configuration -->|"configures"| node_resources
node_localization -->|"stores translations"| node_database
node_plugins -.->|"extends settings"| node_configuration
node_catalog -.->|"uses inventory"| node_warehouses

click node_storefront "https://github.com/gongfuxiang/shopxo/tree/master/app/index/controller"
click node_api "https://github.com/gongfuxiang/shopxo/tree/master/app/api/controller"
click node_admin "https://github.com/gongfuxiang/shopxo/tree/master/app/admin/controller"
click node_search "https://github.com/gongfuxiang/shopxo/blob/master/app/service/SearchService.php"
click node_catalog "https://github.com/gongfuxiang/shopxo/blob/master/app/service/GoodsService.php"
click node_cart "https://github.com/gongfuxiang/shopxo/blob/master/app/service/GoodsCartService.php"
click node_checkout "https://github.com/gongfuxiang/shopxo/blob/master/app/service/BuyService.php"
click node_orders "https://github.com/gongfuxiang/shopxo/blob/master/app/service/OrderService.php"
click node_payments "https://github.com/gongfuxiang/shopxo/blob/master/app/service/PaymentService.php"
click node_users "https://github.com/gongfuxiang/shopxo/blob/master/app/service/UserService.php"
click node_configuration "https://github.com/gongfuxiang/shopxo/blob/master/app/service/ConfigService.php"
click node_resources "https://github.com/gongfuxiang/shopxo/blob/master/app/service/ResourcesService.php"
click node_localization "https://github.com/gongfuxiang/shopxo/blob/master/app/service/I18nService.php"
click node_diy "https://github.com/gongfuxiang/shopxo/blob/master/app/module/DiyModule.php"
click node_forms "https://github.com/gongfuxiang/shopxo/blob/master/app/module/FormTableHandleModule.php"
click node_themes "https://github.com/gongfuxiang/shopxo/blob/master/app/service/ThemeAdminService.php"
click node_warehouses "https://github.com/gongfuxiang/shopxo/blob/master/app/service/WarehouseGoodsService.php"
click node_plugins "https://github.com/gongfuxiang/shopxo/blob/master/app/service/PluginsService.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_storefront,node_api,node_admin toneBlue
class node_search,node_catalog,node_cart,node_checkout,node_orders,node_payments toneAmber
class node_diy,node_forms,node_themes toneMint
class node_users,node_database,node_configuration,node_resources,node_localization toneRose
class node_warehouses,node_plugins,node_shopper,node_admin_actor,node_payment_provider toneIndigo
```

## Components

### User Surfaces

- [Storefront](https://github.com/gongfuxiang/shopxo/tree/master/app/index/controller): `app/index/controller`
- [Application API](https://github.com/gongfuxiang/shopxo/tree/master/app/api/controller): `app/api/controller`
- [Admin Console](https://github.com/gongfuxiang/shopxo/tree/master/app/admin/controller): `app/admin/controller`

### Commerce Flow

- [Product Search](https://github.com/gongfuxiang/shopxo/blob/master/app/service/SearchService.php): `app/service/SearchService.php`
- [Product Catalog](https://github.com/gongfuxiang/shopxo/blob/master/app/service/GoodsService.php): `app/service/GoodsService.php`
- [Cart](https://github.com/gongfuxiang/shopxo/blob/master/app/service/GoodsCartService.php): `app/service/GoodsCartService.php`
- [Purchase Flow](https://github.com/gongfuxiang/shopxo/blob/master/app/service/BuyService.php): `app/service/BuyService.php`
- [Order Management](https://github.com/gongfuxiang/shopxo/blob/master/app/service/OrderService.php): `app/service/OrderService.php`
- [Payments](https://github.com/gongfuxiang/shopxo/blob/master/app/service/PaymentService.php): `app/service/PaymentService.php`

### Content Tools

- [Visual DIY](https://github.com/gongfuxiang/shopxo/blob/master/app/module/DiyModule.php): `app/module/DiyModule.php`
- [Form Builder](https://github.com/gongfuxiang/shopxo/blob/master/app/module/FormTableHandleModule.php): `app/module/FormTableHandleModule.php`
- [Theme Management](https://github.com/gongfuxiang/shopxo/blob/master/app/service/ThemeAdminService.php): `app/service/ThemeAdminService.php`

### Shared Platform

- [Accounts](https://github.com/gongfuxiang/shopxo/blob/master/app/service/UserService.php): `app/service/UserService.php`
- **Application Database**
- [System Configuration](https://github.com/gongfuxiang/shopxo/blob/master/app/service/ConfigService.php): `app/service/ConfigService.php`
- [Site Resources](https://github.com/gongfuxiang/shopxo/blob/master/app/service/ResourcesService.php): `app/service/ResourcesService.php`
- [Localization](https://github.com/gongfuxiang/shopxo/blob/master/app/service/I18nService.php): `app/service/I18nService.php`

### Operations

- [Warehouse Inventory](https://github.com/gongfuxiang/shopxo/blob/master/app/service/WarehouseGoodsService.php): `app/service/WarehouseGoodsService.php`
- [Plugin System](https://github.com/gongfuxiang/shopxo/blob/master/app/service/PluginsService.php): `app/service/PluginsService.php`

### Other components

- **Shopper**
- **Administrator**
- **Payment Provider**

## Connections

- Shopper → Storefront: browses
- Shopper → Application API: uses
- Administrator → Admin Console: manages
- Storefront → Product Search: searches via (evidence: `app/index/controller/Search.php`)
- Application API → Product Search: searches via (evidence: `app/api/controller/Search.php`)
- Product Search → Product Catalog: queries (evidence: `app/service/SearchService.php`)
- Storefront → Cart: cart actions
- Storefront → Purchase Flow: starts purchase
- Purchase Flow → Order Management: creates orders (evidence: `app/service/OrderService.php`)
- Order Management → Payments: coordinates payment (evidence: `app/service/OrderService.php`)
- Payments → Payment Provider: calls provider
- Product Search → Application Database: reads (evidence: `app/service/SearchService.php`)
- Product Catalog → Application Database: reads and writes (evidence: `app/service/GoodsService.php`)
- Order Management → Application Database: reads and writes (evidence: `app/service/OrderService.php`)
- Accounts → Application Database: reads and writes (evidence: `app/service/UserService.php`)
- Admin Console → Visual DIY: configures
- Admin Console → Form Builder: configures
- Admin Console → Theme Management: manages
- Admin Console → Warehouse Inventory: manages
- System Configuration → Site Resources: configures (evidence: `app/service/ResourcesService.php`)
- Localization → Application Database: stores translations (evidence: `app/service/I18nService.php`)
- Plugin System → System Configuration: extends settings
- Product Catalog → Warehouse Inventory: uses inventory (evidence: `app/service/GoodsService.php`)
