# nbcamp-week7-team6/cinema-seat-bandit architecture

> Architecture diagram of the GitHub repository nbcamp-week7-team6/cinema-seat-bandit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nbcamp-week7-team6/cinema-seat-bandit
- Repository: https://github.com/nbcamp-week7-team6/cinema-seat-bandit

## Overview

##### Project type and purpose
- From the name “cinema-seat-bandit” and the minimal README, we infer this is intended to be a cinema seat‐booking (or seat‐allocation) system. It likely provides users with a UI to select seats, a backend to enforce seat availability rules, and integrations (e.g., payments, notifications).

##### File structure
- At present the repo only contains a `.github/` folder (issue and PR templates) plus `.gitignore` and `README.md`.
- The absence of `src/`, `frontend/`, `backend/` or other code folders means you’re at project inception—there’s no concrete implementation yet.
- The presence of GitHub templates implies an open‐source project mindset with contribution workflows baked in.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        CDN["CDN"]:::infra
        UI["Web & Mobile UI"]:::frontend
    end

    %% API Layer
    subgraph "API Layer"
        direction TB
        LB["Load Balancer"]:::infra
        API_GATEWAY["API Gateway / Reverse Proxy"]:::backend
        AuthSvc["Authentication Service"]:::backend
    end

    %% Services Layer
    subgraph "Services"
        direction TB
        SeatSvc["Seat-Allocation Service"]:::backend
        UserSvc["User/Profile Service"]:::backend
        PaymentSvc["Payment Service"]:::backend
    end

    %% Data Layer
    subgraph "Data Stores"
        direction TB
        Postgres["PostgreSQL (Bookings, Users, Layouts)"]:::database
        Redis["Redis Cache (Seat Availability)"]:::cache
    end

    %% Async & Messaging
    subgraph "Async & Messaging"
        direction TB
        Broker["Message Broker (RabbitMQ/Kafka)"]:::queue
        NotifWorker["Notification Worker"]:::backend
    end

    %% External Services
    subgraph "External Integrations"
        direction TB
        PaymentGW["Payment Gateway"]:::external
        EmailSMS["Email/SMS Provider"]:::external
        Observability["Monitoring / Logging"]:::external
    end

    %% Infrastructure
    subgraph "Infra & Orchestration"
        direction TB
        K8s["Kubernetes Cluster"]:::infra
        Docker["Docker Containers"]:::infra
    end

    %% Connections
    UI -->|loads via HTTP/HTTPS| CDN
    CDN -->|forwards request| LB
    LB -->|routes| API_GATEWAY
    API_GATEWAY -->|auth token| AuthSvc
    API_GATEWAY -->|REST/gRPC| SeatSvc
    API_GATEWAY -->|REST/gRPC| UserSvc
    API_GATEWAY -->|REST/gRPC| PaymentSvc

    SeatSvc -->|SQL queries| Postgres
    SeatSvc -->|cache-aside GET/SET| Redis
    SeatSvc -->|publish AMQP/Kafka| Broker

    UserSvc -->|SQL queries| Postgres
    PaymentSvc -->|external API| PaymentGW

    Broker -->|subscribe| NotifWorker
    NotifWorker -->|send via SMTP/API| EmailSMS

    Postgres -->|backup/monitor| Observability
    Redis -->|metrics| Observability
    API_GATEWAY -->|logs/metrics| Observability
    SeatSvc -->|logs/metrics| Observability
    UserSvc -->|logs/metrics| Observability
    PaymentSvc -->|logs/metrics| Observability
    NotifWorker -->|logs/metrics| Observability

    %% Infra relationships
    API_GATEWAY -->|deployed on| Docker
    AuthSvc -->|deployed on| Docker
    SeatSvc -->|deployed on| Docker
    UserSvc -->|deployed on| Docker
    PaymentSvc -->|deployed on| Docker
    NotifWorker -->|deployed on| Docker
    Docker -->|orchestrated by| K8s

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef database fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef cache fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef queue fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px;
    classDef infra fill:#E6E6FA,stroke:#000,stroke-width:1px;
```
