gitmyhub

xu-shop

Go ★ 145 updated 6d ago

Full stack single merchant e-commerce platform for the WeChat ecosystem with a Go backend, Taro shopper apps, and a Vue 3 admin console, AGPL-3.0 licensed.

GoGinGORMPostgreSQLRedisTaroVuesetup: hardcomplexity 4/5

xu-shop is an open source full stack e-commerce project aimed at a single merchant who wants their own private store running on the WeChat ecosystem. The README is in Chinese, but the structure is recognisable: a WeChat mini program and H5 web app for shoppers, a Vue 3 admin console for the merchant, and a Go backend that holds it all together. The whole thing is presented as a complete production-grade reference implementation, shipped with 16 product requirement documents and 17 architecture documents.

The technology stack splits cleanly across layers. The backend is Go 1.22 with Gin, GORM, PostgreSQL 15, Redis 7, and the asynq job queue. The shopper-facing apps are built once in Taro 4 with React 18 and TypeScript, then run as both a mini program and an H5 site. The admin console is Vue 3.4 with Element Plus, Vite 5, and Pinia. Supporting infrastructure includes Docker Compose, MinIO for storage, Nginx, and OpenTelemetry. Third-party integrations cover WeChat login, WeChat Pay V3, the Kuaidi100 courier API for shipping labels, and Alibaba Cloud OSS.

On the shopper side, the app handles WeChat one-tap login, phone number binding, browsing categories with SKU variants, favourites, history, a cart with live stock checks, ordering with automatic timeout cancellation through asynq, WeChat JSAPI and H5 payment, real-time courier tracking, and template messages back to the user. The admin side covers SPU and SKU editing, image upload, stock transfers with low-stock alerts, batch shipping, label printing, manual refunds, user tagging, a GMV dashboard with pre-aggregated metrics, and role-based access control.

Architecture highlights mentioned include Redis Lua scripts for atomic stock decrement to prevent overselling, string IDs everywhere to avoid JavaScript BigInt precision loss, idempotency keys for both callbacks and clients, single-entry state machines for orders and refunds, JWT blacklists, and SQL parameterisation. The project is AGPL-3.0 licensed, which means modifications must stay open source and the code cannot be wrapped into a closed commercial product.

Where it fits