> ## Documentation Index
> Fetch the complete documentation index at: https://docs.555hyper.link/llms.txt
> Use this file to discover all available pages before exploring further.

# System Map

> How the pieces fit together

# Architecture Overview

The 555 Ecosystem is a complex interplay of an-chain and off-chain components.

<img src="https://mintcdn.com/rendernetwork/rNt1kOjgG6LMYX32/images/system-map.jpeg?fit=max&auto=format&n=rNt1kOjgG6LMYX32&q=85&s=56ba98565f5130bd478c4a5a8c29c987" alt="System Blueprint" width="2816" height="1536" data-path="images/system-map.jpeg" />

## The Full Stack

```mermaid theme={null}
graph TD
    subgraph Client [Client Layer]
        Browser[Next.js App]
        Game[Phaser Engine]
        Wallet[Phantom/Backpack]
    end

    subgraph Edge [Edge Layer]
        VAP_WSS[VAP WebSocket]
        API_GW[API Gateway]
        CDN[Cloudflare]
    end

    subgraph Backend [Service Layer]
        VAP_Svc[VAP Verifier]
        AGG_Svc[AGG Router]
        Alice[Pippins Agent]
        DB[(Postgres)]
        Redis[(Redis)]
    end

    subgraph Blockchain [Solana Layer]
        Prog_Escrow[VAP Escrow Program]
        Prog_Router[AGG Router Program]
        Prog_Bubblegum[Metaplex Bubblegum]
    end

    %% Connections
    Browser -->|HTTPS| CDN
    CDN -->|HTTPS| API_GW
    Game -->|WSS| VAP_WSS
    
    VAP_WSS -->|Events| VAP_Svc
    VAP_Svc -->|State| Redis
    VAP_Svc -->|Persist| DB
    
    API_GW -->|Route| AGG_Svc
    AGG_Svc -->|Query| DB
    
    Alice -->|Read| DB
    Alice -->|Read| Redis
    Alice -->|Post| API_GW
    
    VAP_Svc -->|Settle| Prog_Escrow
    VAP_Svc -->|Mint| Prog_Bubblegum
    AGG_Svc -->|Swap/Transfer| Prog_Router
```

## Data Flow: The "Kill Enemy" Event

Trace a single user action through the system:

1. **Client**: User kills an enemy in Sector 13.
2. **Game Engine**: Emits `{ type: "ENEMY_KILL", id: "mob_01", score: 100 }`.
3. **VAP SDK**: Hashes this event into the current `InputBlock`.
4. **VAP SDK**: Signs the block with the Session Key.
5. **WebSocket**: Sends `PULSE` packet to VAP Verifier.
6. **Verifier**:
   * Verifies Signature.
   * Checks Nonce sequence.
   * Updates `SessionState` in Redis (`score += 100`).
7. **Persistence**: Every 60 seconds, Redis state is flushed to Postgres.
8. **Settlement**: When the session ends, Verifier submits `settle_session` to Solana.
9. **Blockchain**:
   * `vap_escrow` transfers 100 \$555 to User.
   * `bubblegum` mints "Session Log" cNFT to Creator.
