Mono repository for Spring boot2(reactive-api, reactive-admin, batch)
database
└── base
├── api
├── admin
└── batch
project name | Executable jar | description |
---|---|---|
database | ☓ | generate-jooq, migrate-liquibase, auto-generated jooq files |
base | ☓ | share project |
api | ◯ | api project |
admin | ◯ | admin project |
batch | ◯ | batch project |
Install java by sdkman.
# check java versions
$ sdk list java | grep zulu
11.0.2-zulu
11.0.1-zulu
11.0.1-zulufx
10.0.2-zulu
9.0.7-zulu
8.0.201-zulu
8.0.192-zulufx
7.0.181-zulu
# install java11
sdk install java 11.0.2-zulu
https://docs.docker.com/docker-for-mac/install/
# clone project
git clone https://github.com/treetips/kotlin-spring-boot-jooq-liquibase-thymeleaf-example.git
cd kotlin-spring-boot-jooq-liquibase-thymeleaf-example
cd ${PROJECT_ROOT}
yarn
Install community(or ultimate) edition.
https://www.jetbrains.com/idea/download/#section=mac
Welcome to IntelliJ IDEA
→ Configure
→ Plugins
→ Install JetBrains plugin
. Install Editorconfig
.Welcome to IntelliJ IDEA
→ Configure
→ Project Defaults
→ Project Structure
.SDKs
→ +
→ JDK
-> $HOME/.sdkman/candidates/java/11.0.2-zulu
.Welcome to IntelliJ IDEA
-> Import Project
-> choose clone directory.Import from external project model
→ Gradle
-> Next.Use auto-import
and Use gradle 'wrapper' task configuration
. Choose Gradle JVM
to Use JAVA_HOME(sdkman)
. Choose Project format
to .idea (directory based)
.Require starting docker daemon.
cd ${PROJECT_ROOT}
docker-compose up -d
Start to MySQL-server
and Redis-server
and MailCatcher(Virtual SMTP)
.
cd $PROJECT_ROOT/database
./migrate-up.sh
Initial table and initial data are built by Liquibase.
cd $PROJECT_ROOT/database
./generate-jooq.sh
jOOQ generate java files by initialized database.
Right click on com.example.api.ApiApplication.kt
-> Run.
Browse http://localhost:8080/api/prefecture/
# not blank
curl \
-XPOST \
-H 'Content-Type:application/json' \
-d '{"id":""}' \
"http://localhost:8080/sample/validation/bean-validation/"
# max
curl \
-XPOST \
-H 'Content-Type:application/json' \
-d '{"id":"999"}' \
"http://localhost:8080/sample/validation/bean-validation/"
Right click on com.example.admin.AdminApplication.kt
-> Run.
Browse http://localhost:8090/
Setting | Value |
---|---|
Main class | com.example.batch.BatchApplication |
VM options | -Dbatch.name=Sample1Batch |
docker-compose up -d
, browse http://localhost:1080
.
cd $PROJECT_ROOT
yarn apidoc
Apidoc is displayed automatically by a browser when execute this command.
cd $PROJECT_ROOT/database
./generate-dbdoc.sh
Browse database/build/database/docs/index.html
.
cd $PROJECT_ROOT
./connect-mysql.sh
cd $PROJECT_ROOT
./connect-redis.sh