graph TB
%% KT AI 기반 소상공인 이벤트 자동 생성 서비스 - 논리 아키텍처 (Event-Driven + Kafka)
%% Services
subgraph "Services"
UserSvc["User Service
• 회원가입/로그인
• 프로필 관리
• 사업자번호 검증
[Circuit Breaker]"]
EventSvc["Event Service
• 이벤트 생성/수정/삭제
• 플로우 오케스트레이션
• AI/이미지 작업 요청
• 배포 작업 요청"]
PartSvc["Participation
Service
• 참여 접수
• 당첨자 추첨"]
AnalSvc["Analytics Service
• 실시간 대시보드
• 성과 분석
• 채널별 통계
[Circuit Breaker]"]
end
%% Async Services
subgraph "Async Services"
AISvc["AI Service
• 트렌드 분석
• 이벤트 추천
[Circuit Breaker]
[Timeout: 30s]"]
ContentSvc["Content Service
• SNS 이미지 생성
• 3가지 스타일
[Circuit Breaker]
[Timeout: 20s]"]
DistSvc["Distribution
Service
• 다중 채널 배포
[Circuit Breaker]
[Retry: 3회]
[Bulkhead]"]
end
%% Kafka (Event Bus + Job Queue)
Kafka["Kafka
━━━━━━━━━━
• EventCreated
• ParticipantRegistered
• WinnerSelected
• DistributionCompleted
━━━━━━━━━━
• ai 이벤트 생성
• 이미지 생성"]
%% External System
External["외부시스템
[Circuit Breaker]
━━━━━━━━━━
• 국세청 API
• AI API
• 이미지 생성 API
• 배포 채널 APIs
(비동기)"]
%% Event Publishing
EventSvc ==>|"EventCreated
발행"| Kafka
PartSvc ==>|"ParticipantRegistered
발행"| Kafka
PartSvc ==>|"WinnerSelected
발행"| Kafka
DistSvc ==>|"DistributionCompleted
발행"| Kafka
%% Job Publishing (비동기 작업 요청)
EventSvc -->|"ai 이벤트 생성 발행"| Kafka
EventSvc -->|"이미지 생성 발행"| Kafka
%% Event Subscription
Kafka -.->|"EventCreated
구독"| AnalSvc
Kafka -.->|"ParticipantRegistered
구독"| AnalSvc
Kafka -.->|"DistributionCompleted
구독"| AnalSvc
%% Job Subscription
Kafka -.->|"ai 이벤트 생성 구독"| AISvc
Kafka -.->|"이미지 생성 구독"| ContentSvc
%% Service to Service (동기 호출)
EventSvc -->|"다중 채널 배포
[Circuit Breaker]"| DistSvc
%% Services to External (Resilience 패턴)
UserSvc -->|"사업자번호 검증
[Retry: 3회]"| External
AISvc -->|"트렌드 분석/추천"| External
ContentSvc -->|"이미지 생성"| External
DistSvc -->|"다중 채널 배포
(비동기)"| External
AnalSvc -->|"채널별 통계
[Fallback: Cache]"| External
%% Styling
classDef service fill:#4ECDC4,stroke:#14B8A6,stroke-width:3px
classDef async fill:#8B5CF6,stroke:#7C3AED,stroke-width:3px,color:#fff
classDef kafka fill:#F59E0B,stroke:#D97706,stroke-width:3px
classDef external fill:#E5E7EB,stroke:#9CA3AF,stroke-width:2px
class UserSvc,EventSvc,PartSvc,AnalSvc service
class AISvc,ContentSvc,DistSvc async
class Kafka kafka
class External external