mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-09 13:56:50 +08:00
feat: update readme
This commit is contained in:
BIN
README/a.jpg
BIN
README/a.jpg
Binary file not shown.
Before Width: | Height: | Size: 132 KiB |
BIN
README/a.png
Normal file
BIN
README/a.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 171 KiB |
BIN
README/b.jpg
BIN
README/b.jpg
Binary file not shown.
Before Width: | Height: | Size: 149 KiB |
BIN
README/b.png
Normal file
BIN
README/b.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 139 KiB |
133
README/build.md
Normal file
133
README/build.md
Normal file
@@ -0,0 +1,133 @@
|
||||
# 构建指引
|
||||
|
||||
## 前言
|
||||
|
||||
Databasir 采用了前后端分离的模式进行开发和部署,项目仓库地址分别位于
|
||||
|
||||
- 后端应用: https://github.com/vran-dev/databasir
|
||||
- 前端应用: https://github.com/vran-dev/databasir-frontend
|
||||
|
||||
|
||||
|
||||
## 后端
|
||||
|
||||
**一、环境要求**
|
||||
|
||||
1. Java 11+
|
||||
2. Mysql
|
||||
3. Intellij IDEA
|
||||
|
||||
|
||||
|
||||
**二、主要框架**
|
||||
|
||||
1. Gradle:构建工具
|
||||
2. Spring-boot:核心框架
|
||||
1. Web
|
||||
2. Security
|
||||
3. Quartz:定时任务调度
|
||||
4. JOOQ:ORM 框架
|
||||
5. Lombok:代码生成
|
||||
6. Mapstruct:代码生成
|
||||
7. Flyway:数据库脚本管理
|
||||
|
||||
|
||||
|
||||
**三、项目结构**
|
||||
|
||||
项目结构采用了分层结构
|
||||
|
||||
- api:所有的 http 接口、定时任务都在该模块下
|
||||
- common:主要包含通用异常定义、加解密算法工具
|
||||
- core:包含了所有的业务核心逻辑,包括 service、request/response data、converter 等
|
||||
- dao:针对数据库的操作类都在该模块下,其中 generated-src 包含了 jooq 生成的代码,src 主要包含了 dao 的实现类
|
||||
- plugin:主要包含了 JDBC 工具类,包括但不限于将数据库的元数据解析为 Java 对象 、PDF 导出等
|
||||
|
||||
项目配置都放在 api/src/main/resources 目录下
|
||||
|
||||
前端静态文件放在 api/src/main/resources/static 目录下
|
||||
|
||||
项目数据库脚本放在 dao/src/main/resources/db/migration 目录下
|
||||
|
||||
|
||||
|
||||
**四、项目启动**
|
||||
|
||||
1、通过 Java Main 方法启动
|
||||
|
||||
修改或创建配置文件 `api/src/main/resources/application-local.properties`
|
||||
|
||||
```properties
|
||||
server.port=8080
|
||||
logging.level.org.jooq=INFO
|
||||
|
||||
# 必须:数据库配置
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=123456
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/databasir
|
||||
spring.jooq.sql-dialect=mysql
|
||||
|
||||
# 可选:flyway 配置
|
||||
spring.flyway.enabled=true
|
||||
spring.flyway.baseline-on-migrate=true
|
||||
spring.flyway.locations=classpath:db/migration
|
||||
```
|
||||
|
||||
启动 DatabasirApplication(com.databasir.DatabasirApplication) 类,启动时需要加参数 `-Dspring.profiles.active=local`
|
||||
|
||||
启动完成后,可以通过 http://localhost:8080 访问
|
||||
|
||||
|
||||
|
||||
2、通过 Gradle 启动
|
||||
|
||||
与 Java 启动模式一样,首先需要准备配置文件
|
||||
|
||||
修改或创建配置文件 `api/src/main/resources/application-local.properties`
|
||||
|
||||
```properties
|
||||
server.port=8080
|
||||
logging.level.org.jooq=INFO
|
||||
|
||||
# 必须:数据库配置
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=123456
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/databasir
|
||||
spring.jooq.sql-dialect=mysql
|
||||
|
||||
# 可选:flyway 配置
|
||||
spring.flyway.enabled=true
|
||||
spring.flyway.baseline-on-migrate=true
|
||||
spring.flyway.locations=classpath:db/migration
|
||||
```
|
||||
|
||||
执行 Gradle 命令
|
||||
|
||||
```shell
|
||||
./gradlew bootRun --args='--spring.profiles.active=local'
|
||||
```
|
||||
|
||||
启动完成后,可以通过 http://localhost:8080 访问
|
||||
|
||||
|
||||
|
||||
## 前端
|
||||
|
||||
一、依赖
|
||||
|
||||
1. vue
|
||||
2. vuex
|
||||
3. element-plus
|
||||
4. axios
|
||||
|
||||
|
||||
|
||||
二、运行
|
||||
|
||||
```shell
|
||||
npm run serve
|
||||
```
|
||||
|
||||
默认端口为 3000
|
BIN
README/c.png
Normal file
BIN
README/c.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 185 KiB |
59
README/deploy.md
Normal file
59
README/deploy.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# 部署指引
|
||||
|
||||
## 前言
|
||||
|
||||
Databasir 采用了前后端分离的模式进行开发和部署,项目仓库地址分别位于
|
||||
|
||||
- 后端应用: https://github.com/vran-dev/databasir
|
||||
- 前端应用: https://github.com/vran-dev/databasir-frontend
|
||||
|
||||
当前提供了 Jar 和 Docker 两种部署方式
|
||||
|
||||
### JAR 模式部署
|
||||
|
||||
**一、环境要求**
|
||||
|
||||
1. Java 11+
|
||||
2. Mysql
|
||||
|
||||
**二、部署流程**
|
||||
|
||||
1. 在 [Github RELEASE](https://github.com/vran-dev/databasir/releases) 页面下载最新版应用 Databasir.jar (你也可以选择克隆项目后自行构建)
|
||||
2. 将 Databasir.jar 上传到服务器
|
||||
3. 在 Databasir.jar 所在目录创建 config 目录,并在目录下创建 `application.properties` 配置,配置中配置 MYSQL 的用户名、密码和连接
|
||||
|
||||
```properties
|
||||
# 端口号,默认8080
|
||||
server.port=8080
|
||||
# 数据库用户名
|
||||
databasir.datasource.username=root
|
||||
# 数据库密码
|
||||
databasir.datasource.password=123456
|
||||
# 数据库地址
|
||||
databasir.datasource.url=127.0.0.1:3306
|
||||
```
|
||||
|
||||
4. 通过 java -jar Databasir.jar 启动应用即可
|
||||
|
||||
**三、系统登陆**
|
||||
|
||||
应用启动后会默认创建 Databasir 管理员用户
|
||||
|
||||
- 用户名:databasir
|
||||
- 密码:databasir
|
||||
|
||||
通过该账号登录应用既可以进行管理
|
||||
|
||||
|
||||
|
||||
### Docker 部署
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Docker Compose 本地部署
|
||||
|
||||
TODO
|
Reference in New Issue
Block a user