Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Gradle build output
/build
**/build/
/.gradle

# IntelliJ / IDE
Expand Down
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- PR 생성 전 아래 내용을 확인하고 작성해주세요 -->

## 📌 PR 제목
간결하고 명확하게 작성해주세요
_예: 사용자 로그인 기능 추가_

## 🔗 관련 이슈 번호
_예: #123_

## 📝 변경 사항 요약
무엇을, 왜 변경했는지 간략히 작성해주세요
- 로그인 API 엔드포인트 추가
- JWT 인증 로직 수정

## ✅ 체크리스트
- [ ] 코드 빌드 및 컴파일 통과
- [ ] 단위/통합 테스트 통과
- [ ] 문서/주석 업데이트 완료
42 changes: 0 additions & 42 deletions .github/pull_request_template.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,4 @@ gradle-app.setting
.idea/
/closet.pem
/nginx/
/codeit-final_accessKeys.csv
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ FROM amazoncorretto:17 AS builder

WORKDIR /app

COPY gradle ./gradle
COPY gradlew ./gradlew
COPY build.gradle settings.gradle ./
RUN chmod +x gradlew
# gradle 래퍼 + 설정 복사
COPY gradlew .
COPY gradle/ gradle/
COPY settings.gradle build.gradle ./

RUN ./gradlew build -x test --no-daemon || true
COPY closet-api/ closet-api/
COPY closet-domain/ closet-domain/

COPY src ./src
RUN ./gradlew build -x test --no-daemon
RUN chmod +x gradlew
RUN ./gradlew :closet-api:bootJar -x test --no-daemon

# 런타임 스테이지
FROM amazoncorretto:17-alpine3.21
Expand All @@ -20,7 +21,7 @@ WORKDIR /app

ENV JVM_OPTS="-Duser.timezone=Asia/Seoul"

COPY --from=builder /app/build/libs/*.jar app.jar
COPY --from=builder /app/closet-api/build/libs/*.jar app.jar

EXPOSE 80

Expand Down
45 changes: 0 additions & 45 deletions HELP.md

This file was deleted.

112 changes: 41 additions & 71 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,85 +1,55 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '3.4.0' apply(false)
id 'io.spring.dependency-management' version '1.1.6' apply(false)
}

group = 'project'
version = '0.0.1-SNAPSHOT'
allprojects {
group = 'project.closet'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
repositories {
mavenCentral()
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.4'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.security:spring-security-messaging'

// Database
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'org.postgresql:postgresql'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// JWT
implementation 'com.nimbusds:nimbus-jose-jwt:10.3'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

// 테스트 컨테이너
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:postgresql'
testImplementation "org.testcontainers:junit-jupiter:1.20.6"

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
runtimeOnly 'com.h2database:h2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// Excel 처리
implementation 'org.apache.poi:poi-ooxml:5.2.3'

// S3
implementation 'software.amazon.awssdk:s3:2.31.7'

// websocket
implementation 'org.springframework.boot:spring-boot-starter-websocket'

// mail
implementation 'org.springframework.boot:spring-boot-starter-mail'
testImplementation 'org.subethamail:subethasmtp:3.1.7'

// Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
subprojects {
apply {
plugin('java')
plugin('org.springframework.boot')
plugin('io.spring.dependency-management')
}

// Test 에서 롬복 사용 설정
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

implementation 'org.jsoup:jsoup:1.15.4'
}
dependencies {
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'

tasks.named('test') {
useJUnitPlatform()
}

tasks.named('jar') {
enabled = false
// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}
tasks.named('jar') {
enabled = false
}
tasks.named('bootJar') {
enabled = false
}
tasks.named('test') {
useJUnitPlatform()
}
}
47 changes: 47 additions & 0 deletions closet-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
project(':closet-api') {

dependencies {
implementation project(':closet-domain')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.4'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.security:spring-security-messaging'

// Database
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
testImplementation 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// JWT
implementation 'com.nimbusds:nimbus-jose-jwt:10.3'

// Excel 처리
implementation 'org.apache.poi:poi-ooxml:5.2.3'

// S3
implementation 'software.amazon.awssdk:s3:2.31.7'

// websocket
implementation 'org.springframework.boot:spring-boot-starter-websocket'

// mail
implementation 'org.springframework.boot:spring-boot-starter-mail'
testImplementation 'org.subethamail:subethasmtp:3.1.7'

// Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

implementation 'org.jsoup:jsoup:1.15.4'
}

tasks.bootJar {
enabled = true
}

tasks.jar {
enabled = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

@SpringBootApplication
@ConfigurationPropertiesScan
public class ClosetApplication {

public static void main(String[] args) {
SpringApplication.run(ClosetApplication.class, args);
}
public class ClosetApiApplication {

public static void main(String[] args) {
SpringApplication.run(ClosetApiApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ResponseEntity<CsrfToken> getCsrfToken(CsrfToken csrfToken) {
@Override
@GetMapping("/me")
public ResponseEntity<String> me(
@CookieValue(value = JwtService.REFRESH_TOKEN_COOKIE_NAME, required = false) String refreshToken
@CookieValue(value = JwtService.REFRESH_TOKEN_COOKIE_NAME, required = false) String refreshToken
) {
log.info("내 정보 조회 요청");
if (refreshToken == null || refreshToken.isBlank()) {
Expand All @@ -54,14 +54,14 @@ public ResponseEntity<String> me(

@PostMapping("refresh")
public ResponseEntity<String> refresh(
@CookieValue(JwtService.REFRESH_TOKEN_COOKIE_NAME) String refreshToken,
HttpServletResponse response
@CookieValue(JwtService.REFRESH_TOKEN_COOKIE_NAME) String refreshToken,
HttpServletResponse response
) {
log.info("토큰 재발급 요청");
JwtSession jwtSession = jwtService.refreshJwtSession(refreshToken);

Cookie refreshTokenCookie = new Cookie(JwtService.REFRESH_TOKEN_COOKIE_NAME,
jwtSession.getRefreshToken());
jwtSession.getRefreshToken());
refreshTokenCookie.setHttpOnly(true);
response.addCookie(refreshTokenCookie);

Expand All @@ -71,7 +71,7 @@ public ResponseEntity<String> refresh(
@PostMapping("reset-password")
@Override
public ResponseEntity<Void> resetPassword(
@RequestBody @Valid ResetPasswordRequest resetPasswordRequest
@RequestBody @Valid ResetPasswordRequest resetPasswordRequest
) {
authService.resetPassword(resetPasswordRequest.email());
return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
Expand Down
Loading
Loading