FrontEnd

BackEnd

DB

그 외

시스템 아키텍처 설계

graph TD
    %% 스타일 정의
    classDef client fill:#E3F2FD,stroke:#2196F3,stroke-width:2px,color:black;
    classDef gateway fill:#E8F5E9,stroke:#4CAF50,stroke-width:2px,color:black;
    classDef module fill:#FFF3E0,stroke:#FF9800,stroke-width:2px,color:black;
    classDef storage fill:#F3E5F5,stroke:#9C27B0,stroke-width:2px,color:black;

    %% 1. 클라이언트 계층
    subgraph ClientLayer ["User & Client"]
        Client["💻 Web Client<br/>(React + Vite)"]:::client
        User(("User")) --> Client
    end

    %% 2. API 게이트웨이 & 백엔드 (NestJS Monolith)
    subgraph BackendLayer ["Backend Server (NestJS)"]
        Gateway["🛡️ API Gateway / Guard<br/>(Auth, Rate Limit, Queue Token Check)"]:::gateway
        
        %% 모듈들 (서비스 로직)
        subgraph Services ["Application Modules"]
            QueueSvc["⏳ Queue Module<br/>(대기열 관리)"]:::module
            ReservationSvc["🎫 Reservation Module<br/>(좌석 선점 = 예매 확정)"]:::module
            AgentSvc["Agent Module<br/>(가상 봇 관)"]:::module
            
        end
    end

    %% 3. 데이터 계층
    subgraph DataLayer ["Persistence & Cache"]
        Redis[("Redis<br/>In-Memory")]:::storage
        DB[("PostgreSQL<br/>Disk DB")]:::storage
    end

    %% 연결 관계
    Client -- "HTTPS" --> Gateway
    
    Gateway --> QueueSvc
    Gateway --> ReservationSvc

    %% 대기열 로직
    QueueSvc -- "대기열 등록/순번확인" --> Redis

    %% 예약 로직 (결제 없이 즉시 확정)
    ReservationSvc -- "1. 좌석 선점 (SETNX)" --> Redis
    ReservationSvc -- "2. 예매 내역 저장 (Insert)" --> DB

    %% 봇 로직
    AgentSvc -- "가상 예매 시도" --> Redis

    %% 데이터 흐름 주석
    linkStyle default stroke-width:2px,fill:none,stroke:333;

기능 설계

보안 문자

서버에서 생성한 보안 문자를 토대로 이미지를 만들어 클라이언트에 반환. 보안 문자 검증은 서버에서 진행