# youlai-boot
**Repository Path**: sdmq/youlai-boot
## Basic Information
- **Project Name**: youlai-boot
- **Description**: 🌈 基于 Java 17 + Spring Boot 4 + Spring Security 7 + Vue 3 + Element-Plus 构建的前后端分离单体权限管理系统。
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: https://vue.youlai.tech
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 822
- **Created**: 2026-09-18
- **Last Updated**: 2026-09-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
#

youlai-boot
**Spring Boot 企业级权限管理系统后端**
[](https://spring.io/projects/spring-boot)
[](https://openjdk.org/)
[](LICENSE)
[](https://gitee.com/youlaiorg/youlai-boot/stargazers)
[](https://github.com/youlaitech/youlai-boot)
[](https://gitcode.com/youlai/youlai-boot/stargazers)

[](https://vue.youlai.tech)
[](https://app.youlai.tech)
[](https://www.youlai.tech/docs/server/spring-boot/)
[](./README.en.md)
## 项目简介
**youlai-boot** 是一套基于 Spring Boot 的企业级权限管理系统后端,配套前端 [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) 和移动端 [youlai-app](https://gitee.com/youlaiorg/youlai-app),并提供 **7 种语言实现**(Java / Node.js / Go / Python / PHP / C# / Rust),共享同一套 API 规范与数据库结构。适用于企业中后台管理系统的学习参考与二次开发。
## 核心特性
- 🔐 **安全体系** — Spring Security + JWT/Redis Token 双会话模式、令牌续期、多端互斥
- 🛡️ **细粒度权限** — RBAC 五级:数据 → 菜单 → 按钮 → 接口 → 字段
- ⚡ **代码生成器** — 一键生成前后端 CRUD 代码
- 📦 **模块齐全** — 用户、角色、菜单、部门、字典、文件(OSS/RustFS/本地)、定时任务、消息中心、操作日志
- 🔀 **工作流** — Flowable 审批流:BPMN 在线设计、条件网关、角色审批、驳回回退
- 🌐 **多租户 SaaS** — 数据隔离 + 租户配置,独立 [youlai-boot-tenant](https://gitee.com/youlaiorg/youlai-boot-tenant) 版本
- 🔌 **实时通信** — SSE 推送:在线用户数、字典同步、通知广播
## 系统预览
**PC 端**
**移动端**
## 快速开始
**环境要求**:JDK 17+ · MySQL 8.0+ · Redis 6.0+
1. 克隆项目:
```bash
git clone https://gitee.com/youlaiorg/youlai-boot.git
```
2. 导入数据库:
```bash
# 基础库(必装)
sql/youlai-admin.sql
# 可选扩展:不装不影响基础功能,需在基础库之后执行
sql/extensions/dynamic-form.sql # 动态表单
sql/extensions/workflow.sql # 工作流(Flowable 演示流程与演示账号,非引擎表)
```
3. 修改配置(可选,默认已配置线上只读数据源):
```bash
src/main/resources/application-dev.yml
```
4. 启动服务:
**方式一:IDEA 启动(推荐)**
用 IDEA 打开项目,等待 Maven 依赖下载完成,运行启动类 `YouLaiBootApplication` 即可。
**方式二:命令行启动**
```bash
mvn spring-boot:run
```
启动后访问 ,能打开接口文档即说明后端已正常运行。
5. 启动前端(可选):
如需可视化操作界面,启动配套前端 [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin),访问 ,使用 `admin` / `123456` 登录。
> 更多内容详见官方文档:[快速开始](https://www.youlai.tech/docs/server/spring-boot/quick-start.html) · [部署指南](https://www.youlai.tech/docs/server/spring-boot/deploy.html)
## 目录结构
```
youlai-boot/
├── docs/ # 项目文档与图片资源
├── sql/ # 数据库初始化脚本
├── src/ # 源码目录
│ ├── auth/ # 认证模块
│ │ ├── password/ # 账号密码登录(含图形验证码)
│ │ ├── sms/ # 短信验证码登录
│ │ ├── qrcode/ # 扫码登录
│ │ ├── wxma/ # 微信小程序登录
│ │ └── session/ # 登录态管理(登出 / 刷新令牌)
│ ├── codegen/ # 代码生成器
│ ├── common/ # 公共模块(常量/枚举/异常/统一响应/工具类)
│ ├── config/ # 配置类(Security/Redis/MyBatis/接口文档/跨域/定时任务等)
│ ├── framework/ # 基础设施层
│ │ ├── mybatis/ # MyBatis-Plus 配置
│ │ ├── security/ # Spring Security
│ │ │ ├── config/ # 安全配置与配置属性
│ │ │ ├── filter/ # Token 认证过滤器
│ │ │ ├── handler/ # 认证 / 授权失败处理器
│ │ │ ├── model/ # 安全模型(SecurityUser / 令牌 / 数据范围)
│ │ │ ├── port/ # 认证与权限端口(由 system 提供实现)
│ │ │ ├── service/ # 用户详情与权限服务
│ │ │ ├── token/ # Token 管理(JWT / Redis 双模式)
│ │ │ └── util/ # 安全工具类
│ │ └── web/ # Web 层(全局异常/跨域/限流)
│ ├── module/ # 业务扩展模块
│ │ ├── form/ # 动态表单
│ │ └── workflow/ # 工作流
│ ├── support/ # 能力服务
│ │ ├── file/ # 文件存储(RustFS/阿里云OSS/本地)
│ │ ├── mail/ # 邮件服务
│ │ ├── sms/ # 短信服务
│ │ └── sse/ # SSE 消息推送
│ └── system/ # 系统业务(用户/角色/菜单/部门/字典等)
├── docker-compose.yml # 中间件一键编排(MySQL/Redis/RustFS/Xxl-Job)
└── pom.xml # Maven 依赖管理
```
## 生态矩阵
**前端**
| 项目 | 技术栈 | 说明 | 更新状态 |
| :------------------------------------------------------------------- | :------------------- | :---------- | :--- |
| [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) | Vue 3 + Element Plus | PC 管理前端(主推) | ✅️ |
| [youlai-app](https://gitee.com/youlaiorg/youlai-app) | Vue 3 + UniApp | 移动端 App | ✅️ |
**后端**
| 项目 | 技术栈 | 说明 | 更新状态 |
| :----------------------------------------------------------- | :------------------------- | :------- | :--- |
| [youlai-boot](https://gitee.com/youlaiorg/youlai-boot) | Spring Boot + MyBatis-Plus | Java(主推) | ✅️ |
| [youlai-nest](https://gitee.com/youlaiorg/youlai-nest) | NestJS + TypeORM | Node.js | ✅️ |
| [youlai-gin](https://gitee.com/youlaiorg/youlai-gin) | Go + Gorm | Go | ✅️ |
| [youlai-django](https://gitee.com/youlaiorg/youlai-django) | Django + DRF | Python | ✅️ |
| [youlai-fastapi](https://gitee.com/youlaiorg/youlai-fastapi) | FastAPI + SQLAlchemy | Python | ✅️ |
| [youlai-laravel](https://gitee.com/youlaiorg/youlai-laravel) | Laravel + Eloquent | PHP | ✅️ |
| [youlai-think](https://gitee.com/youlaiorg/youlai-think) | ThinkPHP + ThinkORM | PHP | ✅️ |
| [youlai-aspnet](https://gitee.com/youlaiorg/youlai-aspnet) | ASP.NET Core + EF Core | C# | ✅️ |
| [youlai-axum](https://gitee.com/youlaiorg/youlai-axum) | Axum + SeaORM | Rust | ✅️ |
> 九种后端共享同一套 **RESTful API 规范** 和 **数据库结构**,前端可无缝切换。
**衍生版本**
| 项目 | 基于 | 类型 | 说明 | 更新状态 |
| :---------------------------------------------------------------------------------------- | :---------- | :--- | :----------------- | :--- |
| [youlai-boot-tenant](https://gitee.com/youlaiorg/youlai-boot-tenant) | youlai-boot | 独立仓库 | 多租户 SaaS,租户隔离与租户配置 | ✅️ |
| [youlai-boot-flex](https://gitee.com/youlaiorg/youlai-boot-flex) | youlai-boot | 独立仓库 | 改用 MyBatis-Flex | ✅️ |
| [youlai-boot (db-pg)](https://gitee.com/youlaiorg/youlai-boot/tree/db-pg) | youlai-boot | 分支 | PostgreSQL 数据库分支 | ✅️ |
| [youlai-boot (multi-module)](https://gitee.com/youlaiorg/youlai-boot/tree/multi-module) | youlai-boot | 分支 | 多模块工程拆分 | ✅️ |
| [youlai-boot (spring-boot-3)](https://gitee.com/youlaiorg/youlai-boot/tree/spring-boot-3) | youlai-boot | 分支 | Spring Boot 3 兼容分支 | ✅️ |
| [youlai-nest (multi-tenant)](https://gitee.com/youlaiorg/youlai-nest/tree/multi-tenant) | youlai-nest | 分支 | 多租户 SaaS,租户隔离与租户配置 | ✅️ |
## 可选扩展
**工作流(默认关闭)**
两步开启:
1. 导入演示数据(演示流程与演示账号):
```bash
sql/extensions/workflow.sql
```
ACT_* 引擎表无需导入,启动时由 Flowable 自动创建(已存在则不重复处理)。
2. 在 `application-{profile}.yml` 中开启:
```yaml
workflow:
enabled: true
```
Flowable 引擎开关(process / idm / eventregistry)在同一 `application-{profile}.yml` 中以占位符跟随 `workflow.enabled`,无需单独维护。
**多租户**
需要租户隔离与租户配置,使用独立仓库 [youlai-boot-tenant](https://gitee.com/youlaiorg/youlai-boot-tenant)。
## 技术合作
本项目采用 [Apache License 2.0](LICENSE) 开源,可免费商用。欢迎在 [Issue](https://gitee.com/youlaiorg/youlai-boot/issues) 提交问题或反馈,也欢迎提交 [Pull Request](https://gitee.com/youlaiorg/youlai-boot/pulls) 共建。
如需技术支持、商务合作、二次开发、项目定制或私有化部署,可联系作者微信(见下方二维码)。

公众号「有来技术」
|
|

小程序「有来技术」
|
|

添加作者微信
|
技术交流 · 问题反馈 · 商务合作