About Spring Boot best practice architecture.
$ SPRING_PROFILES_ACTIVE=""
$ MYSQL_DB_HOST=""
$ MYSQL_DB_NAME=""
$ MYSQL_DB_USER=""
$ MYSQL_DB_PASS=""
$ REDIS_DB_HOST=""
$ REDIS_DB_PORT=""
$ REDIS_DB_PASS=""Local development property file is application-loc.yml.
$ SPRING_PROFILES_ACTIVE="local"Working on docker container.
- Docker Image
- MySQL
- Redis
- OpenJDK
Cassandra cluster.
- CentOS7 virtual machine
- 3 nodes
Sample query is sql/mysql_sample.sql file.
Sample Class
- UserEntity.java
- UserService.java
- UserRepository.java
- InfoEntity.java
- InfoService.java
- InfoRepository.java
Sample Class
- UserService
Develop development property file is application-dev.yml.
$ SPRING_PROFILES_ACTIVE="dev"Git clone
$ git clone https://github.com/tomoyane/springboot-bestpractice.gitRun test
./gradlew testDocker image build
- Build SpringBoot best practice application.
- Use docker for local development.
- MySQL
- Redis
- OpenJDK
$ docker-compose -f docker-compose-local.yml buildRun container
$ docker-compose -f docker-compose-local.yml up -dSpring security.
JWT.
spring-boot-bestpracite
├── main
│ ├── java
│ │ └── com
│ │ └── bestpractice
│ │ └── api
│ │ ├── App.java
│ │ ├── common
│ │ │ ├── config
│ │ │ ├── property
│ │ │ └── util
│ │ │
│ │ ├── controller
│ │ │ ├── Advice.java
│ │ │ ├── v1
│ │ │ └── v2
│ │ │
│ │ ├── domain
│ │ │ ├── entity
│ │ │ ├── model
│ │ │ ├── repository
│ │ │ └── service
│ │ │
│ │ ├── exception
│ │ │
│ │ └── security
│ │ ├── filter
│ │ └── role
│ │
│ └── resources
│ ├── application-dev.yml
│ └── application-local.yml
└── test
├── java
│ └── com
│ └── bestpractice
│ └── api
│ ├── AppTests.java
│ │
│ ├── common
│ │
│ ├── controller
│ │
│ ├── repository
│ │
│ └── service
│
└── resources
└── application-test.yml