今天分享一个已非常成熟的java项目,用来做项目的脚手架也非常不错。包含后端、前端项目。使用的也是国内非常流行的技术、框架。使用该项目做完脚手架可以大大减少从零到一构建项目所需花的时间和痛苦。
项目使用的核心技术
依赖 | 版本 |
---|---|
Spring Boot | 3.4 |
Spring Cloud | 2024 |
Spring Cloud Alibaba | 2023 |
Spring Authorization Server | 1.4 |
Mybatis Plus | 3.5 |
Vue | 3.4 |
Element Plus | 2.7 |
项目源码
后台
https://gitee.com/log4j/pig
模块说明
pig
├── pig-boot -- 单体模式启动器[9999]
├── pig-auth -- 授权服务提供[3000]
└── pig-common -- 系统公共模块
├── pig-common-bom -- 全局依赖管理控制
├── pig-common-core -- 公共工具类核心包
├── pig-common-datasource -- 动态数据源包
├── pig-common-log -- 日志服务
├── pig-common-oss -- 文件上传工具类
├── pig-common-mybatis -- mybatis 扩展封装
├── pig-common-seata -- 分布式事务
├── pig-common-security -- 安全工具类
├── pig-common-swagger -- 接口文档
├── pig-common-feign -- feign 扩展封装
└── pig-common-xss -- xss 安全封装
├── pig-register -- Nacos Server[8848]
├── pig-gateway -- Spring Cloud Gateway网关[9999]
└── pig-upms -- 通用用户权限管理模块
└── pig-upms-api -- 通用用户权限管理系统公共api模块
└── pig-upms-biz -- 通用用户权限管理系统业务处理模块[4000]
└── pig-visual
└── pig-monitor -- 服务监控 [5001]
├── pig-codegen -- 图形化代码生成 [5002]
└── pig-quartz -- 定时任务管理台 [5007]
前端
https://gitee.com/log4j/pig-ui
开发指导文档
https://wiki.pig4cloud.com/deployment/quick-start
单体架构部署
运行服务端
下载服务端代码
git clone https://gitee.com/log4j/pig.git -b jdk17
执行 SQL 脚本
pig
├── db
│ ├── pig.sql
加载 pig-boot 模块
切换 Maven profile 至 boot
运行 upms 模块
修改 pig-boot/application-dev.yml,redis、mysql
链接信息
PigBootApplication.java main
方法启动服务即可
运行前端
git clone https://gitee.com/log4j/pig-ui.git -b master
# node 版本需要 18
node -v
# 安装依赖
npm install --registry=https://registry.npmmirror.com
# 运行
npm run dev
访问使用
浏览器访问:http://localhost:8888
默认用户名:admin
默认密码:123456