Skip to main content

assets/gateway_architecture.svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 420">
  <defs>
    <linearGradient id="clientGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#e8f5e9"/>
      <stop offset="100%" style="stop-color:#c8e6c9"/>
    </linearGradient>
    <linearGradient id="gaterGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#fff3e0"/>
      <stop offset="100%" style="stop-color:#ffe0b2"/>
    </linearGradient>
    <linearGradient id="nodeGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#e3f2fd"/>
      <stop offset="100%" style="stop-color:#bbdefb"/>
    </linearGradient>
    <linearGradient id="workerGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#fce4ec"/>
      <stop offset="100%" style="stop-color:#f8bbd9"/>
    </linearGradient>
    <linearGradient id="storeGrad" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#e1bee7"/>
      <stop offset="100%" style="stop-color:#ce93d8"/>
    </linearGradient>
    <marker id="arrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto" markerUnits="strokeWidth">
      <path d="M0,0 L0,6 L9,3 z" fill="#666"/>
    </marker>
  </defs>

  <!-- Title -->
  <text x="325" y="20" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Gateway Architecture</text>

  <!-- Client Applications -->
  <rect x="75" y="35" width="500" height="55" rx="8" fill="url(#clientGrad)" stroke="#4caf50" stroke-width="2"/>
  <text x="325" y="55" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#2e7d32">Client Applications</text>
  <text x="325" y="78" text-anchor="middle" font-family="monospace" font-size="9" fill="#388e3c">esdb_gater_api:append_events(my_store, StreamId, Events)</text>

  <!-- Arrow down -->
  <line x1="325" y1="90" x2="325" y2="115" stroke="#666" stroke-width="2" marker-end="url(#arrow)"/>

  <!-- reckon-gater -->
  <rect x="75" y="120" width="500" height="70" rx="8" fill="url(#gaterGrad)" stroke="#ff9800" stroke-width="2"/>
  <text x="325" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e65100">reckon-gater</text>

  <!-- Internal components -->
  <rect x="100" y="150" width="120" height="30" rx="4" fill="#fff8e1" stroke="#ffa000"/>
  <text x="160" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f57c00">pg Worker Registry</text>

  <rect x="240" y="150" width="120" height="30" rx="4" fill="#fff8e1" stroke="#ffa000"/>
  <text x="300" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f57c00">Load Balancer</text>

  <rect x="380" y="150" width="100" height="30" rx="4" fill="#fff8e1" stroke="#ffa000"/>
  <text x="430" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f57c00">PubSub</text>

  <rect x="490" y="150" width="70" height="30" rx="4" fill="#fff8e1" stroke="#ffa000"/>
  <text x="525" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f57c00">Retry</text>

  <!-- Arrow down with branches -->
  <line x1="325" y1="190" x2="325" y2="210" stroke="#666" stroke-width="2"/>
  <text x="325" y="225" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">routes to registered workers</text>
  <line x1="110" y1="235" x2="540" y2="235" stroke="#666" stroke-width="2"/>
  <line x1="110" y1="235" x2="110" y2="260" stroke="#666" stroke-width="2" marker-end="url(#arrow)"/>
  <line x1="325" y1="235" x2="325" y2="260" stroke="#666" stroke-width="2" marker-end="url(#arrow)"/>
  <line x1="540" y1="235" x2="540" y2="260" stroke="#666" stroke-width="2" marker-end="url(#arrow)"/>

  <!-- Node 1 -->
  <rect x="30" y="265" width="160" height="140" rx="6" fill="url(#nodeGrad)" stroke="#2196f3" stroke-width="2"/>
  <text x="110" y="285" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#1565c0">Node 1</text>

  <rect x="45" y="295" width="130" height="30" rx="4" fill="url(#workerGrad)" stroke="#e91e63"/>
  <text x="110" y="315" text-anchor="middle" font-family="monospace" font-size="9" fill="#ad1457">gateway_worker</text>

  <rect x="45" y="335" width="130" height="55" rx="4" fill="url(#storeGrad)" stroke="#9c27b0"/>
  <text x="110" y="355" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#7b1fa2">Khepri/Ra</text>
  <text x="110" y="375" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#8e24aa">Event Store</text>

  <!-- Node 2 -->
  <rect x="245" y="265" width="160" height="140" rx="6" fill="url(#nodeGrad)" stroke="#2196f3" stroke-width="2"/>
  <text x="325" y="285" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#1565c0">Node 2</text>

  <rect x="260" y="295" width="130" height="30" rx="4" fill="url(#workerGrad)" stroke="#e91e63"/>
  <text x="325" y="315" text-anchor="middle" font-family="monospace" font-size="9" fill="#ad1457">gateway_worker</text>

  <rect x="260" y="335" width="130" height="55" rx="4" fill="url(#storeGrad)" stroke="#9c27b0"/>
  <text x="325" y="355" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#7b1fa2">Khepri/Ra</text>
  <text x="325" y="375" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#8e24aa">Cluster Leader</text>

  <!-- Node 3 -->
  <rect x="460" y="265" width="160" height="140" rx="6" fill="url(#nodeGrad)" stroke="#2196f3" stroke-width="2"/>
  <text x="540" y="285" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#1565c0">Node 3</text>

  <rect x="475" y="295" width="130" height="30" rx="4" fill="url(#workerGrad)" stroke="#e91e63"/>
  <text x="540" y="315" text-anchor="middle" font-family="monospace" font-size="9" fill="#ad1457">gateway_worker</text>

  <rect x="475" y="335" width="130" height="55" rx="4" fill="url(#storeGrad)" stroke="#9c27b0"/>
  <text x="540" y="355" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#7b1fa2">Khepri/Ra</text>
  <text x="540" y="375" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#8e24aa">Follower</text>

  <!-- Raft replication arrows between nodes -->
  <line x1="175" y1="362" x2="260" y2="362" stroke="#9c27b0" stroke-width="1.5" stroke-dasharray="4,2"/>
  <line x1="390" y1="362" x2="475" y2="362" stroke="#9c27b0" stroke-width="1.5" stroke-dasharray="4,2"/>

  <!-- Legend -->
  <text x="325" y="415" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Dashed lines: Raft consensus replication</text>
</svg>