Library / SDK
macrozheng/mall avatar
macrozheng/mall

mall: A Full-Stack E-Commerce Reference Built on Spring Boot and MyBatis

mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于Spring Boot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。.

84,770 stars29,832 forksJavaApache-2.0

At a glance

What is it?
mall is a monolithic e-commerce system with separate admin and storefront APIs, Docker-based deployment, and a companion set of front-end projects. It suits developers who want a complete, runnable reference rather than a production-ready platform.
Who is it for?
Adopt mall if you are a Java developer or team that needs a complete, well-documented e-commerce reference to learn from or to use as a starting point for a custom build. Do not adopt it if you need a production-grade, fully maintained platform with a stable release cadence, as the last release is from March 2024 and the project appears to be in maintenance mode.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What mall Actually Provides

The repository is a complete e-commerce backend, not a single service. It contains two API modules: mall-admin for back-office operations and mall-portal for the storefront. The admin side covers product, order, member, promotion, operation, content, statistics, finance, and permission management. The portal side includes home page, product recommendation, search, display, cart, order flow, member center, customer service, and help center. The README also lists mall-search, an Elasticsearch-based product search module, and mall-common, mall-mbg, and mall-security as shared utilities, generated database code, and Spring Security wrappers. This is a reference implementation for developers who want to see how a typical e-commerce backend is structured in Java. It is not a SaaS product or a headless commerce API; it is a codebase to study and modify.

How the Modules Fit Together

The directory layout shows a clear separation of concerns. mall-common holds utility classes and shared code. mall-mbg contains MyBatisGenerator output, meaning the database access layer is largely generated rather than hand-written. mall-security wraps Spring Security for authentication and authorization. mall-admin exposes the back-office REST API, mall-portal exposes the storefront API, and mall-search handles product search via Elasticsearch. The system uses JWT for login support, which is typical for stateless APIs. Data flows from the front-end clients (Vue-based admin web, Vue-based app web) to these API modules, which then talk to MySQL through MyBatis, Redis for caching, RabbitMQ for messaging, MongoDB for NoSQL data, and Elasticsearch for search. The architecture is monolithic in the sense that all modules live in one repository and likely deploy as a set of services, but the README does not specify whether they run as separate processes or as one deployable unit. The presence of mall-demo, described as test code from framework setup, suggests the project grew organically, which is common for such reference projects.

Getting It Running: Commands and Config

The README does not include a quick-start command sequence, which is a gap. It does state that the project uses Docker for containerized deployment, and it lists the required development tools: IDEA, RedisDesktop, Robomongo, SwitchHosts, X-shell, Navicat, PowerDesigner, Axure, MindMaster, ScreenToGif, ProcessOn, PicPick, Snipaste, and Postman. That list is heavy on design and diagram tools, which suggests the author expects you to read the full documentation at macrozheng.com for actual setup steps. The documentation site is the primary source for environment setup, database initialization, and service configuration. The README also mentions that the master branch uses Spring Boot 3.5 and JDK 17, while the dev-v2 branch uses Spring Boot 2.7 and JDK 8. This is a critical config detail: you must choose a branch based on your JDK version. Without the full docs, you would need to inspect the repository for docker-compose files or application.yml files, but the README does not confirm their contents. In short, expect to read the external docs to get the exact commands, database scripts, and service configuration.

The Search and Messaging Dependencies

The technology table lists Elasticsearch for search, RabbitMQ for messaging, Redis for caching, MongoDB for NoSQL storage, and LogStash and Kibana for log collection and visualization. These are heavy dependencies for a single e-commerce system. The mall-search module is dedicated to Elasticsearch, which means product search is not a simple SQL LIKE query; it requires a running Elasticsearch cluster. RabbitMQ likely handles asynchronous tasks like order confirmation or inventory updates, though the README does not specify the exact use. MongoDB is used somewhere, but the description does not clarify which data goes there. This complexity is a double-edged sword. On one hand, it gives you a realistic picture of a modern e-commerce stack. On the other hand, it raises the barrier to entry: you cannot just run a single Java jar and have a working system. You need to provision and configure at least five external services. If you are evaluating mall for a small project, this is overkill. If you are studying how to integrate these tools, it is a valuable example.

Front-End Projects and Mobile Support

The backend alone is not enough to run a storefront. The README points to two companion repositories: mall-admin-web for the admin interface and mall-app-web for the mobile storefront. The admin web uses Vue, Vue-router, Vuex, Element, Axios, v-charts, Js-cookie, and nprogress. The mobile app uses uni-app, which is a cross-platform framework, along with Vuex and a template called mix-mall. This means the full system is a multi-repository project. You need to clone and build three or four repositories to get a complete experience. The online demo at macrozheng.com/admin/index.html and the app demo at macrozheng.com/app/ let you try the system without setting it up, but the demo does not help you with deployment. The dependence on separate front-end projects adds maintenance overhead, but it also keeps the backend clean and API-focused. If you prefer a single-repo full-stack solution, this is not it.

Maintenance, Licensing, and the Release Gap

The project is licensed under Apache-2.0, which is permissive for commercial use, but you should review the license text for any attribution requirements. The last push and release, v1.0.3, date to March 2024. The previous release, v1.0.2, was in June 2022, and v1.0.1 in August 2020. That pattern shows infrequent releases. The README mentions a related microservices version called mall-swarm, which suggests the author maintains multiple variants. The master branch targets Spring Boot 3.5, which is a recent version, but the release cadence is slow. This is not a project with weekly commits or active community development. For a reference project, that is acceptable. For a production dependency, it is a risk. You would likely need to fork and maintain your own patches. The documentation site is extensive, but it may lag behind the code. Before adopting mall, check the issues tracker and the last commit dates on the branches you plan to use.

The Wrong Tool for Some Jobs

mall is not a fit if you need a lightweight e-commerce solution. The dependency list alone is a warning: Elasticsearch, RabbitMQ, MongoDB, Redis, and Docker are required. The README does not mention any alternative deployment mode without these services. If you are building a small store with a handful of products, this stack is excessive. The generated MyBatis code in mall-mbg suggests that the data model is tied to a specific database schema, and changing it requires regenerating code. The project also assumes you will use the provided front-end projects, which are Vue-based. If your team uses React or Angular, you would have to write new front-ends against the APIs. The system is also monolithic in the sense that it is not a microservices architecture; the README points to mall-swarm for that. So if your requirement is horizontal scalability per service, mall is the wrong starting point.

A Real Alternative: mall-swarm

The README itself names a direct alternative: mall-swarm, the Spring Cloud Alibaba based microservices version of the same project. The difference is architectural. mall is a modular monolith, with all modules in one repository and likely deployed as a set of services that share the same codebase. mall-swarm splits the system into independent microservices, each with its own database and deployment unit. That is a fundamentally different approach to scalability and team organization. If you need to scale individual components like search or order processing independently, mall-swarm is the intended choice. However, microservices bring their own complexity: service discovery, distributed transactions, and inter-service communication. The README does not provide details on mall-swarm's implementation, but the name and the mention of Spring Cloud Alibaba indicate a full microservices stack. For most teams, starting with the monolithic mall is simpler, and you can migrate to mall-swarm later if needed. The existence of both projects gives you a clear upgrade path, which is a plus.

Editorial conclusion

Adopt mall if you are a Java developer or team that needs a complete, well-documented e-commerce reference to learn from or to use as a starting point for a custom build. Do not adopt it if you need a production-grade, fully maintained platform with a stable release cadence, as the last release is from March 2024 and the project appears to be in maintenance mode. Before using it, verify the branch compatibility: the master branch targets Spring Boot 3.5 and JDK 17, while the dev-v2 branch uses Spring Boot 2.7 and JDK 8, so pick the branch that matches your runtime. Also confirm that all external services (Elasticsearch, RabbitMQ, MongoDB, Redis, MinIO or Aliyun OSS) are available in your environment, since the system depends on them for search, messaging, caching, and storage.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Community notes

Community notes