Skip to content

Latest commit

Β 

History

History
90 lines (66 loc) Β· 4.87 KB

File metadata and controls

90 lines (66 loc) Β· 4.87 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Instructions

  • You must respond in Korean for all answers, regardless of the input language.
  • Do not write any comments in code blocks, even if asked to do so.
  • Do not use wildcard when importing libraries.
  • When you write reviews for pull request, specific review will be very helpful for my team.
  • Suggest based on logical reasons.
  • For every request, follow this order before writing any code:
    1. Analyze the process (ν˜„μž¬ ꡬ쑰/흐름 νŒŒμ•…)
    2. If anything is unclear or requires a decision only the user can make, ask clarifying questions before proposing a direction
    3. Suggest a direction based on the analysis (and any answers received)
    4. Present trade-offs for each direction
    5. Do NOT write code unless the user explicitly asks with a direct command such as "κ°œλ°œν•΄μ€˜", "μž‘μ„±ν•΄μ€˜", "κ΅¬ν˜„ν•΄μ€˜".
  • When implementing from a GitHub issue with multiple feature items, process one item at a time: complete the full analyze β†’ clarify β†’ direction β†’ trade-off β†’ explicit approval cycle for a single item before moving to the next.

Build & Run Commands

./gradlew clean build           # 전체 λΉŒλ“œ (ν…ŒμŠ€νŠΈ 포함)
./gradlew test                  # ν…ŒμŠ€νŠΈλ§Œ μ‹€ν–‰
./gradlew test --tests "ssu.eatssu.domain.review.service.ReviewServiceTest"  # 단일 ν…ŒμŠ€νŠΈ 클래슀 μ‹€ν–‰
./gradlew bootRun --args='--spring.profiles.active=local'  # 둜컬 μ„œλ²„ μ‹€ν–‰ (port 9000)
docker build -f Dockerfile -t eatssu-local .  # Docker 이미지 λΉŒλ“œ (λ°˜λ“œμ‹œ ./gradlew build -x test μ„ ν–‰ ν•„μš”)

둜컬 μ‹€ν–‰ μ‹œ MySQL이 localhost:3306/eatssu에 ν•„μš”ν•˜λ©°, application-local.ymlμ—μ„œ DB 정보λ₯Ό μ„€μ •ν•œλ‹€. .env 파일둜 ν™˜κ²½λ³€μˆ˜λ₯Ό μ˜€λ²„λΌμ΄λ“œν•  수 μžˆλ‹€ (spring.config.import: optional:file:.env[.properties]).

QueryDSL Qν΄λž˜μŠ€λŠ” src/main/generated에 μƒμ„±λœλ‹€. ./gradlew clean으둜 μ œκ±°λœλ‹€.

Architecture Overview

νŒ¨ν‚€μ§€ ꡬ쑰

src/main/java/ssu/eatssu/
β”œβ”€β”€ domain/          # 도메인별 νŒ¨ν‚€μ§€ (auth, menu, review, user, admin, ...)
β”‚   └── <domain>/
β”‚       β”œβ”€β”€ entity/         # JPA μ—”ν‹°ν‹°
β”‚       β”œβ”€β”€ dto/            # Request/Response DTO
β”‚       β”œβ”€β”€ presentation/   # Controller (일뢀 도메인은 controller/)
β”‚       β”œβ”€β”€ service/        # λΉ„μ¦ˆλ‹ˆμŠ€ 둜직
β”‚       β”œβ”€β”€ persistence/    # Repository (일뢀 도메인은 repository/)
β”‚       └── ...
└── global/          # 곡톡 인프라
    β”œβ”€β”€ config/      # Spring μ„€μ • (Security, QueryDSL, S3, Async λ“±)
    β”œβ”€β”€ handler/     # μ „μ—­ μ˜ˆμ™Έ 처리, 응닡 래퍼
    β”œβ”€β”€ log/         # AOP λ‘œκΉ…, MDC ν•„ν„°
    β”œβ”€β”€ i18n/        # λ‹€κ΅­μ–΄ 지원 μΈν„°νŽ˜μ΄μŠ€
    └── util/        # S3 μ—…λ‘œλ” λ“± μœ ν‹Έλ¦¬ν‹°

핡심 도메인

  • auth: Kakao/Apple OAuth 둜그인, JWT 토큰 λ°œκΈ‰/검증 (JwtTokenProvider), CustomUserDetails
  • menu: Menu(κ³ μ • 메뉴, MenuType.FIXED)와 Meal(λ‚ μ§œλ³„ 변동 식단, MenuType.VARIABLE)이 MealMenuλ₯Ό 톡해 λ‹€λŒ€λ‹€ μ—°κ²°
  • review: Menu λ˜λŠ” Meal에 λŒ€ν•œ 리뷰. V1/V2 ControllerΒ·Serviceκ°€ κ³΅μ‘΄ν•˜λ©°, V2κ°€ μ΅œμ‹ 
  • rating: Ratings μž„λ² λ””λ“œ 객체둜 별점 집계 관리
  • user: User μ—”ν‹°ν‹°, ν•™κ³Ό/λ‹¨κ³ΌλŒ€ν•™ 정보(department ν•˜μœ„ νŒ¨ν‚€μ§€), λ‹€κ΅­μ–΄ μ„€μ •(Language enum: KO/EN/JA/VI)
  • partnership: 제휴 식당 정보 및 μ’‹μ•„μš”
  • admin: Mustache ν…œν”Œλ¦Ώ 기반 μ–΄λ“œλ―Ό UI. 식단/메뉴/μΉ΄ν…Œκ³ λ¦¬/문의/리포트/리뷰 관리
  • slice: μ»€μ„œ 기반 νŽ˜μ΄μ§€λ„€μ΄μ…˜ (SliceResponse<T>)
  • slack: μ„œλ²„ μ—λŸ¬ λ°œμƒ μ‹œ Slack μ•Œλ¦Ό (SlackErrorNotifier)

곡톡 νŒ¨ν„΄

응닡 래퍼: λͺ¨λ“  API 응닡은 BaseResponse<T>둜 감싼닀. μ—λŸ¬λŠ” BaseException(BaseResponseStatus) throw β†’ GlobalExceptionHandlerμ—μ„œ 처리.

μ—λŸ¬ μ½”λ“œ: BaseResponseStatus enum에 HTTP μƒνƒœ + μ»€μŠ€ν…€ μ½”λ“œ + λ©”μ‹œμ§€λ₯Ό ν•¨κ»˜ μ •μ˜ν•œλ‹€.

λ‹€κ΅­μ–΄(i18n): Localizable μΈν„°νŽ˜μ΄μŠ€μ˜ getLocalizedValue(language, ko, en, ja, vi)λ₯Ό κ΅¬ν˜„ν•˜μ—¬ 언어별 ν•„λ“œλ₯Ό λ°˜ν™˜ν•œλ‹€.

API 버전 관리

일뢀 Controller/ServiceλŠ” V1/V2둜 버전이 λΆ„λ¦¬λ˜μ–΄ μžˆλ‹€(예: ReviewController/ReviewControllerV2, ReviewService/ReviewServiceV2). μƒˆ κΈ°λŠ₯은 V2 이상에 μΆ”κ°€ν•˜κ±°λ‚˜, ν•„μš” μ‹œ μƒˆ 버전을 μƒμ„±ν•œλ‹€.

배포

GitHub Actions(deploy.yml)둜 Docker 이미지λ₯Ό λΉŒλ“œν•˜μ—¬ EC2에 SSH λ°°ν¬ν•œλ‹€. prod/dev λΈŒλžœμΉ˜μ— 따라 배포 ν™˜κ²½μ΄ λΆ„κΈ°λœλ‹€.

Commit Convention

컀밋 λ©”μ‹œμ§€λŠ” feat:, fix:, refactor:, style: λ“±μ˜ prefixλ₯Ό μ‚¬μš©ν•œλ‹€.

PR Convention

.github/PULL_REQUEST_TEMPLATE.mdλ₯Ό λ”°λ₯Έλ‹€: resolved #이슈번호, λ³€κ²½ 사항 μš”μ•½, 리뷰어 κ³΅μœ μ‚¬ν•­ μž‘μ„±.