English

Multi-tenant SaaS WeChat Mall

A multi-tenant WeChat mall for small merchants, each with its own subdomain, database and shared admin console.

Get a free proposal and quote

Background

Small merchants wanted to launch a WeChat mall quickly without running their own infrastructure, while the platform team needed one system to manage multiple merchants with strict separation of products, orders, members and payments. The goal was a multi-tenant mall where each merchant gets its own subdomain, database schema and WeChat configuration, with upgrades handled centrally.

Solution

  • Tenant resolution by domain: Nginx wildcard subdomains and a backend TenantFilter resolve tenants from the Host header, supporting fixed mappings and a subdomain strategy with no per-merchant code changes.
  • Schema-level isolation: each merchant gets a dedicated MySQL schema; a routing datasource runs USE <schema> on every connection, preventing cross-tenant reads and writes at the physical layer.
  • One console for the full journey: SPU/SKU, inventory, orders, payments, refunds, shipping, after-sales, membership, coupons, group buying, flash sales and reconciliation.
  • Per-tenant WeChat isolation: mini program/public account appIds, payment certificates, callback domains and upload folders are separated to prevent cross-tenant messaging or payment issues.
  • Standardised handover: tenant registry, initialisation SQL, migration scripts, Nginx configuration and runbooks are delivered together, so onboarding follows a checklist.

Deliverables

  • Multi-tenant mall: admin console, WeChat mini program and H5 storefront
  • Products, orders, membership, marketing, WeChat Pay/refunds, shipping and after-sales
  • Tenant registry, initialisation SQL and database migrations
  • Nginx wildcard domain, SSL and isolated upload directories
  • Deployment, backup, upgrade and rollback documentation

Technology stack

Spring Boot 3Vue 3微信小程序MySQLRedisNginx

Outcome

Serving three merchants in production with stable product, order and payment flows. Onboarding a new merchant means creating a schema, registering the tenant and configuring its domain and mini program — no redeployment.

Services