mall-swarm README

The project's README from github.com/macrozheng/mall-swarm. As one markdown file: README.md.

mall-swarm

公众号 交流 学习教程 后台项目 前端项目 前台商城项目 码云

友情提示

  1. 快速体验项目:在线访问地址 。
  2. 全套学习教程:《mall-swarm微服务学习教程》 。
  3. 视频教程:《mall-swarm视频教程》 。
  4. Spring Cloud全套教程:《SpringCloud学习教程》 。
  5. 分支说明:master分支基于Spring Cloud 2025+Spring Boot 3.5,dev-v2分支基于Spring Cloud 2021+Spring Boot 2.7。

项目简介

mall-swarm是一套微服务商城系统,采用了 Spring Cloud 2025 & Alibaba、Spring Boot 3.5、Sa-Token、MyBatis、Elasticsearch、Docker、Kubernetes等核心技术,同时提供了基于Vue的管理后台方便快速搭建系统。mall-swarm在电商业务的基础集成了注册中心、配置中心、监控中心、网关等系统功能。文档齐全,附带全套Spring Cloud教程。

项目演示

后台管理系统

前端项目mall-admin-web地址:https://github.com/macrozheng/mall-admin-web

项目演示地址: https://www.macrozheng.com/admin/index.html

后台管理系统功能演示

前台商城系统

前端项目mall-app-web地址:https://github.com/macrozheng/mall-app-web

项目演示地址(将浏览器切换为手机模式效果更佳):https://www.macrozheng.com/app/

前台商城系统功能演示

项目架构

系统架构

系统架构图

业务架构

业务架构图

组织结构

mall
├── mall-common -- 工具类及通用代码模块
├── mall-mbg -- MyBatisGenerator生成的数据库操作代码模块
├── mall-auth -- 基于Spring Security Oauth2的统一的认证中心
├── mall-gateway -- 基于Spring Cloud Gateway的微服务API网关服务
├── mall-monitor -- 基于Spring Boot Admin的微服务监控中心
├── mall-admin -- 后台管理系统服务
├── mall-search -- 基于Elasticsearch的商品搜索系统服务
├── mall-portal -- 移动端商城系统服务
├── mall-demo -- 微服务远程调用测试服务
└── config -- 配置中心存储的配置

技术选型

后端技术

技术 说明 官网
Spring Cloud 微服务框架 https://spring.io/projects/spring-cloud
Spring Cloud Alibaba 微服务框架 https://github.com/alibaba/spring-cloud-alibaba
Spring Boot 容器+MVC框架 https://spring.io/projects/spring-boot
Sa-Token 认证和授权框架 https://github.com/dromara/Sa-Token
MyBatis ORM框架 http://www.mybatis.org/mybatis-3/zh/index.html
MyBatisGenerator 数据层代码生成 http://www.mybatis.org/generator/index.html
PageHelper MyBatis物理分页插件 http://git.oschina.net/free/Mybatis_PageHelper
Knife4j 文档生产工具 https://github.com/xiaoymin/swagger-bootstrap-ui
Elasticsearch 搜索引擎 https://github.com/elastic/elasticsearch
RabbitMq 消息队列 https://www.rabbitmq.com/
Redis 分布式缓存 https://redis.io/
MongoDb NoSql数据库 https://www.mongodb.com/
Docker 应用容器引擎 https://www.docker.com/
Druid 数据库连接池 https://github.com/alibaba/druid
OSS 对象存储 https://github.com/aliyun/aliyun-oss-java-sdk
MinIO 对象存储 https://github.com/minio/minio
LogStash 日志收集 https://github.com/logstash/logstash-logback-encoder
Lombok 简化对象封装工具 https://github.com/rzwitserloot/lombok
Seata 全局事务管理框架 https://github.com/seata/seata
Portainer 可视化Docker容器管理 https://github.com/portainer/portainer
Jenkins 自动化部署工具 https://github.com/jenkinsci/jenkins
Kubernetes 应用容器管理平台 https://kubernetes.io/

前端技术

技术 说明 官网
Vue 前端框架 https://vuejs.org/
Vue-router 路由框架 https://router.vuejs.org/
Vuex 全局状态管理框架 https://vuex.vuejs.org/
Element 前端UI框架 https://element.eleme.io/
Axios 前端HTTP框架 https://github.com/axios/axios
v-charts 基于Echarts的图表框架 https://v-charts.js.org/

移动端技术

技术 说明 官网
Vue 核心前端框架 https://vuejs.org
Vuex 全局状态管理框架 https://vuex.vuejs.org
uni-app 移动端前端框架 https://uniapp.dcloud.io
mix-mall 电商项目模板 https://ext.dcloud.net.cn/plugin?id=200
luch-request HTTP请求框架 https://github.com/lei-mu/luch-request

环境搭建

开发环境

工具 版本号 下载
JDK 17 https://www.oracle.com/cn/java/technologies/downloads/#java17
Mysql 5.7 https://www.mysql.com/
Redis 7.0 https://redis.io/download
Elasticsearch 7.17.3 https://www.elastic.co/cn/downloads/elasticsearch
Kibana 7.17.3 https://www.elastic.co/cn/downloads/kibana
Logstash 7.17.3 https://www.elastic.co/cn/downloads/logstash
MongoDb 5.0 https://www.mongodb.com/download-center
RabbitMq 3.10.5 http://www.rabbitmq.com/download.html
nginx 1.22 http://nginx.org/en/download.html

搭建步骤

运行效果展示

公众号

加微信群交流,关注公众号「macrozheng」,回复「加群」即可。

公众号图片

许可证

Apache License 2.0

Copyright (c) 2018-2026 macrozheng

mall-swarm (macrozheng/mall-swarm)

Searching Database…

这是什么?mall-swarm 是一个基于微服务架构的电商平台,使用 Spring Cloud 和 Spring Cloud Alibaba 构建,包含商城前台、移动端后端和管理后台,并配有注册中心、配置中心、监控、网关等完整的基础设施。
这是单个应用还是一组微服务?它采用完整的微服务架构,拆分为多个独立服务(注册中心、配置中心、网关、业务服务、监控等),而不是一个单体应用,设计上可通过 Docker 或 Kubernetes 进行编排。
我该如何让后端和管理后台前端运行起来?按照项目专门的后端搭建指南配置后端开发环境,再按照独立的 mall-admin-web 前端项目自带的前端搭建指南部署前端。
运行前需要先准备哪些基础设施?需要先准备好 JDK 17、MySQL 5.7、Redis 7.0、Elasticsearch/Kibana/Logstash 7.17.3、MongoDB 5.0、RabbitMQ 3.10.5 和 nginx 1.22。
不同的 Spring Cloud 版本应该使用哪个分支?master 分支基于 Spring Cloud 2025 + Spring Boot 3.5 运行,dev-v2 分支则适用于较早的 Spring Cloud 2021 + Spring Boot 2.7 技术栈,请选择与你的环境相匹配的分支。
这个项目适合哪些人?它面向 Java/Spring 开发者,适合想要学习或搭建生产级微服务电商系统的人,因为项目附带完整的文档和教程。
不装任何东西能先试用吗?可以,README 中提供了商城前台和后台管理的在线演示链接,其中包括购物前台的移动端视图。
管理后台和商城前台使用了什么前端技术栈?管理后台(mall-admin-web)使用 Vue、Vuex、Vue-router、Element UI 和 v-charts;移动端商城则基于 Vue,使用 uni-app 和 Vuex 构建。
是否开箱即支持分布式事务和对象存储?支持。项目集成了 Seata 用于全局事务管理,支持 OSS 和 MinIO 两种对象存储,并使用 Druid 作为数据库连接池。
监控和日志是如何处理的?技术栈自带监控中心用于服务健康检查,并使用 Logstash、Elasticsearch、Kibana 进行集中式日志收集,另外还有 Portainer 用于可视化管理 Docker 容器。
Creator
macrozheng
Size
53.3 MB
Stars
13.2K
Age
6y
Commits · 90 Days