flowchart LR
    subgraph Inputs["Data Inputs"]
        OT["OtOpcUa<br/>Equipment NS"]
        SP["OtOpcUa<br/>System Platform NS"]
        API_IN["Inbound Web API<br/>(API key auth)"]
    end

    subgraph ScadaBridge["ScadaBridge Cluster (per site)"]
        direction TB
        TPL["Templates<br/>(central DB → site push)"]
        SCR["Scripts<br/>(C# Roslyn)"]
        SAF["Store & Forward<br/>(per-call, optional)"]
        subgraph Internals["Akka.NET Runtime"]
            SUP["Supervision<br/>(self-healing)"]
            CLST["2-node cluster<br/>(~25s failover)"]
        end
    end

    subgraph Outputs["Integration Targets"]
        RED["Redpanda EventHub<br/>(committed, Year 1)"]
        API["External Web APIs<br/>(pre-configured, generic)"]
        DB["SQL Server<br/>(batch tracking)"]
        NOT["Email Notifications<br/>(contact-list driven)"]
        EQ["Equipment Writes<br/>(OPC UA via OtOpcUa)"]
        CAM["Camstar MES<br/>(direct Web API)"]
        DEL["Delmia DNC<br/>(direct Web API)"]
    end

    OT --> SCR
    SP --> SCR
    API_IN --> SCR
    TPL --> SCR
    SCR --> SAF
    SAF --> RED
    SAF --> API
    SAF --> DB
    SAF --> NOT
    SCR --> EQ
    SCR --> CAM
    SCR --> DEL
