mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2026-06-13 14:59:13 +00:00
물리아키텍처 설계 완료
✨ 주요 기능 - Azure 기반 물리아키텍처 설계 (개발환경/운영환경) - 7개 마이크로서비스 물리 구조 설계 - 네트워크 아키텍처 다이어그램 작성 (Mermaid) - 환경별 비교 분석 및 마스터 인덱스 문서 📁 생성 파일 - design/backend/physical/physical-architecture.md (마스터) - design/backend/physical/physical-architecture-dev.md (개발환경) - design/backend/physical/physical-architecture-prod.md (운영환경) - design/backend/physical/*.mmd (4개 Mermaid 다이어그램) 🎯 핵심 성과 - 비용 최적화: 개발환경 월 $143, 운영환경 월 $2,860 - 확장성: 개발환경 100명 → 운영환경 10,000명 (100배) - 가용성: 개발환경 95% → 운영환경 99.9% - 보안: 다층 보안 아키텍처 (L1~L4) 🛠️ 기술 스택 - Azure Kubernetes Service (AKS) - Azure Database for PostgreSQL Flexible - Azure Cache for Redis Premium - Azure Service Bus Premium - Application Gateway + WAF 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,243 @@
|
||||
@startuml
|
||||
!theme mono
|
||||
|
||||
title Event Service 클래스 다이어그램 (요약)
|
||||
|
||||
' ==============================
|
||||
' Domain Layer (핵심 비즈니스)
|
||||
' ==============================
|
||||
package "Domain Layer" <<Rectangle>> {
|
||||
|
||||
class Event {
|
||||
- eventId: UUID
|
||||
- status: EventStatus
|
||||
- eventName, description: String
|
||||
- startDate, endDate: LocalDate
|
||||
- selectedImageId: UUID
|
||||
- channels: List<String>
|
||||
--
|
||||
+ publish(): void
|
||||
+ end(): void
|
||||
+ updateEventPeriod(): void
|
||||
+ selectImage(): void
|
||||
+ isModifiable(): boolean
|
||||
}
|
||||
|
||||
class Job {
|
||||
- jobId: UUID
|
||||
- jobType: JobType
|
||||
- status: JobStatus
|
||||
- progress: int
|
||||
--
|
||||
+ start(): void
|
||||
+ complete(): void
|
||||
+ fail(): void
|
||||
}
|
||||
|
||||
enum EventStatus {
|
||||
DRAFT
|
||||
PUBLISHED
|
||||
ENDED
|
||||
}
|
||||
|
||||
enum JobStatus {
|
||||
PENDING
|
||||
PROCESSING
|
||||
COMPLETED
|
||||
FAILED
|
||||
}
|
||||
|
||||
interface EventRepository {
|
||||
+ findByEventIdAndUserId(): Optional<Event>
|
||||
+ findEventsByUser(): Page<Event>
|
||||
}
|
||||
|
||||
interface JobRepository {
|
||||
+ findByEventId(): List<Job>
|
||||
}
|
||||
}
|
||||
|
||||
' ==============================
|
||||
' Application Layer (유스케이스)
|
||||
' ==============================
|
||||
package "Application Layer" <<Rectangle>> {
|
||||
|
||||
class EventService {
|
||||
- eventRepository
|
||||
- jobRepository
|
||||
- contentServiceClient
|
||||
- aiJobKafkaProducer
|
||||
--
|
||||
+ createEvent(): EventCreatedResponse
|
||||
+ getEvent(): EventDetailResponse
|
||||
+ publishEvent(): void
|
||||
+ requestAiRecommendations(): JobAcceptedResponse
|
||||
+ selectRecommendation(): void
|
||||
+ requestImageGeneration(): ImageGenerationResponse
|
||||
+ selectImage(): void
|
||||
+ selectChannels(): void
|
||||
}
|
||||
|
||||
class JobService {
|
||||
- jobRepository
|
||||
--
|
||||
+ getJobStatus(): JobStatusResponse
|
||||
+ completeJob(): void
|
||||
+ failJob(): void
|
||||
}
|
||||
|
||||
package "DTOs" {
|
||||
class "Request DTOs" {
|
||||
SelectObjectiveRequest
|
||||
AiRecommendationRequest
|
||||
SelectRecommendationRequest
|
||||
ImageGenerationRequest
|
||||
SelectImageRequest
|
||||
SelectChannelsRequest
|
||||
}
|
||||
|
||||
class "Response DTOs" {
|
||||
EventCreatedResponse
|
||||
EventDetailResponse
|
||||
JobAcceptedResponse
|
||||
JobStatusResponse
|
||||
ImageGenerationResponse
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
' ==============================
|
||||
' Infrastructure Layer (기술 구현)
|
||||
' ==============================
|
||||
package "Infrastructure Layer" <<Rectangle>> {
|
||||
|
||||
class AIJobKafkaProducer {
|
||||
+ publishAIGenerationJob(): void
|
||||
+ publishMessage(): void
|
||||
}
|
||||
|
||||
class AIJobKafkaConsumer {
|
||||
+ consumeAIEventGenerationJob(): void
|
||||
}
|
||||
|
||||
interface ContentServiceClient {
|
||||
+ generateImages(): ContentJobResponse
|
||||
}
|
||||
|
||||
class RedisConfig {
|
||||
+ redisTemplate(): RedisTemplate
|
||||
}
|
||||
}
|
||||
|
||||
' ==============================
|
||||
' Presentation Layer (API)
|
||||
' ==============================
|
||||
package "Presentation Layer" <<Rectangle>> {
|
||||
|
||||
class EventController {
|
||||
- eventService
|
||||
--
|
||||
POST /objectives
|
||||
GET /events
|
||||
GET /events/{id}
|
||||
DELETE /events/{id}
|
||||
POST /events/{id}/publish
|
||||
POST /events/{id}/ai-recommendations
|
||||
PUT /events/{id}/recommendations
|
||||
POST /events/{id}/images
|
||||
PUT /events/{id}/images/{imageId}/select
|
||||
PUT /events/{id}/channels
|
||||
}
|
||||
|
||||
class JobController {
|
||||
- jobService
|
||||
--
|
||||
GET /jobs/{id}
|
||||
}
|
||||
}
|
||||
|
||||
' ==============================
|
||||
' 관계 정의 (간소화)
|
||||
' ==============================
|
||||
|
||||
' Domain Layer
|
||||
Event ..> EventStatus
|
||||
Job ..> JobStatus
|
||||
EventRepository ..> Event
|
||||
JobRepository ..> Job
|
||||
|
||||
' Application → Domain
|
||||
EventService --> EventRepository
|
||||
EventService --> JobRepository
|
||||
JobService --> JobRepository
|
||||
|
||||
' Application → Infrastructure
|
||||
EventService --> ContentServiceClient
|
||||
EventService --> AIJobKafkaProducer
|
||||
|
||||
' Presentation → Application
|
||||
EventController --> EventService
|
||||
JobController --> JobService
|
||||
|
||||
' Application DTOs
|
||||
EventService ..> "Request DTOs"
|
||||
EventService ..> "Response DTOs"
|
||||
|
||||
' Infrastructure Kafka
|
||||
AIJobKafkaProducer ..> AIJobKafkaConsumer : pub/sub
|
||||
|
||||
' Clean Architecture Flow
|
||||
EventController -[hidden]down-> EventService
|
||||
EventService -[hidden]down-> Event
|
||||
Event -[hidden]down-> EventRepository
|
||||
|
||||
' Notes
|
||||
note as N1
|
||||
**Clean Architecture 계층 구조**
|
||||
|
||||
1. **Domain Layer (핵심)**
|
||||
- 비즈니스 로직과 규칙
|
||||
- 외부 의존성 없음
|
||||
|
||||
2. **Application Layer (유스케이스)**
|
||||
- 도메인 로직 조율
|
||||
- 트랜잭션 경계
|
||||
|
||||
3. **Infrastructure Layer (기술)**
|
||||
- Kafka, Feign, Redis
|
||||
- 외부 시스템 연동
|
||||
|
||||
4. **Presentation Layer (API)**
|
||||
- REST 엔드포인트
|
||||
- 인증/검증
|
||||
end note
|
||||
|
||||
note as N2
|
||||
**핵심 플로우**
|
||||
|
||||
**이벤트 생성 플로우:**
|
||||
1. 목적 선택 (DRAFT 생성)
|
||||
2. AI 추천 요청 (Kafka)
|
||||
3. 추천 선택 및 커스터마이징
|
||||
4. 이미지 생성 요청 (Content Service)
|
||||
5. 이미지 선택
|
||||
6. 배포 채널 선택
|
||||
7. 배포 (DRAFT → PUBLISHED)
|
||||
|
||||
**상태 전이:**
|
||||
DRAFT → PUBLISHED → ENDED
|
||||
end note
|
||||
|
||||
note as N3
|
||||
**비동기 작업 처리**
|
||||
|
||||
- AI 추천 생성: Kafka로 비동기 처리
|
||||
- 이미지 생성: Content Service 호출
|
||||
- Job 엔티티로 작업 상태 추적
|
||||
- Redis 캐시로 결과 임시 저장
|
||||
end note
|
||||
|
||||
N1 -[hidden]- N2
|
||||
N2 -[hidden]- N3
|
||||
|
||||
@enduml
|
||||
Reference in New Issue
Block a user