웹앱 · 백엔드 환경
백엔드 환경 · 구성
백엔드는 Spring Boot 3.3.1 + Java 17, 빌드 도구는 Gradle, DB는 PostgreSQL입니다.
실제 build.gradle·application.properties 기준으로 정리했어요.
Gradle 플러그인
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.1'
id 'io.spring.dependency-management' version '1.1.5'
id 'org.liquibase.gradle' version '2.2.0' // DB 마이그레이션
id 'cz.habarta.typescript-generator' version '3.2.1263' // 백엔드 타입 → 프론트 TS 생성
id 'com.github.node-gradle.node' version '7.1.0'
id 'nu.studer.jooq' version '9.0' // jOOQ 코드 생성
}
group = 'com.gsc'
java { sourceCompatibility = JavaVersion.VERSION_17 }주요 의존성
| 역할 | 의존성 |
|---|---|
| 웹 · 검증 | spring-boot-starter-web · spring-boot-starter-validation |
| 영속성 (JPA) | spring-boot-starter-data-jpa · spring-boot-starter-data-jdbc |
| 영속성 (QueryDSL) | querydsl-jpa:5.1.0:jakarta + querydsl-apt(annotationProcessor) |
| 영속성 (jOOQ) | spring-boot-starter-jooq (코드 생성만) |
| 영속성 (MyBatis) | mybatis-spring-boot-starter:3.0.3 (설정만) |
| 보안 · JWT | spring-boot-starter-security · jjwt-api/impl/jackson 0.12.x |
| DB · 마이그레이션 | postgresql(runtime) · liquibase-core |
| 편의 · 기타 | lombok · spring-boot-devtools · actuator · modelmapper(entity 복제용으로 추가 — 실제 변환은 주로 fromEntity·BeanUtils 사용) · commons-lang3 · commons-io |
| 테스트 | spring-boot-starter-test · spring-security-test |
영속성이 4개?
JPA·QueryDSL·jOOQ·MyBatis가 모두 의존성에 있지만, 실제로 쿼리하는 코드는 JPA + QueryDSL뿐입니다(jOOQ는 코드 생성까지만, MyBatis는 설정만). 자세히는 백엔드 4장.
application.properties
server.port=8084 # DB — PostgreSQL, 스키마 lds spring.datasource.url=jdbc:postgresql://localhost:5432/studydb?currentSchema=lds spring.datasource.username=postgres spring.datasource.password=postgres # 스키마는 Liquibase가 관리 spring.liquibase.change-log=classpath:/db/changelog/changelog-index.yaml # JPA — 실행 SQL 로그 spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true # 업로드 최대 100MB spring.servlet.multipart.max-file-size=100MB # JWT app.jwt.expirationMs=43200000 # 액세스 토큰 12시간 app.jwt.refreshExpirationMs=604800000 # 리프레시 7일 app.stage=dev
패키지 구조 (com.example.study)
com.example.study/
├── config/ # 설정 (보안·QueryDSL·감사·Jackson)
├── core/
│ ├── model/
│ │ ├── entity/ # JPA 엔티티 (DB 테이블)
│ │ ├── dto/ # 도메인/검색조건 DTO
│ │ └── enums/ # 열거형
│ ├── enums/ # 상태·타입 열거형
│ ├── repo/ # 저장/조회 (Command)
│ ├── query/ # 복잡한 조회 (querydsl/ 구현)
│ ├── service/ # 비즈니스 로직 (얇음)
│ └── exception/ # 도메인 예외
├── shared/
│ ├── base/ # BaseEntity·BaseRepo 등 공통 베이스
│ ├── exception/ # 공통 예외
│ └── utils/ # 유틸
└── web/
├── endpoint/ # REST 컨트롤러 + 전역 예외
├── dto/ # 요청/응답 DTO
├── filter/ # JWT 인증 필터
└── utils/ # 응답 헬퍼→ 구조·요청 흐름 상세: 백엔드 1장 · 스프링 부트 · 아키텍처