mirror of
https://github.com/SOR2171/Springboot4-Vue3_Demo.git
synced 2026-10-23 11:31:10 +08:00
1.8 KiB
1.8 KiB
Springboot4-Vue3
赞美学生包
English / 简体中文
技术栈
后端
- Kotlin + Gradle.kts
- Spring Security
- Spring Mail
- Mybatis Plus
- JWT
- MySQL
- Redis
- RabbitMQ
前端
- Vue3 + Vite + TypeScript
- vue-router
- axios
- element-plus
项目搭建
基础要求
- JDK 25+
- Kotlin 2.3.20+
- Node.js 16+
- MySQL 8+
- Redis 6+
- RabbitMQ 3.8+
Git 克隆项目
git clone https://github.com/SOR2171/Springboot4-Vue3_Demo.git
cd Springboot4-Vue3_Demo
后端配置
- 进入后端目录
cd backend
- 配置应用属性
创建 src/main/resources/application.yml
或编辑 src/main/resources/application-example.yml
以设置你自己的配置。
- 导入数据库
导入 src/main/resources/springboot_vue3.sql
默认数据库用户:
用户名:
test密码:123456(SQL中保存的密码需要通过测试类获取)
- Gradle 构建
gradle build
jar 文件目录:build/libs/backend-(ver).jar
- 启动后端服务器
java -jar build/libs/backend-(ver).jar
前端配置
- 进入前端目录
cd frontend
- 准备一些图片
你需要一张 frontend/src/assets/welcome-image.png 用作登陆界面的背景
- 构建前端
npm install
npm run build
构建结果会生成在 dist 目录中。
Nginx 部署(可选)
如果你想使用 Nginx 来部署前端,可以按以下步骤操作:
-
若未安装 Nginx,请先安装。
-
将
dist目录中的内容复制到 Nginx 的html目录。 -
配置 Nginx,使其能够提供前端页面,并将 API 请求代理到后端服务器。
-
重启 Nginx。
sudo systemctl restart nginx