350%
graph TB
    %% ── Layer 1: External ──
    USER["🎮 WellPlayed — Utilisateur"]
    RIOT["🔴 Riot API\naccount-v1 · league-v4\nsummoner-v4 · match-v5"]
    STRIPE["💳 Stripe API\nCheckout · Webhooks\nSubscriptions · Billing"]
    SMTP["📧 SMTP Hostinger\nwellplay@wellplayed.lol"]
    DISCORD["💬 Discord\nWebhook"]

    %% ── Layer 2: Reverse Proxy ──
    subgraph CADDY["☁️ Caddy — HTTPS / Let's Encrypt"]
        direction LR
        HTTPS1["wellplayed-api.cloud :443"]
        HTTPS2["palantir.wellplayed-api.cloud :443"]
    end

    %% ── Layer 3: Gateway + Admin ──
    subgraph DOCKER["🐳 Docker Network — wellplayed-net"]
        direction TB

        GATE["⚡ WellPlayedGate :8200\nBFF · Auth · Proxy · Composed Routes"]

        subgraph ADMIN["🔧 Admin"]
            direction LR
            PAL["🟠 Palantir :8400\nInterface Admin"]
        end

        %% ── Layer 4: Services ──
        subgraph SVC["📦 Microservices"]
            direction LR
            NEX["Nexus :8250\nPlayer Resolution\ngameName#tag → PUUID"]
            RG["RiotGate :8100\nMatch Sync\n3 Filters · 50 matchs"]
            SEN["Sensei :8300\nMedia Management\nVideos · Puzzles"]
            PB["Pip-Boy :3020\nGamification\nXP · WP · Quests\nShop · Streaks"]
            SB["SecureBag :3040\nSubscriptions\nPlans · Promo Codes"]
            NAVI["Navi :8600\nCommunication\nEmail · Discord\nContacts · Broadcast"]
        end

        %% ── Layer 5: Databases ──
        subgraph DBS["🗄️ PostgreSQL 16"]
            direction LR
            D_NEX[("nexus-db")]
            D_RG[("riotgate-db")]
            D_SEN[("sensei-db")]
            D_PB[("pipboy-db")]
            D_SB[("securebag-db")]
            D_NAVI[("navi-db")]
        end
    end

    %% ── Connections: User → Caddy ──
    USER -->|HTTPS| HTTPS1
    USER -.->|HTTPS| HTTPS2

    %% ── Caddy → Internal ──
    HTTPS1 --> GATE
    HTTPS2 --> PAL
    PAL -->|"/api/gate/*"| GATE

    %% ── Gateway → Services ──
    GATE -->|"/nexus"| NEX
    GATE -->|"/riotgate"| RG
    GATE -->|"/sensei"| SEN
    GATE -->|"/gamification"| PB
    GATE -->|"/billing"| SB
    GATE -->|"/navi"| NAVI

    %% ── Services → Databases ──
    NEX --> D_NEX
    RG --> D_RG
    SEN --> D_SEN
    PB --> D_PB
    SB --> D_SB
    NAVI --> D_NAVI

    %% ── Services → External APIs ──
    NEX -->|"Riot API"| RIOT
    RG -->|"Riot API"| RIOT
    SB -->|"Stripe API"| STRIPE
    NAVI -->|"SMTP"| SMTP
    NAVI -->|"Webhook"| DISCORD

    %% ── Styles ──
    classDef external fill:#1a1a2e,stroke:var(--primary-500),stroke-width:3px,color:#f5f5f5
    classDef caddy fill:#0f3d0f,stroke:#4ade80,stroke-width:3px,color:#f5f5f5
    classDef gate fill:#1e3a5f,stroke:#3b82f6,stroke-width:3px,color:#f5f5f5
    classDef admin fill:#3d1f00,stroke:var(--primary-500),stroke-width:3px,color:#f5f5f5
    classDef svc fill:#1a1a2e,stroke:#8b5cf6,stroke-width:3px,color:#f5f5f5
    classDef securebag fill:#0a2a3d,stroke:#06b6d4,stroke-width:3px,color:#f5f5f5
    classDef navi fill:#0a2a3d,stroke:#22d3ee,stroke-width:3px,color:#f5f5f5
    classDef db fill:#1c1c1c,stroke:#fbbf24,stroke-width:3px,color:#f5f5f5

    class USER,RIOT,STRIPE,SMTP,DISCORD external
    class HTTPS1,HTTPS2 caddy
    class GATE gate
    class PAL admin
    class NEX,RG,SEN,PB svc
    class SB securebag
    class NAVI navi
    class D_NEX,D_RG,D_SEN,D_PB,D_SB,D_NAVI db
        
Externe (User / Riot / Stripe / SMTP / Discord)
Caddy (HTTPS)
WellPlayedGate (BFF)
Microservices
SecureBag (Stripe)
Navi (Communication)
PostgreSQL