# base-admin: a Spring Boot admin starter with permissions, menus and a code generator

> Huanzi's Base Admin is a server-rendered Java admin panel built on Spring Boot, Thymeleaf, Spring Security and Spring Data JPA, plus a MyBatis-Plus port and a generator that writes the CRUD layer for your own tables.

**huanzi-qch/base-admin** — Base Admin is a simple, general-purpose admin backend system with permission management, menu management, user management, system settings, real-time logs, real-time monitoring, API encryption, plus letting logged-in users change their password and configure personalized menus.

- Repository: https://github.com/huanzi-qch/base-admin
- Stars: 2,445 · Forks: 1,096
- Language: Java
- License: MIT
- Published: 2026-10-06 · Updated: 2026-10-06 · Language: en
- Canonical page: https://hysenlabs.com/projects/huanzi-qch-base-admin

## What this repository is

`huanzi-qch/base-admin` is a general-purpose back-office management system, and it is closer to a starting skeleton than to a product. GitHub records Java as the primary language, the licence is MIT, and the repository has roughly 2,447 stars and 1,096 forks with 11 open issues. The default branch is `master` and the last push was 2026-06-30. The tree itself is thin, `.gitattributes`, `LICENSE`, `README.md`, `docs/`, `pom.xml` and `src/`, which tells you immediately that the interesting content is under `src/` rather than in build scripts or infrastructure.

The feature list in the README is written as a single sentence and covers permissions, menus, users, system settings, a real-time log view, a real-time monitor view, and API encryption, along with letting a logged-in user change their own password and configure their own menu. That last point is worth pausing on, because per-user menus are what separate a starter that demos well from one that fits an organisation with different roles seeing different navigation.

There is a demo site hosted on GitHub Pages, and the README asks you not to advertise the project on domestic media platforms. Mirrors exist on both GitHub and Gitee, which tells you the intended audience and suggests where the community sits.

## The stack, and why it is server rendered

The README states the stack in two lines. The frontend is layui, a jQuery-era UI kit served as static assets. The Java backend is Spring Boot with Thymeleaf for templating, WebSocket for the live views, Spring Security for authentication and authorisation, Spring Data JPA for persistence, and MySQL underneath.

Thymeleaf is the decision that shapes everything else. There is no build step for a frontend, no Node toolchain and no JSON API contract to negotiate, because the server renders HTML for each route. That makes the whole thing startable with a `main` method and pleasant to read, since a request maps to a template rather than to a controller method plus a separate client bundle. The price is that you inherit a server-rendered application, and the README answers that question directly in its FAQ: moving to a separated frontend is described as hard, with two OAuth 2.0 reference links offered as a starting point instead of a migration path.

The author also publishes a separate template for the separated approach, `fast-scaffold`, which the README describes as an admin backend plus a portal frontend. Treat that as the answer to the question this repository deliberately does not solve.

WebSocket is what makes the log and monitor pages feel live rather than polled, which for an operations panel is the difference between watching a deployment and staring at a stale table.

## Code generation and the single-table wrapper pattern

The most reusable idea in the project is not a screen. It is that every table gets a small class inheriting a shared base, and a generator writes that class for you.

The README describes a tool class called `AutoGenerator.java` that emits a complete set of backend create, read, update and delete endpoints for one table. The workflow is specific: create your database table first, configure the data source and the project path inside the class, list the tables you want in a `tables` array in its `main` method, then run it. Because every generated service inherits common code, the encoding style stays consistent across tables and you stop writing pagination by hand.

There is a second-generation version. A dated update in the README records that `AutoGenerator.java` was reworked and a V2.0 generator called `AutoGeneratorPlus.java` was added, which supports generating from template files instead of string concatenation. Template-driven generation matters more than it sounds: once the templates are files, you can restyle every generated class by editing a template and re-running.

The same inheritance pattern is what makes the ORM question cheap. Question seven in the FAQ asks what to do if you would rather not use JPA, and the answer is that JPA and MyBatis-Plus are both encapsulated in the project with a deliberately unified coding style, so switching means reading one blog post about the MyBatis-Plus wrapper and changing which base class your entities extend. The generator works either way, because it is generating against the wrapper contract rather than against a particular ORM.

## Permissions, and the configuration conflict that trips people up

Spring Security handles authentication, and a permission table maps URL patterns to roles. The README documents how that table behaves through a question that many readers have asked, and the answer is the single most useful warning in the whole document.

You can configure endpoints that skip permission checks. If you add a test endpoint to that list and it still redirects you to the login page, the cause is a conflicting entry in the permission configuration, because the permission configuration takes priority over the skip list. The concrete example given is a broad pattern like `/sys/**` shadowing a specific endpoint underneath it. The fix is to remove or narrow the overlapping permission entries rather than to keep adding exceptions.

The author added an `OpenApi` module as a worked example, documented in a January 2021 update, with a test endpoint you can visit once the project is running:

```text
http://localhost:8888/openApi/test
```

That is a sensible thing to copy. Rather than reasoning about pattern precedence in the abstract, you can read a module the author built specifically to demonstrate an unauthenticated route.

The default branch for trying this is noted as `dev`, where captcha validation is switched off, and the shared test credentials are published openly:

```text
sa/123456
```

Treat those as a development convenience, not as a starting configuration for anything reachable from a network you do not control.

## Running it: database, Lombok and the main method

Three setup details account for most of the questions in the FAQ, and all three are documented with the same cause-and-solution format.

The database script lives under `resources/static/sql` as `base_admin.sql`. Import it, then point the MySQL configuration at your own instance. The README is blunt that this is stated in the blog post rather than in the project documentation, which is fair criticism of the README and worth knowing before you go looking.

Lombok explains the second class of problem. Because Lombok generates setters and getters into the bytecode, your Java source has no such methods, and an IDE that has not indexed the annotation processor will report errors on every accessor. The fix is installing the Lombok plugin in the IDE and restarting it. Nothing is wrong with the code.

Startup itself is a `main` method. Once your IDE recognises the project as a Spring Boot project, you run `BaseAdminApplication.java` directly, and the default port in the example URL is 8888.

For a packaged jar, the README describes a problem most people cause themselves: the jar was built wrong. The author adjusted the `pom.xml` packaging configuration to pin the output location, so running the Maven `package` command writes a `package` folder next to `pom.xml` and the jar lands inside it. The FAQ spells out the three paths people confuse, distinguishing a `package` directory one level above `pom.xml` from one on the C drive root from the sibling directory next to `pom.xml` itself. Pinning the output path is a small change that removes an entire class of confusion.

## Keeping it running after the first commit

A few things about the project's longer-term shape are worth knowing before you build on it.

The README documents a rebranding to `DartNode` at the bottom, with a hosted banner crediting free VPS resources for open source. That is a sponsorship arrangement rather than a change of maintainer, but it is the kind of detail that tells you where a project gets its infrastructure. There is also a commercial ad slot in the README and a donation section listing Alipay and WeChat, both normal for a project of this size in its community.

The documentation is spread across the README, the GitHub Pages site and a long blog post on cnblogs that the README links under a title announcing an open source general-purpose admin system. The blog is where the architectural detail lives, including the post on Spring Data JPA single-table generation and the MyBatis-Plus integration write-up. That split is the main documentation weakness: nothing in the repository itself explains the base classes a generated service inherits, so you will be reading someone else's prose to understand code sitting on your disk.

Questions go to a QQ group rather than to the issue tracker, and the tracker is used for real bugs. With 11 open issues on a repository of this size, that split appears to be working.

On freshness, the last push was 2026-06-30, a little under three months ago. That is recent enough to say the code still gets touched, but the README's own update notes are dated 2021, so treat the feature list as a 2021-era feature list and verify against the source before planning around anything specific.

## Conclusion

Base Admin is best read as a worked example rather than a framework. The parts worth borrowing are the single-table inheritance wrappers, the code generator that keeps them in sync, and the honest FAQ that documents where the permission configuration will trip you up. The parts to expect friction from are the ones tied to its era: server-rendered Thymeleaf pages on layui rather than a separated frontend, and a Java stack you will need to refresh before deploying it anywhere serious. Plan on mounting the SQL file from resources into your own database, changing the shared test credentials, and reading the OpenApi module before you add endpoints you intend to leave unauthenticated. The MIT licence and the author's willingness to answer questions in a group chat make it a low-risk place to start.

## FAQ

### What is Base Admin and what does it include?

Base Admin is a Spring Boot back-office template from the huanzi-qch project. The README lists permission management, menu management, user management, system settings, a real-time log view, a real-time monitor view and API encryption, plus password changes and per-user menu configuration for the logged-in account.

### Which framework and database does Base Admin use?

The frontend is layui served as static assets, with no separate frontend build. The backend is Spring Boot with Thymeleaf templating, WebSocket for the live log and monitor views, Spring Security for auth, Spring Data JPA for persistence, and MySQL as the database. There is also an encapsulated MyBatis-Plus layer with the same coding style, so entities can switch between the two.

### How do I generate CRUD code for my own database tables?

Create the tables first, then open `AutoGenerator.java`, configure the data source and project path, list your table names in the `tables` array inside its `main` method, and run it. It emits a full set of create, read, update and delete endpoints plus pagination, with each generated service inheriting a shared base class. A V2.0 generator called `AutoGeneratorPlus.java` supports template-file based generation instead.

### Why does my test endpoint still redirect to the login page?

A pattern in the permission configuration is shadowing it, and the permission configuration wins over the list of endpoints that skip permission checks. A broad entry such as `/sys/**` will cover a more specific route beneath it. Remove or narrow the conflicting permission entries, and look at the `OpenApi` module the author added as a worked example of an unauthenticated route.

### Where is the database script and how do I start the application?

The script is `base_admin.sql` under `resources/static/sql`. Import it into MySQL and point the datasource configuration at your instance. If your IDE reports missing setters and getters, install the Lombok plugin and restart it, since Lombok adds those methods at bytecode generation time. Once the project is recognised as a Spring Boot project, run the `main` method in `BaseAdminApplication.java`.

### Is it hard to convert Base Admin into a separated frontend project?

The README describes it as difficult and does not offer a migration path, pointing instead at an OAuth 2.0 demo with separate authorisation and resource servers. The author publishes a separate template for that shape, `fast-scaffold`, with an admin backend and a portal frontend, which is a better starting point than converting this one.

## Sources

- [huanzi-qch/base-admin on GitHub](https://github.com/huanzi-qch/base-admin)
- [Issues](https://github.com/huanzi-qch/base-admin/issues)
- [License: MIT](https://github.com/huanzi-qch/base-admin/blob/master/LICENSE)
- [README](https://github.com/huanzi-qch/base-admin/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/huanzi-qch-base-admin
