kt-event-marketing/design/backend/logical/logical-architecture.mmd
2025-10-21 17:38:07 +09:00

129 lines
5.7 KiB
Plaintext

graph TB
%% KT AI 기반 소상공인 이벤트 자동 생성 서비스 - 논리 아키텍처 (Context Map)
%% Client Layer
subgraph "Client Layer"
Mobile["Web/Mobile Client<br/>• React PWA<br/>• Mobile First<br/>• 반응형 디자인"]
end
%% Gateway Layer
subgraph "Gateway Layer"
Gateway["API Gateway<br/>• JWT 인증/인가<br/>• 라우팅<br/>• Rate Limiting<br/>• 중앙 로깅"]
end
%% Service Layer
subgraph "Service Layer"
UserSvc["User Service<br/>• 회원가입/로그인<br/>• 프로필 관리<br/>• 사업자번호 검증"]
EventSvc["Event Service<br/>• 이벤트 CRUD<br/>• 플로우 오케스트레이션<br/>• 상태 관리"]
AISvc["AI Service<br/>• 트렌드 분석<br/>• 3가지 이벤트 추천<br/>• 비동기 Job 처리"]
ContentSvc["Content Service<br/>• SNS 이미지 생성<br/>• 3가지 스타일<br/>• 비동기 Job 처리"]
DistSvc["Distribution Service<br/>• 다중 채널 배포<br/>• Circuit Breaker<br/>• 배포 모니터링"]
PartSvc["Participation Service<br/>• 이벤트 참여<br/>• 참여자 관리<br/>• 당첨자 추첨"]
AnalSvc["Analytics Service<br/>• 실시간 대시보드<br/>• 채널별 성과<br/>• ROI 분석"]
end
%% Data Layer
subgraph "Data Layer"
Cache["Redis Cache<br/>• 세션 정보<br/>• AI 추천 결과 (24h)<br/>• 이미지 URL (7d)<br/>• 대시보드 데이터 (5m)"]
Queue["Message Queue<br/>• AI 작업 큐<br/>• 이미지 생성 큐<br/>• 배포 작업 큐"]
UserDB["User DB<br/>• users<br/>• stores"]
EventDB["Event DB<br/>• events<br/>• distribution_logs"]
PartDB["Participation DB<br/>• participants<br/>• winners"]
AnalDB["Analytics DB<br/>• event_stats<br/>• channel_stats"]
end
%% External APIs
subgraph "External APIs"
TaxAPI["국세청 API<br/>사업자번호 검증"]
ClaudeAPI["Claude/GPT-4 API<br/>AI 트렌드 분석<br/>이벤트 추천"]
SDAPI["Stable Diffusion<br/>DALL-E API<br/>이미지 생성"]
UriAPI["우리동네TV API<br/>영상 배포"]
RingoAPI["링고비즈 API<br/>연결음 업데이트"]
GenieAPI["지니TV API<br/>TV 광고"]
SNSAPI["SNS APIs<br/>Instagram<br/>Naver<br/>Kakao"]
end
%% Client to Gateway (단일 연결)
Mobile -->|HTTPS| Gateway
%% Gateway to Services (동기)
Gateway -->|인증/프로필| UserSvc
Gateway -->|이벤트 관리| EventSvc
Gateway -->|참여자 관리| PartSvc
Gateway -->|성과 분석| AnalSvc
%% Event Service Dependencies
EventSvc -.->|"[Event]AI 추천 요청<br/>(Job 생성)"| Queue
Queue -.->|비동기 작업 처리| AISvc
EventSvc -.->|"[Event]이미지 생성 요청<br/>(Job 생성)"| Queue
Queue -.->|비동기 작업 처리| ContentSvc
EventSvc -->|배포 시작| DistSvc
%% AI Service Dependencies
AISvc -.->|"AI 추천 캐싱<br/>(Cache-Aside, 24h)"| Cache
AISvc -->|"트렌드 분석<br/>이벤트 추천<br/>(Circuit Breaker)"| ClaudeAPI
%% Content Service Dependencies
ContentSvc -.->|"이미지 URL 캐싱<br/>(Cache-Aside, 7d)"| Cache
ContentSvc -->|"이미지 생성<br/>(Circuit Breaker)"| SDAPI
%% Distribution Service Dependencies
DistSvc -->|"영상 배포<br/>(Circuit Breaker)"| UriAPI
DistSvc -->|"연결음 업데이트<br/>(Circuit Breaker)"| RingoAPI
DistSvc -->|"TV 광고<br/>(Circuit Breaker)"| GenieAPI
DistSvc -->|"SNS 자동 포스팅<br/>(Circuit Breaker)"| SNSAPI
%% User Service Dependencies
UserSvc -.->|세션 관리| Cache
UserSvc -.->|"사업자번호 캐싱<br/>(Cache-Aside, 7d)"| Cache
UserSvc -->|"사업자번호 검증<br/>(Circuit Breaker)"| TaxAPI
UserSvc -.->|사용자 정보| UserDB
%% Event Service Database
EventSvc -.->|이벤트 정보| EventDB
%% Participation Service Dependencies
PartSvc -.->|참여자 데이터| PartDB
PartSvc -->|이벤트 정보 조회| EventSvc
%% Analytics Service Dependencies
AnalSvc -.->|"대시보드 캐싱<br/>(Cache-Aside, 5m)"| Cache
AnalSvc -.->|통계 데이터| AnalDB
AnalSvc -->|이벤트 정보| EventSvc
AnalSvc -->|참여자 데이터| PartSvc
AnalSvc -->|배포 통계| DistSvc
AnalSvc -->|"채널별 노출 수<br/>(Circuit Breaker)"| UriAPI
AnalSvc -->|"채널별 노출 수<br/>(Circuit Breaker)"| GenieAPI
AnalSvc -->|"SNS 통계<br/>(Circuit Breaker)"| SNSAPI
%% Styling
classDef client fill:#BFDBFE,stroke:#3B82F6,stroke-width:2px
classDef gateway fill:#2E86AB,stroke:#1E3A8A,stroke-width:2px,color:#fff
classDef user fill:#4ECDC4,stroke:#14B8A6,stroke-width:2px
classDef event fill:#F18F01,stroke:#F97316,stroke-width:2px
classDef ai fill:#10B981,stroke:#059669,stroke-width:2px
classDef content fill:#8B5CF6,stroke:#7C3AED,stroke-width:2px,color:#fff
classDef dist fill:#EC4899,stroke:#DB2777,stroke-width:2px,color:#fff
classDef part fill:#F59E0B,stroke:#F97316,stroke-width:2px
classDef anal fill:#06B6D4,stroke:#0891B2,stroke-width:2px
classDef cache fill:#FCD34D,stroke:#F59E0B,stroke-width:2px
classDef queue fill:#FB923C,stroke:#EA580C,stroke-width:2px
classDef db fill:#A78BFA,stroke:#8B5CF6,stroke-width:2px,color:#fff
classDef external fill:#E5E7EB,stroke:#9CA3AF,stroke-width:2px
class Mobile client
class Gateway gateway
class UserSvc user
class EventSvc event
class AISvc ai
class ContentSvc content
class DistSvc dist
class PartSvc part
class AnalSvc anal
class Cache cache
class Queue queue
class UserDB,EventDB,PartDB,AnalDB db
class TaxAPI,ClaudeAPI,SDAPI,UriAPI,RingoAPI,GenieAPI,SNSAPI external