diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3f634ba
--- /dev/null
+++ b/README.md
@@ -0,0 +1,77 @@
+
+
+
+
+ API of Oxygen Toolbox
+
+
+
+
+# Overview ([ZH](README_zh.md), EN)
+
+This project is the backend API of Oxygen Toolbox. Provides tool store, tool management, authentication, user management and other functions.
+
+# Requires
+
+- Java 17+
+- MySQL
+- Redis
+
+# Related projects
+
+[Web UI of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-ui)
+
+[Desktop Client of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-desktop)
+
+[Android Client of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-android)
+
+# Quick Start
+
+1. First run, generate configuration file template
+
+```shell
+java -jar oxygen-api.jar
+```
+
+2. Copy the `application-config.example.yml` file in the `data` directory to the running directory and rename it to `application-config.yml`
+
+```shell
+cp ./data/application-config.example.yml application-config.yml
+```
+
+3. Edit the content of the configuration file `application-config.yml`
+
+
+4. Run again
+
+```shell
+java -jar oxygen-api.jar
+```
+
+# Security
+
+Integration with Spring Security and add other filter for jwt token process. The secret key is stored in `application-config.yml`.
+
+# Database
+
+Two databases, MySQL + SQLite, are used. MySQL is used to store key data, and SQLite is used to store logs and other data that require a large amount of reading and writing.
+
+# Q&A
+
+> **Q: What is the default administrator account and password?**
+>
+> A: If configured in `application-config.yml` before initializing the database, use the specified account and password. If not configured, a random password will be generated by default. See the console output for details.
+
+> **Q: Do I need to initialize the database?**
+>
+> A: This project uses `Flyway` to automatically initialize the database without manually defining the data table structure. To ensure data security, please back up the database before upgrading.
diff --git a/README_zh.md b/README_zh.md
new file mode 100644
index 0000000..c6b2738
--- /dev/null
+++ b/README_zh.md
@@ -0,0 +1,77 @@
+
+
+
+
+ API of Oxygen Toolbox
+
+
+
+
+# 概述 (ZH, [EN](README.md))
+
+本项目为 Oxygen Toolbox 的后端 API。提供工具商店、工具管理、认证鉴权、用户管理等功能。
+
+# 环境要求
+
+- Java 17+
+- MySQL
+- Redis
+
+# 关联项目
+
+[Web UI of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-ui)
+
+[Desktop Client of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-desktop)
+
+[Android Client of Oxygen Toolbox](https://github.com/FatttSnake/oxygen-android)
+
+# 快速开始
+
+1. 初次运行,生成配置文件模板
+
+```shell
+java -jar oxygen-api.jar
+```
+
+2. 将 `data` 目录下的 `application-config.example.yml` 文件复制到运行目录下,并重命名为 `application-config.yml`
+
+```shell
+cp ./data/application-config.example.yml application-config.yml
+```
+
+3. 编辑配置文件 `application-config.yml` 内容
+
+
+4. 再次运行
+
+```shell
+java -jar oxygen-api.jar
+```
+
+# 安全
+
+集成 Spring Security 并采用 jwt 令牌, 密钥存储在 `application-config.yml` 中。
+
+# 数据库
+
+采用 MySQL + SQLite 双数据库,MySQL 用于存放关键数据,SQLite 用于存放日志等需要大量读写的数据。
+
+# Q&A
+
+> **Q: 默认管理员账号和密码是什么?**
+>
+> A: 初始化数据库前配置在 `application-config.yml` 中,则使用所指定账号密码。未配置则默认生成随机密码,详见控制台输出。
+
+> **Q: 是否需要初始化数据库?**
+>
+> A: 本项目采用 `Flyway` 自动初始化数据库,无需手动定义数据表结构。为保证数据安全,升级时请先备份数据库。
diff --git a/build-docker.sh b/build-docker.sh
index d615bdb..1d585aa 100644
--- a/build-docker.sh
+++ b/build-docker.sh
@@ -1,24 +1,17 @@
#!/bin/bash
-JAR_NAME=`ls target | grep api-|grep -v original`
+JAR_NAME=`ls target | grep oxygen-api- | grep -vE "original|asc|pom|javadoc"`
JAR_VERSION=${JAR_NAME%.*}
JAR_VERSION=${JAR_VERSION#*-}
+JAR_VERSION=${JAR_VERSION#*-}
BUILD_TIME=$(date "+%Y%m%d%H%M%S")
mkdir target/extracted
-java -Djarmode=layertools -jar target/*.jar extract --destination target/extracted
+java -Djarmode=layertools -jar target/${JAR_NAME} extract --destination target/extracted
if [[ "${JAR_VERSION}" =~ ^.*SNAPSHOT$ ]]
then
- docker build -t ${DOCKER_HUB_URL}/oxygen-api:snapshot-latest -t ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION -t ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION-${BUILD_TIME} .
- cat "${KEYS_PATH}/docker.password" | docker login ${DOCKER_HUB_URL} -u jenkins --password-stdin
- docker push ${DOCKER_HUB_URL}/oxygen-api:snapshot-latest
- docker push ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION
- docker push ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION-${BUILD_TIME}
+ docker build -t ${DOCKER_HUB_URL}/oxygen-api:snapshot-latest -t ${DOCKER_HUB_URL}/oxygen-api:${JAR_VERSION} -t ${DOCKER_HUB_URL}/oxygen-api:${JAR_VERSION}-${BUILD_TIME} .
else
- docker build -t ${DOCKER_HUB_URL}/oxygen-api:latest -t ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION -t ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION-${BUILD_TIME} .
- cat "${KEYS_PATH}/docker.password" | docker login ${DOCKER_HUB_URL} -u jenkins --password-stdin
- docker push ${DOCKER_HUB_URL}/oxygen-api:latest
- docker push ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION
- docker push ${DOCKER_HUB_URL}/oxygen-api:$JAR_VERSION-${BUILD_TIME}
+ docker build -t ${DOCKER_HUB_URL}/oxygen-api:latest -t ${DOCKER_HUB_URL}/oxygen-api:${JAR_VERSION} -t ${DOCKER_HUB_URL}/oxygen-api:${JAR_VERSION}-${BUILD_TIME} .
fi
\ No newline at end of file
diff --git a/doc/logo.svg b/doc/logo.svg
new file mode 100644
index 0000000..6b67342
--- /dev/null
+++ b/doc/logo.svg
@@ -0,0 +1 @@
+
diff --git a/pom.xml b/pom.xml
index 0f4ae0e..8032bfb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,78 +8,140 @@
3.2.1
- top.fatweb
+
+ top.fatweb.oxygen
api
- 0.0.1-SNAPSHOT
+ 1.0.0-SNAPSHOT
+
oxygen-api
- oxygen-api
-
-
-
- sonatype-oss-snapshots
- sonatype-oss-snapshots
- https://s01.oss.sonatype.org/content/repositories/snapshots
-
- false
-
-
- true
-
-
-
-
-
-
- dev
-
- true
-
- env
- dev
-
-
-
-
- com.github.xiaoymin
- knife4j-openapi3-jakarta-spring-boot-starter
- 4.4.0
-
-
-
-
- prod
-
-
- env
- prod
-
-
-
-
- com.github.xiaoymin
- knife4j-openapi3-jakarta-spring-boot-starter
-
-
- com.github.xiaoymin
- knife4j-openapi3-ui
-
-
- org.webjars
- swagger-ui
-
-
-
-
-
-
+ API of Oxygen Toolbox
+ https://github.com/FatttSnake/oxygen-api
17
1.9.21
${maven.build.timestamp}
yyyy-MM-dd'T'HH:mm:ss
+ 3.0.3
+ 2.3
+ 3.5.7
+ 4.3.1
9.22.3
+ 4.4.0
+ 1.1.0
+ 6.4.9
+ 3.5.3
+ 4.4.0
+
+
+ FatWeb
+ https://fatweb.top
+
+
+
+
+ GNU General Public License v3.0 or later
+ https://www.gnu.org/licenses/gpl-3.0-standalone.html
+ repo
+
+
+
+
+
+ fatttsnake
+ FatttSnake
+ fatttsnake@gmail.com
+
+
+
+
+ ${project.name}-${project.version}
+ ${project.basedir}/src/main/kotlin
+ ${project.basedir}/src/test/kotlin
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ org.jetbrains.kotlin
+ kotlin-maven-plugin
+
+
+ compile
+ compile
+
+ compile
+
+
+
+ src/main/kotlin
+ target/generated-sources/annotations
+
+
+
+
+ test-compile
+ test-compile
+
+ test-compile
+
+
+
+ src/main/kotlin
+ target/generated-sources/annotations
+
+
+
+
+
+
+ -Xjsr305=strict
+
+
+ spring
+
+
+
+
+ org.jetbrains.kotlin
+ kotlin-maven-allopen
+ ${kotlin.version}
+
+
+
+
+ maven-surefire-plugin
+ 2.22.2
+
+
+ maven-failsafe-plugin
+ 3.1.2
+
+
+ org.jetbrains.dokka
+ dokka-maven-plugin
+ 1.9.10
+
+
+ pre-site
+
+ dokka
+
+
+
+ attach-javadocJar
+ package
+
+ javadocJar
+
+
+
+
+
+
+
org.springframework.boot
@@ -111,20 +173,10 @@
runtime
true
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.springframework.security
- spring-security-test
- test
-
com.github.lianjiatech
retrofit-spring-boot-starter
- 3.0.3
+ ${retrofit.version}
@@ -147,7 +199,7 @@
org.apache.velocity
velocity-engine-core
- 2.3
+ ${velocity.version}
com.mysql
@@ -157,17 +209,16 @@
com.baomidou
mybatis-plus-spring-boot3-starter
- 3.5.7
+ ${mybatis-plus.version}
org.xerial
sqlite-jdbc
- 3.44.1.0
com.baomidou
dynamic-datasource-spring-boot3-starter
- 4.3.1
+ ${dynamic-datasource.version}
org.flywaydb
@@ -178,94 +229,111 @@
org.springframework.boot
spring-boot-starter-data-redis
-
- com.baomidou
- mybatis-plus-spring-boot3-starter-test
- 3.5.7
- test
-
com.auth0
java-jwt
- 4.4.0
+ ${jwt.version}
top.fatweb
avatar-generator
- 1.1.0
+ ${avatar-generator.version}
com.github.oshi
oshi-core
- 6.4.9
+ ${oshi.version}
commons-codec
commons-codec
- 1.16.1
com.google.zxing
core
- 3.5.3
+ ${zxing.version}
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.springframework.security
+ spring-security-test
+ test
+
+
+ com.baomidou
+ mybatis-plus-spring-boot3-starter-test
+ ${mybatis-plus.version}
+ test
-
- ${project.basedir}/src/main/kotlin
- ${project.basedir}/src/test/kotlin
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.jetbrains.kotlin
- kotlin-maven-plugin
-
-
- compile
- process-sources
-
- compile
-
-
-
- src/main/kotlin
- target/generated-sources/annotations
-
-
-
-
-
-
- -Xjsr305=strict
-
-
- spring
-
-
-
-
- org.jetbrains.kotlin
- kotlin-maven-allopen
- ${kotlin.version}
-
-
-
-
- org.jetbrains.dokka
- dokka-maven-plugin
- 1.9.10
-
-
- pre-site
-
- dokka
-
-
-
-
-
-
+
+
+ dev
+
+ true
+
+ env
+ dev
+
+
+
+
+ com.github.xiaoymin
+ knife4j-openapi3-jakarta-spring-boot-starter
+ ${knife4j.version}
+
+
+
+
+ release
+
+
+ env
+ release
+
+
+
+
+ com.github.xiaoymin
+ knife4j-openapi3-jakarta-spring-boot-starter
+ ${knife4j.version}
+
+
+ com.github.xiaoymin
+ knife4j-openapi3-ui
+
+
+ org.webjars
+ swagger-ui
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 3.1.0
+
+
+ sign-artifact
+ verify
+
+ sign
+
+
+
+
+
+
+
+