Backend Development 14 min read

Designing a Modular Spring Boot Backend Management Project (XiaoLe)

This article explains how to design a modular Spring Boot backend management system called XiaoLe, covering essential design principles such as single responsibility, high cohesion, low coupling, reusability, clear interfaces, layered architecture, and testability, and provides detailed Maven module structures and POM configurations for each component.

Java Architect Essentials
Java Architect Essentials
Java Architect Essentials
Designing a Modular Spring Boot Backend Management Project (XiaoLe)

In this tutorial the author, a self‑described "architect who can write code and poetry", shares the design of a backend management project named XiaoLe, built with Spring Boot and organized as a multi‑module Maven project.

Key design principles for a high‑quality Spring Boot module :

Single Responsibility Principle – each module should focus on one well‑defined function.

High Cohesion – related classes stay together to improve understandability.

Low Coupling – dependencies between modules are minimized to allow independent changes.

Reusability – common functionality is extracted into reusable components (e.g., a common module).

Clear Boundaries and Interfaces – module interfaces are explicit, making responsibilities obvious.

Moderate Modularity – avoid over‑fragmentation while grouping related components.

Layered Architecture – separate controller, service, and data‑access layers.

Dependency Inversion – depend on abstractions rather than concrete implementations.

Testability – design modules to be easily unit‑tested and integration‑tested.

Adaptability for Future Extension – keep the design flexible for new features.

The overall project layout (simplified) looks like this:

├─.idea
├─le-admin
│  └─src/main/java/com/le/admin
│  └─src/main/resources/META-INF
├─le-business
│  └─src/main/java/com/le/business
├─le-common
│  └─src/main/java/com/le/common
├─le-core
│  └─src/main/java/com/le/core
├─le-gen-code
│  └─src/main/java/com/le/code
└─le-tripartite
   └─src/main/java/com/le/tripartite

Core module (le‑core) provides common configuration and base services, without business logic. Its pom.xml includes Spring Boot starter dependencies, MyBatis, and MySQL driver.

<project xmlns="http://maven.apache.org/POM/4.0.0" ...>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.xiaole</groupId>
    <artifactId>XiaoLe</artifactId>
    <version>1.0.0</version>
  </parent>
  <groupId>com.le</groupId>
  <artifactId>le-core</artifactId>
  <name>le-core</name>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    ...
  </dependencies>
</project>

Common module (le‑common) holds utility classes and shared configuration. Its POM adds Spring Boot starter, security, and Apache Commons Lang.

<project ...>
  ...
  <artifactId>le-common</artifactId>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
  </dependencies>
</project>

genCode module (le‑gen-code) is a code‑generation helper that depends on Velocity and the common module.

<dependency>
  <groupId>org.apache.velocity</groupId>
  <artifactId>velocity-engine-core</artifactId>
</dependency>

Business module (le‑business) contains the actual domain logic, services, and MyBatis/Redis data access.

Tripartite module (le‑tripartite) encapsulates third‑party integrations such as payment gateways or external APIs.

Admin module (le‑admin) provides the management UI and ties together the other modules.

The parent POM ( pom.xml ) aggregates all modules and uses the import scope to bring in Spring Boot dependency management, allowing version control from a single place and enabling modular project organization.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-dependencies</artifactId>
      <version>${spring-boot.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
    ...
  </dependencies>
</dependencyManagement>

For further reference the complete source code is hosted at https://gitee.com/paper_cup_cake/xiao-le .

JavaBackend DevelopmentMavenSpring Bootdesign principlesmodular architecture
Java Architect Essentials
Written by

Java Architect Essentials

Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.