- GitHub Actions workflow로 백엔드 서비스 자동 빌드/배포 구성
- Kustomize를 통한 dev/staging/prod 환경별 설정 관리
- 각 마이크로서비스별 Dockerfile 추가
- 배포 자동화 스크립트 및 환경 변수 설정
- CI/CD 가이드 문서 작성
- Kubernetes 매니페스트 파일 생성 (7개 서비스)
* user-service, event-service, ai-service, content-service
* participation-service, analytics-service, distribution-service
* 공통 리소스: Ingress, ConfigMap, Secret, ImagePullSecret
- analytics-service 배포 문제 해결
* Hibernate PostgreSQL dialect 추가
* DB 자격증명 수정 (eventuser/Hi5Jessica!)
* analytics_db 데이터베이스 생성
- content-service Probe 경로 수정
* Context path 포함 (/api/v1/content/actuator/health)
- distribution-service 신규 배포
* Docker 이미지 빌드 및 ACR 푸시
* K8s 매니페스트 생성 및 배포
* Ingress 경로 추가 (/distribution)
- Gradle bootJar 설정 추가
* 5개 서비스에 archiveFileName 설정
- 배포 가이드 문서 추가
* deployment/k8s/deploy-k8s-guide.md
* claude/deploy-k8s-back.md
* deployment/container/build-image.md 업데이트
배포 완료: 모든 백엔드 서비스(7개) 정상 실행 중
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- DTO 필드명 통일 (프론트엔드 호환)
- totalParticipants → participants
- channelName → channel
- totalInvestment → totalCost
- 증감 데이터 필드 추가
- participantsDelta: 참여자 증감 (현재 0, TODO)
- targetRoi: 목표 ROI (EventStats에서 가져옴)
- EventStats 엔티티 스키마 변경
- targetRoi 컬럼 추가 (BigDecimal, default: 0)
- Service 로직 수정
- AnalyticsService: 필드명 변경 및 증감 데이터 적용
- ROICalculator: totalCost 필드명 변경
- UserAnalyticsService: 필드명 변경 및 증감 데이터 적용
- 검증 문서 추가
- frontend-backend-validation.md: 수정 내용 및 다음 단계 정리
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
문제 해결:
- storeId → userId 필드명 변경으로 인한 스키마 불일치
- PostgreSQL ERROR: column "user_id" of relation "event_stats" contains null values
- update 모드는 컬럼명 변경(rename)을 자동 처리하지 못함
변경사항:
- DDL_AUTO: update → create
- 서비스 시작 시 테이블을 DROP 후 재생성
- MVP 환경: SampleDataLoader가 샘플 데이터 자동 생성
주의사항:
- create 모드는 매번 테이블을 재생성함 (데이터 손실)
- MVP 환경에서만 사용, 실제 운영 시 update/validate로 변경 필요
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
주요 변경사항:
- EventStats 엔티티 storeId → userId 필드 변경
- EventStatsRepository 메소드명 변경 (findAllByStoreId → findAllByUserId)
- MVP 환경 1:1 관계 적용 (1 user = 1 store)
- EventCreatedConsumer에서 storeId → userId 매핑 처리
User 통합 분석 API 4개 신규 개발:
1. GET /api/v1/users/{userId}/analytics - 사용자 전체 성과 대시보드
2. GET /api/v1/users/{userId}/analytics/channels - 채널별 성과 분석
3. GET /api/v1/users/{userId}/analytics/roi - ROI 상세 분석
4. GET /api/v1/users/{userId}/analytics/timeline - 시간대별 참여 추이
기술 스택:
- Spring Boot 3.3.0, Java 21
- JPA/Hibernate, Redis 캐싱 (TTL 30분)
- Kafka Event-Driven 아키텍처
문서:
- test-backend.md: 백엔드 테스트 결과서 작성 완료
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
[문제]
- ParticipantRegistered 이벤트 처리 시 StaleObjectStateException 발생
- 100개의 이벤트가 동시에 발행되어 EventStats 동시 업데이트 충돌
- TransactionRequiredException 발생 (트랜잭션 컨텍스트 부재)
[해결]
1. 비관적 락(Pessimistic Lock) 적용
- EventStatsRepository에 findByEventIdWithLock 메서드 추가
- PESSIMISTIC_WRITE 락으로 읽는 순간부터 다른 트랜잭션 차단
2. 트랜잭션 추가
- 모든 Consumer 메서드에 @Transactional 어노테이션 추가
- EventCreatedConsumer, ParticipantRegisteredConsumer, DistributionCompletedConsumer
3. 이벤트 발행 속도 조절
- SampleDataLoader에서 10개마다 100ms 대기
- 동시성 충돌 빈도 감소
[수정 파일]
- EventStatsRepository.java: 비관적 락 메서드 추가
- ParticipantRegisteredConsumer.java: @Transactional 추가, 락 메서드 사용
- DistributionCompletedConsumer.java: @Transactional 추가, 락 메서드 사용
- EventCreatedConsumer.java: @Transactional 추가
- SampleDataLoader.java: 이벤트 발행 속도 조절
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
변경 사항:
1. EventStats에 totalViews 필드 추가 (모든 채널 노출 수 합계)
2. DistributionCompletedEvent에 expectedViews 필드 추가
3. DistributionCompletedConsumer 개선:
- ChannelStats.impressions에 expectedViews 저장
- updateTotalViews() 메서드로 전체 노출 수 집계
4. SampleDataLoader에 채널별 예상 노출 수 설정:
- 이벤트1: 총 20,000 (우리동네TV 5K, 지니TV 10K, 링고비즈 3K, SNS 2K)
- 이벤트2: 총 14,000
- 이벤트3: 총 6,000
설계 다이어그램과 일치:
- 채널별 예상 노출 수 저장
- 총 노출 수 실시간 집계
- 멱등성 및 캐시 무효화 유지
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 다른 서비스 개발자들의 운영 토픽과 충돌 방지
- MVP용 샘플 토픽: sample.event.created, sample.participant.registered, sample.distribution.completed
- KafkaTopicConfig, SampleDataLoader, 3개 Consumer 모두 업데이트
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Analytics 5분 단위 배치 스케줄러 추가
- 초기 데이터 로딩 기능 구현 (서버 시작 30초 후)
- Redis 설정 업데이트 (외부 Redis 서버 연결)
- Redis 읽기 전용 오류 처리 추가
- IntelliJ 실행 프로파일 생성
- @EnableScheduling 활성화
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>