graph TB
    subgraph "Client Layer"
        Client[API Clients / CLI]
    end

    subgraph "API Gateway Layer"
        APIGateway[API Gateway]
    end

    subgraph "Core Services Layer"
        IAM[IAM Service]
        CreditService[Credit Service]
        Chainfire[Chainfire<br/>Cluster Coordination]
        FlareDBCore[FlareDB<br/>Distributed SQL/KV]
    end

    subgraph "Resource Abstraction Layer"
        ResourceManager[Resource Manager]
        ComputeProvider[Compute Provider]
        NetworkProvider[Network Provider]
        StorageProvider[Storage Provider]
    end

    subgraph "Resource Plugins Layer"
        Plasmavmc[Plasmavmc Plugin<br/>(Firecracker/KVM)]
        K8shost[K8shost Plugin<br/>(Kubernetes)]
        Lightningstor[Lightningstor Plugin<br/>(Block Storage)]
        Fiberlb[Fiberlb Plugin<br/>(Load Balancer)]
        Prismnet[Prismnet Plugin<br/>(SDN)]
        Flashdns[Flashdns Plugin<br/>(DNS)]
    end

    subgraph "Metrics & Monitoring"
        NightLight[NightLight Metrics]
        Observability[Prometheus / Grafana / Loki]
    end

    Client -->|HTTP/REST| APIGateway
    APIGateway -->|gRPC| IAM
    APIGateway -->|gRPC| CreditService
    APIGateway -->|gRPC| ResourceManager

    ResourceManager -->|gRPC| ComputeProvider
    ResourceManager -->|gRPC| NetworkProvider
    ResourceManager -->|gRPC| StorageProvider

    ComputeProvider -->|gRPC| Plasmavmc
    ComputeProvider -->|gRPC| K8shost

    NetworkProvider -->|gRPC| Fiberlb
    NetworkProvider -->|gRPC| Prismnet
    NetworkProvider -->|gRPC| Flashdns

    StorageProvider -->|gRPC| Lightningstor

    IAM -->|gRPC| Chainfire
    IAM -->|gRPC| FlareDBCore
    CreditService -->|gRPC| Chainfire
    CreditService -->|gRPC| FlareDBCore
    CreditService -->|gRPC| IAM

    Plasmavmc -->|gRPC| Chainfire
    Plasmavmc -->|gRPC| FlareDBCore
    K8shost -->|gRPC| Chainfire
    K8shost -->|gRPC| FlareDBCore
    Fiberlb -->|gRPC| Chainfire
    Fiberlb -->|gRPC| FlareDBCore
    Prismnet -->|gRPC| Chainfire
    Prismnet -->|gRPC| FlareDBCore
    Flashdns -->|gRPC| Chainfire
    Flashdns -->|gRPC| FlareDBCore
    Lightningstor -->|gRPC| Chainfire
    Lightningstor -->|gRPC| FlareDBCore

    subgraph "Shared Infrastructure"
        PhotonCommon[Photon Common Library]
        PhotonEvents[Photon Event Bus]
    end

    style PhotonCommon fill:#e1f5fe,stroke:#01579b,stroke-width:2px
