# coreunion/coreshop architecture

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

- Interactive diagram: https://gitdiagram.com/coreunion/coreshop
- Repository: https://github.com/coreunion/coreshop

## Overview

CoreShop is a .NET commerce backend for a cross-platform storefront and an administrative console. The storefront API supports account and cart operations and exposes commerce capabilities; administrators manage catalog, orders, promotions, members, and service-product redemption. The tree and README document broader areas including payments, fulfillment, distribution, reporting, and configurable pages/forms. Sampled controller excerpts confirm selected service calls; unsampled feature wiring is represented only at the subsystem level, not as a guessed execution sequence.

Main entry points: [`CoreCms.Net.Web.WebApi/Controllers/UserController.cs`](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.WebApi/Controllers/UserController.cs) (Storefront API), [`CoreCms.Net.IRepository/IBaseRepository.cs`](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IRepository/IBaseRepository.cs) (Repository contracts), [`CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs`](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs) (Order management), [`CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs`](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry points"]
  node_storefront_api["Storefront API<br/>[UserController.cs]"]
  node_admin_orders["Order management"]
  node_admin_goods["Goods management"]
  node_admin_promo["Promotion management"]
  node_admin_users["Member management"]
  node_admin_forms["Form submissions"]
  node_admin_services["Service redemption"]
end

subgraph group_commerce["Commerce operations"]
  node_cart["Cart operations"]
  node_users["Member services"]
  node_orders["Order services"]
  node_payments["Payment services"]
  node_fulfillment["Fulfillment records"]
  node_service_goods["Service tickets"]
end

subgraph group_catalog["Catalog and marketing"]
  node_goods["Product catalog"]
  node_promotions["Promotions and coupons"]
  node_distribution["Distribution and agents"]
  node_forms["Custom forms"]
  node_shop_config["Store configuration"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication policies"]
  node_persistence["Repository contracts<br/>[IBaseRepository.cs]"]
  node_database_setup[("SQL persistence setup<br/>[SqlSugarSetup.cs]")]
  node_cache["Cache providers<br/>[ManualDataCache.cs]"]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))

node_shopper -->|"requests"| node_storefront_api
node_admin -->|"manages orders"| node_admin_orders
node_admin -->|"manages catalog"| node_admin_goods
node_admin -->|"configures offers"| node_admin_promo
node_admin -->|"manages members"| node_admin_users
node_admin -->|"reviews submissions"| node_admin_forms
node_admin -->|"manages redemption"| node_admin_services
node_storefront_api -->|"queries and updates"| node_users
node_storefront_api -->|"gets cart count"| node_cart
node_storefront_api -->|"queries products"| node_goods
node_admin_orders -->|"queries and updates"| node_orders
node_admin_orders -->|"initiates payment"| node_payments
node_admin_goods -->|"queries and updates"| node_goods
node_admin_promo -->|"manages promotions"| node_promotions
node_admin_users -->|"queries members"| node_users
node_admin_forms -->|"queries submissions"| node_forms
node_admin_services -->|"queries tickets"| node_service_goods
node_orders -.->|"records delivery"| node_fulfillment
node_goods -.->|"uses repository layer"| node_persistence
node_promotions -.->|"uses repository layer"| node_persistence
node_persistence -.->|"configured through"| node_database_setup
node_storefront_api -.->|"protected by"| node_auth
node_storefront_api -.->|"may use caching"| node_cache
node_distribution -.->|"uses repository layer"| node_persistence
node_shop_config -.->|"uses repository layer"| node_persistence

click node_storefront_api "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.WebApi/Controllers/UserController.cs"
click node_admin_orders "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs"
click node_admin_goods "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs"
click node_admin_promo "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs"
click node_admin_users "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs"
click node_admin_forms "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/IntelligentForms/CoreCmsFormSubmitController.cs"
click node_admin_services "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesOrderController.cs"
click node_cart "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Cart/ICoreCmsCartServices.cs"
click node_users "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/User/ICoreCmsUserServices.cs"
click node_orders "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Order/ICoreCmsOrderServices.cs"
click node_payments "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Pay/IWeChatPayServices.cs"
click node_fulfillment "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IRepository/Bill/ICoreCmsBillDeliveryRepository.cs"
click node_service_goods "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Service/ICoreCmsUserServicesTicketServices.cs"
click node_goods "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs"
click node_promotions "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Promotion/ICoreCmsPromotionServices.cs"
click node_distribution "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionServices.cs"
click node_forms "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/intelligentForms/ICoreCmsFormServices.cs"
click node_shop_config "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Shop/ICoreCmsPagesServices.cs"
click node_auth "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Auth/AuthorizationSetup.cs"
click node_persistence "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IRepository/IBaseRepository.cs"
click node_database_setup "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Core/Config/SqlSugarSetup.cs"
click node_cache "https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Caching/Manual/ManualDataCache.cs"

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_api,node_admin_orders,node_admin_goods,node_admin_promo,node_admin_users,node_admin_forms,node_admin_services toneBlue
class node_cart,node_users,node_orders,node_payments,node_fulfillment,node_service_goods toneAmber
class node_goods,node_promotions,node_distribution,node_forms,node_shop_config toneMint
class node_auth,node_persistence,node_database_setup,node_cache toneRose
class node_shopper,node_admin toneIndigo
```

## Components

### API entry points

- [Storefront API](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.WebApi/Controllers/UserController.cs): `CoreCms.Net.Web.WebApi/Controllers/UserController.cs`
- [Order management](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs): `CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsOrderController.cs`
- [Goods management](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs): `CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs`
- [Promotion management](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs): `CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs`
- [Member management](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs): `CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs`
- [Form submissions](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/IntelligentForms/CoreCmsFormSubmitController.cs): `CoreCms.Net.Web.Admin/Controllers/IntelligentForms/CoreCmsFormSubmitController.cs`
- [Service redemption](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesOrderController.cs): `CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesOrderController.cs`

### Commerce operations

- [Cart operations](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Cart/ICoreCmsCartServices.cs): `CoreCms.Net.IServices/Cart/ICoreCmsCartServices.cs`
- [Member services](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/User/ICoreCmsUserServices.cs): `CoreCms.Net.IServices/User/ICoreCmsUserServices.cs`
- [Order services](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Order/ICoreCmsOrderServices.cs): `CoreCms.Net.IServices/Order/ICoreCmsOrderServices.cs`
- [Payment services](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Pay/IWeChatPayServices.cs): `CoreCms.Net.IServices/Pay/IWeChatPayServices.cs`
- [Fulfillment records](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IRepository/Bill/ICoreCmsBillDeliveryRepository.cs): `CoreCms.Net.IRepository/Bill/ICoreCmsBillDeliveryRepository.cs`
- [Service tickets](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Service/ICoreCmsUserServicesTicketServices.cs): `CoreCms.Net.IServices/Service/ICoreCmsUserServicesTicketServices.cs`

### Catalog and marketing

- [Product catalog](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs): `CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs`
- [Promotions and coupons](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Promotion/ICoreCmsPromotionServices.cs): `CoreCms.Net.IServices/Promotion/ICoreCmsPromotionServices.cs`
- [Distribution and agents](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Distribution/ICoreCmsDistributionServices.cs): `CoreCms.Net.IServices/Distribution/ICoreCmsDistributionServices.cs`
- [Custom forms](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/intelligentForms/ICoreCmsFormServices.cs): `CoreCms.Net.IServices/intelligentForms/ICoreCmsFormServices.cs`
- [Store configuration](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IServices/Shop/ICoreCmsPagesServices.cs): `CoreCms.Net.IServices/Shop/ICoreCmsPagesServices.cs`

### Platform services

- [Authentication policies](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Auth/AuthorizationSetup.cs): `CoreCms.Net.Auth/AuthorizationSetup.cs`
- [Repository contracts](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.IRepository/IBaseRepository.cs): `CoreCms.Net.IRepository/IBaseRepository.cs`
- [SQL persistence setup](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Core/Config/SqlSugarSetup.cs): `CoreCms.Net.Core/Config/SqlSugarSetup.cs`
- [Cache providers](https://github.com/coreunion/coreshop/blob/master/CoreCms.Net.Caching/Manual/ManualDataCache.cs): `CoreCms.Net.Caching/Manual/ManualDataCache.cs`

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Storefront API: requests
- Administrator → Order management: manages orders
- Administrator → Goods management: manages catalog
- Administrator → Promotion management: configures offers
- Administrator → Member management: manages members
- Administrator → Form submissions: reviews submissions
- Administrator → Service redemption: manages redemption
- Storefront API → Member services: queries and updates
- Storefront API → Cart operations: gets cart count
- Storefront API → Product catalog: queries products
- Order management → Order services: queries and updates
- Order management → Payment services: initiates payment
- Goods management → Product catalog: queries and updates
- Promotion management → Promotions and coupons: manages promotions
- Member management → Member services: queries members
- Form submissions → Custom forms: queries submissions
- Service redemption → Service tickets: queries tickets
- Order services → Fulfillment records: records delivery
- Product catalog → Repository contracts: uses repository layer
- Promotions and coupons → Repository contracts: uses repository layer
- Repository contracts → SQL persistence setup: configured through
- Storefront API → Authentication policies: protected by
- Storefront API → Cache providers: may use caching
- Distribution and agents → Repository contracts: uses repository layer
- Store configuration → Repository contracts: uses repository layer
