Skip to content

Refactor: 프로젝트 구조 리팩토링#6

Merged
dungbik merged 5 commits intomainfrom
refactor/project-structure
Apr 3, 2026
Merged

Refactor: 프로젝트 구조 리팩토링#6
dungbik merged 5 commits intomainfrom
refactor/project-structure

Conversation

@dungbik
Copy link
Copy Markdown
Contributor

@dungbik dungbik commented Apr 3, 2026

Summary by CodeRabbit

릴리스 노트

Refactor

  • 계층화된 아키텍처로 코드베이스 구조 정리 및 관심사 분리 개선

Chores

  • Spring Boot 3.5.10에서 4.0.2로 업그레이드
  • gRPC 의존성 관리 개선 및 Spring gRPC 통합 적용
  • 설정 및 빌드 구성 최적화
  • README 문서 추가

@dungbik dungbik requested a review from stoneTiger0912 April 3, 2026 05:11
@dungbik dungbik self-assigned this Apr 3, 2026
@dungbik dungbik added the enhancement New feature or request label Apr 3, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Warning

Rate limit exceeded

@dungbik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 52 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 52 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 20dd0a9e-61e8-4419-9c99-a38c4a112dd1

📥 Commits

Reviewing files that changed from the base of the PR and between fa6cd95 and 1c83027.

📒 Files selected for processing (1)
  • src/main/java/flipnote/reaction/infrastructure/messaging/RabbitMqConfig.java

변경 사항 분석

Walkthrough

프로젝트의 계층 구조를 재정의하는 대규모 패키지 리팩토링입니다. 도메인, 애플리케이션, 인프라스트럭처, 인터페이스 계층으로 코드를 재구성하고, 북마크/좋아요 서비스를 새로운 구조로 옮기며, gRPC 설정을 Spring Framework의 기본 gRPC 지원으로 업그레이드했습니다.

Changes

Cohort / File(s) Summary
README 및 빌드 설정
README.md, build.gradle.kts
README 추가 및 Gradle 플러그인(Spring Boot 3.5.104.0.2, protobuf 0.9.40.9.5), gRPC 의존성을 Spring gRPC BOM으로 통합, gRPC 버전 관리 자동화.
도메인 계층 - 북마크
src/main/java/flipnote/reaction/domain/bookmark/*
Bookmark, BookmarkErrorCode, BookmarkTargetTypeflipnote.reaction.domain.bookmark로 이동, 새로운 도메인 리포지토리 인터페이스 및 이벤트 레코드(BookmarkAddedEvent, BookmarkRemovedEvent) 추가.
도메인 계층 - 좋아요
src/main/java/flipnote/reaction/domain/like/*
Like, LikeErrorCode, LikeTargetTypeflipnote.reaction.domain.like로 이동, 새로운 도메인 리포지토리 인터페이스 및 이벤트 레코드(LikeAddedEvent, LikeRemovedEvent) 추가.
도메인 계층 - 공통
src/main/java/flipnote/reaction/domain/common/*
BaseEntity, BizException, ErrorCode, CommonErrorCodeflipnote.reaction.domain.common으로 이동.
애플리케이션 계층 - 북마크
src/main/java/flipnote/reaction/application/bookmark/*
새로운 BookmarkService, BookmarkResult 레코드, BookmarkReader 추가 (배치 쿼리에서 개별 존재 확인으로 변경).
애플리케이션 계층 - 좋아요
src/main/java/flipnote/reaction/application/like/*
새로운 LikeService, LikeResult 레코드, LikeReader 추가 (배치 쿼리에서 개별 존재 확인으로 변경).
애플리케이션 계층 - 공통
src/main/java/flipnote/reaction/application/common/CardSetSummaryResult.java
새로운 카드셋 요약 데이터 전달 객체 추가.
인프라스트럭처 계층 - gRPC
src/main/java/flipnote/reaction/infrastructure/grpc/*
CardSetGrpcClient를 인프라 계층으로 이동, 스텁 기반 주입으로 변경, CardSetSummaryResult 반환 타입 사용; 새로운 GrpcConfig 추가 (Spring gRPC BOM 기반).
인프라스트럭처 계층 - 메시징
src/main/java/flipnote/reaction/infrastructure/messaging/*
RabbitMqConfig를 인프라로 이동, 새로운 ReactionEventPublisher(메서드 기반 이벤트 발행) 및 ReactionEventListener(도메인 이벤트 수신) 추가.
인프라스트럭처 계층 - 영속성
src/main/java/flipnote/reaction/infrastructure/persistence/*
SpringDataBookmarkRepository, SpringDataLikeRepository를 인프라로 이동 (접근성 축소), 새로운 어댑터 클래스 BookmarkRepositoryAdapter, LikeRepositoryAdapter 추가, AuditingConfig 이동.
인터페이스 계층 - HTTP
src/main/java/flipnote/reaction/interfaces/http/*
BookmarkController, LikeController를 인터페이스 계층으로 이동, 새로운 응답 타입(BookmarkResult, LikeResult) 사용, 공통 클래스들(ApiResponse, GlobalExceptionHandler, HeaderConstants, IdResponse, PagingResponse) 이동/정리.
인터페이스 계층 - HTTP DTO
src/main/java/flipnote/reaction/interfaces/http/dto/request/*
BookmarkSearchRequest, BookmarkTargetTypeRequest, LikeSearchRequest, LikeTargetTypeRequest를 DTO 패키지로 이동.
인터페이스 계층 - gRPC
src/main/java/flipnote/reaction/interfaces/grpc/*
ReactionGrpcService를 인터페이스 계층으로 이동, @GrpcService 사용, 새로운 예외 핸들러 GrpcExceptionHandlerImpl 추가.
삭제된 구식 클래스
(구식 북마크/좋아요 패키지)
flipnote/reaction/bookmark/service/BookmarkService, flipnote/reaction/bookmark/model/response/BookmarkResponse, flipnote/reaction/bookmark/model/response/BookmarkTargetResponse, flipnote/reaction/like/service/LikeService, flipnote/reaction/like/model/response/LikeResponse, flipnote/reaction/like/model/response/LikeTargetResponse, 구식 flipnote/reaction/common/grpc/GrpcConfig, flipnote/reaction/common/grpc/GrpcServerConfig, flipnote/reaction/common/event/ReactionEventPublisher 삭제.
설정 파일 업데이트
src/main/resources/application.yml, src/test/resources/application.yml, src/test/java/flipnote/reaction/config/TestGrpcConfig.java
Hibernate DDL 모드를 update에서 validate로 변경 (환경 변수 기반), gRPC 설정을 spring.grpc.* 구조로 표준화, 테스트 설정 업데이트.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • FlipNote-Reaction#5: 응답 타입(BookmarkResponse/BookmarkTargetResponse, LikeResponse/LikeTargetResponse)이 기존 PR은 중첩 레코드로 재구성했으나, 본 PR은 해당 레코드를 삭제하고 애플리케이션 계층의 새로운 결과 레코드로 대체하는 코드 수준의 관계.
  • FlipNote-Reaction#4: gRPC/리더/리포지토리 인터페이스(BookmarkRepository/LikeRepository, BookmarkReader/LikeReader, ReactionGrpcService)를 수정하며, 기존 PR의 배치 쿼리(findByTargetTypeAndTargetIdInAndUserId 및 집합 기반 areBookmarked/areLiked)를 개별 존재 확인으로 대체하고 gRPC 결선을 재배치하는 코드 수준의 관계.
  • FlipNote-Reaction#2: 동일한 코드 경로(CardSetGrpcClient, GrpcConfig, ReactionEventPublisher, 북마크/좋아요 서비스 결선)에서 CardSet gRPC 통합 및 이벤트 발행을 수정하는 직접적인 코드 수준의 관계.

Suggested reviewers

  • stoneTiger0912

Poem

🐰 패키지를 정리하는 토끼,
도메인, 애플리케이션, 인프라로 나누고,
이벤트는 발행하고, 존재는 확인하며,
계층을 세우니 구조가 반짝인다! ✨
북마크와 좋아요가 제자리를 찾았네!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 '프로젝트 구조 리팩토링'으로 이 PR에서 수행된 대규모 구조 개선을 포괄적으로 요약하고 있습니다. 다양한 파일들이 새로운 계층 구조(domain, application, infrastructure, interfaces)로 재정렬되었으며, 이는 제목과 일치합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/project-structure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dungbik dungbik merged commit 5a5e614 into main Apr 3, 2026
2 checks passed
@dungbik dungbik deleted the refactor/project-structure branch April 3, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant