Getting started in 5 minutes
No containers required; a local JDK 21 and one MySQL instance are enough to boot, sign in and generate a module.
The goal is three things in five minutes: boot it, sign in to the console, generate a module. No container environment, no manual table creation.
1 · Prerequisites
| Dependency | Version | Notes |
|---|---|---|
| JDK | 21 | locked by the toolchain in build.gradle; a wrong version fails outright |
| MySQL | 8.0+ | the only supported database; Liquibase creates the schema |
| Gradle | 9.5.0 | use the in-repo gradlew, never a local Gradle |
Note: SMTP for email codes is optional. Without it the code is only written to the log and sign-in still completes.
2 · Get the code and configure it
Edit .env and fill in the variables below (real credentials stay on this machine and never enter the repository):
| Variable | Purpose | Example |
|---|---|---|
MINIMAO_DB_URL | Database connection URL | jdbc:mysql://127.0.0.1:3306/minimao?useUnicode=true&characterEncoding=utf8mb4 |
MINIMAO_DB_USERNAME | Database user | minimao |
MINIMAO_DB_PASSWORD | Database password | local only, never committed |
MINIMAO_BOOTSTRAP_ADMIN_PASSWORD_HASH | BCrypt hash of the initial admin password | written only during first initialization |
MAIL_HOST / MAIL_USERNAME / MAIL_PASSWORD | Credentials for sending email codes | without them, read the code from the log |
Warning: the repository contains no intranet addresses and no real credentials. application.yml and .env.example are registered in both directions; missing either one fails the build.
3 · Start it
On first start Liquibase runs every migration to create tables and writes seed data plus the initial administrator. You are up when you see Started MiniMaoApplication in Xs.
Warning: the initial admin password comes from MINIMAO_BOOTSTRAP_ADMIN_PASSWORD_HASH (a BCrypt hash). Do not use a weak hash and do not put the plaintext in a config file.
4 · Sign in to the console
After signing in as the initial administrator you can see users, roles, menus, dictionaries and operation logs, and you can sign in with accounts of different roles to watch the button-level differences.
5 · Generate a module
The skeleton generator emits directories, migration scripts and test skeletons, and registers the module, permission codes and menus. Generated code ships with tests and the build must pass on the first run — that is a hard criterion, not advice.
Next
- Local development: common commands, directory tour, troubleshooting
- Layering and dependency direction: know which layer your code belongs in
- The golden slice: the complete path for one new module