Best practice of monolithic spring application starter

Overview

Gradation header generated by Hong-JunHyeok

소개

안녕하세요. 전지환입니다.

매번 새 프로젝트를 개발하려고 하면 초기 환경 세팅 때문에 많은 시간을 쓰곤 하는데요.
제가 만든 데모 애플리케이션은 최대한 스프링 애플리케이션에 공통으로 사용되는 라이브러리와 설정값을 넣었습니다.
제 데모를 이용해보니 이런 라이브러리도 필요한 것 같다, 이런 설정값도 필요한 것 같다. 하는 부분 issue로 제안해주세요.

감사합니다.

프로젝트 구성

- Dependencies

Spring Web
Spring Data JPA
querydsl-jpa
Lombok
Validation
H2 Database
Mockito
Swagger3, Swagger-ui
Spring REST Docs (Junit 5 + Mockito)
Spring REST Docs API specification Integration

시작하기

  • git clone

    • git clone https://github.com/jyeonjyan/springboot-starter [your project name]
  • IntelliJ 에서 프로젝트 이름 바꾸기

    1. Go to File >> Project Structure >> Project > Project Name Update project name with its new name
    2. Exit IntelliJ IDEA
    3. Edit contents of the following files
      • {project_root}/settings.gradle
      • {project_root}/.idea/.name (if exists)
    4. Open IntelliJ IDEA
    5. Refresh Gradle Project
    6. Change app package name like com.app.yourprojectname
    7. Change app entry point class name like YourApplication.java
    8. Run YourApplication.java

애플리케이션 설정

  • 애플리케이션은 기본적으로 8080 포트에서 실행돼요.

  • H2 Database 사용하는 법

  • Querydsl 사용하는 법

    • IntelliJ 환경설정에서 annotation processing 을 활성화 해요.
    • Q-class를 생성하려면 Gradle 작업창에서 Gradle/Tasks/other/compileQuerydsl.sh task를 누르거나 ./gradlew clean build 명령어를 이용해요.
    • Q-class는 project/build/generated/querydsl/ 여기에 생성돼요.
    • 자세한 내용은 여기를 참고하세요.
  • Swagger 사용하는 법

    • Swagger 설정은 src/main/**/demo/config/SwaggerConfig.java 에 있어요.
    • 기본적으로 @Profile("dev") dev profile 에서만 사용 가능하게 해뒀어요.
    • Swagger는 http://localhost:8080/swagger-ui.html 에 마운트 돼 있어요.
    • 자세한 내용은 여기를 참고하세요.
  • Spring REST Docs 사용하는 법

    • Swagger 는 API 문서화 도구로 사용하기에는 아쉬운 부분이 많아요. 그래서 REST Docs을 준비했어요.
    • Controller Test 를 통과해야지만 문서가 만들어져요. 예제는 MockMvc, mockito, junit5 로 테스트 했어요.
    • 테스트가 통과하면 build/generated-snippets/**에 스니펫(.adoc)들이 생성돼요.
    • src/docs/asciidoc/**.adoc 으로 API spec 페이지를 구성해주세요.
      • .adoc 파일 작성 방법에 대한 자세한 내용은 여기를 참고하세요.
    • ./gradlew buildbuild/asciidoc/html5/**에 html로 변환된 API spec 페이지가 생성될 거예요.
  • Spring REST Docs API spec 사용하는 법

You might also like...

An awesome Spring Boot Starter!

 An awesome Spring Boot Starter!

spring-boot-tony-starter An awesome Spring Boot Starter! Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Proje

Sep 13, 2022

Create your Java crypto trading bot in minutes. Our Spring boot starter takes care of exchange connections, accounts, orders, trades, and positions so you can focus on building your strategies.

Create your Java crypto trading bot in minutes. Our Spring boot starter takes care of exchange connections, accounts, orders, trades, and positions so you can focus on building your strategies.

Quick Start | Documentation | Discord | Twitter Create and run your java crypto trading bot in minutes Our Spring boot starter takes care of exchange

Jan 3, 2023

Get or Throw Spring boot Starter will help you to hide handling if entity not found.

Get or Throw Spring boot Starter Get or Throw Spring boot Starter will help you to hide handling if entity not found. 1. Setup 2. Usage Library adds c

Feb 2, 2022

Event promoted by DevSuperior to improve the best practices of Spring with Java and has React JS as an additional.

Event promoted by DevSuperior to improve the best practices of Spring with Java and has React JS as an additional.

Semana-Spring-React (sds3.0) Introduction SDS3 is an event promoted by DevSuperior which aims to help students and programming professionals to enter

Oct 25, 2021

Spring Boot REST API authentication best practices using JWT

 Spring Boot REST API authentication best practices using JWT

Spring Boot REST API authentication best practices using JWT Token based API authentication with Spring Security and JWT (JSON web Token) Overview Thi

Dec 22, 2022

Short Java programs for practice (OCP) Oracle Certified Professional Java SE 11

OCP-study Short Java programs to practice for (OCP) Oracle Certified Professional Java SE 11 Exam Google document with notes: https://docs.google.com/

May 24, 2022

Challenge: Learn Object Oriented Programming in Practice

Challenge: Learn Object Oriented Programming in Practice The main objective is to put into practice one of the main tools of OO: ABSTRACTION, ENCAPSUL

Sep 4, 2022

Source codes of book Java Concurrency In Practice, rebuild by maven.

Introduction Source codes of book: Java Concurrency In Practice(2011, Brain Goetz etc. jcip for short.), rebuild from https://jcip.net/ with maven. Mo

Jun 9, 2022

Fast, Reliable & Simple Practice Core

Twilight An open-sourced simple Practice Plugin made for the Spigot API (Unfinished) Contact You can contact me on discord via my tag or server: My di

Sep 19, 2022
Comments
  • Add strategy design pattern [ResponseEntity + SpringHateoas]

    Add strategy design pattern [ResponseEntity + SpringHateoas]

    요약

    singleResult, listResult 를 전략 패턴으로 풀어내려고 했다. 지금 PR은 RestAPI response는 정규화는 할 수 있지만 hateoas를 전략패턴으로 풀어내기에 무리가 있다.

    TODO

    상태전의가 가능한 링크들을 간편하게 추가할 수 있게 구조를 개선하자 😥

    documentation invalid 
    opened by jyeonjyan 0
Owner
전지환
조직문화를 향유합니다 🏄🏻‍♂️
전지환
A springboot-starter that can achieve Intranet penetration. 一款可以实现内网穿透的springboot-starter。

qynat-springboot-starter 基于netty的内网穿透工具在springboot中的整合 protocol协议:protobuf 只需在application.properties中配置少量信息,实现零代码侵入的web项目内网穿透 项目的server端的源码在另一个多模块项目中,

whz11 65 Dec 12, 2022
A springboot-starter that can achieve Intranet penetration. 一款可以实现内网穿透的springboot-starter。

qynat-springboot-starter 基于netty的内网穿透工具在springboot中的整合 protocol协议:protobuf 只需在application.properties中配置少量信息,实现零代码侵入的web项目内网穿透 项目的server端的源码在另一个多模块项目中,

whz11 65 Dec 12, 2022
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
Kafka-spring-boot-starter: encapsulated based on spring-kafka

Encapsulation based on spring-kafka not only supports native configuration, but also adds multi data source configuration.

liudong 8 Jan 9, 2023
Practice and testing with Java 11, Prometheus, and Spring-boot with MicroService Architecture. Designed to run on Kubernetes in minikube.

This application was written by Andrew Aslakson Built to run on minikube using kubernetes General race tracking system? Secure with Firebase Authentic

null 1 Feb 5, 2022
Spring Boot starter module for gRPC framework.

Spring Boot starter module for gRPC framework.

Michael Zhang 2.8k Jan 4, 2023
Spring Boot starter module for gRPC framework.

Spring Boot starter module for gRPC framework.

Michael Zhang 1.8k Mar 17, 2021
Tuya 37 Dec 26, 2022
Spring Boot starter for JustAuth Plus.

Spring Boot starter for JustAuth Plus.

Fujie 5 Jun 23, 2022
基于 spring-boot-starter-log4j2:2.6.1 (log4j 2.14.1)

Log4j 2 CVE-2021-44228 测试样本应用 基于 spring-boot-starter-log4j2:2.6.1 (log4j 2.14.1) 可用接口 接口 请求方法 参数 vulnerable_request_get GET v=payload vulnerable_reque

Zhangzhe 3 Mar 23, 2022