Skip to content

Latest commit

 

History

History
140 lines (117 loc) · 3.11 KB

README.md

File metadata and controls

140 lines (117 loc) · 3.11 KB

SpringBoot best practice

Write to about Spring Boot best practice architecture.

Build

Git clone

git clone https://github.com/tomo0111/springboot-bestpractice.git

Run test

./gradlew test

Docker image build

  • Build SpringBoot best practice application.
  • Use docker for local development.
    • MySQL
    • Redis
    • OpenJDK
docker-compose -f docker-compose-local.yml build

Run container

docker-compose -f docker-compose-local.yml up -d

Pipeline

set target

fly -t tomohito login -c http://www.concourse.developer-tm.com:8080

all delete target

fly logout -a

Environment

Local environment

Local development property file is application-loc.yml.

Working on docker container.

  • Docker Image
    • MySQL
    • Redis
    • OpenJDK

Cassandra cluster.

  • CentOS7 virtual machine
  • 3 nodes

MySQL

Sample query is sql/mysql_sample.sql file.

Sample Class

  • UserEntity.java
  • UserService.java
  • UserRepository.java
  • InfoEntity.java
  • InfoService.java
  • InfoRepository.java

Redis

Sample Class

  • UserService

Cassandra

Sample Class

Develop environment

Develop development property file is application-dev.yml.

Working on Heroku

  • Gradle build pack
  • Postgres SQL

Authentication and Authorization

Spring security.

JWT.

Architecture

spring-boot-bestpracite
├── main
│   ├── java
│   │   └── com
│   │       └── bestpractice
│   │           └── api
│   │               ├── App.java
│   │               ├── common
│   │               │   ├── config
│   │               │   ├── filter
│   │               │   ├── property
│   │               │   └── util
│   │               │
│   │               ├── controller
│   │               │   ├── Advice.java
│   │               │   ├── v1
│   │               │   └── v2
│   │               │
│   │               ├── domain
│   │               │   ├── entity
│   │               │   ├── model
│   │               │   ├── repository
│   │               │   └── role
│   │               │
│   │               ├── exception
│   │               │
│   │               └── service
│   │
│   └── resources
│       ├── application-dev.yml
│       └── application-local.yml
└── test
    ├── java
    │   └── com
    │       └── bestpractice
    │           └── api
    │               ├── AppTests.java
    │               │
    │               ├── common
    │               │
    │               ├── controller
    │               │
    │               ├── repository
    │               │
    │               └── service
    │
    └── resources
        └── application-test.yml