<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 880 680" xmlns="http://www.w3.org/2000/svg" style="max-width: 100%; height: auto;">
  <defs>
    <!-- Arrow markers -->
    <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="#2563EB">
    </marker>

    <!-- Drop shadow for depth -->
    <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
      <feGaussianBlur in="SourceAlpha" stdDeviation="2">
      <feOffset dx="1" dy="1" result="offsetblur">
      <feComponentTransfer>
        <feFuncA type="linear" slope="0.2">
      </feComponentTransfer>
      <feMerge>
        <feMergeNode/>
        <feMergeNode in="SourceGraphic">
      </feMerge>
    </filter>
  </defs>



  <!-- Beautiful gradient definitions for depth -->
  

  <!-- White background with subtle border -->
  <rect x="0" y="0" width="880" height="680" fill="#F9FAFB" stroke="#9CA3AF" stroke-width="2" rx="8">

  <!-- Content container with proper margins -->
  <g transform="translate(40, 40)">
  <!-- Define gradients and effects -->
  

  <!-- Background -->
  <rect x="0" y="0" width="800" height="600" fill="#4B5563" rx="8" filter="url(#shadow)">

  <!-- Title -->
  <rect x="250" y="10" width="300" height="35" fill="rgba(99, 102, 241, 0.05)" rx="8" filter="url(#shadow)">
  <text x="400" y="33" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="24" font-weight="600" fill="#4B5563">
    BotServer API Architecture
  </text>

  <!-- Client Applications Layer -->
  <rect x="250" y="60" width="300" height="50" fill="url(#clientGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="90" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Client Applications
  </text>

  <!-- Arrow down -->
  <path d="M 400 110 L 400 130" stroke="#2563EB" stroke-width="2.5" fill="none" marker-end="url(#arrow)" opacity="0.7">

  <!-- HTTP/HTTPS Layer -->
  <rect x="300" y="130" width="200" height="45" fill="rgba(99, 102, 241, 0.08)" stroke="#2563EB" stroke-width="2" rx="6" filter="url(#shadow)">
  <text x="400" y="150" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" font-weight="500" fill="#4B5563">
    HTTP/HTTPS
  </text>
  <text x="400" y="165" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Port 8080
  </text>

  <!-- Arrow down -->
  <path d="M 400 175 L 400 195" stroke="#2563EB" stroke-width="2.5" fill="none" marker-end="url(#arrow)" opacity="0.7">

  <!-- API Gateway -->
  <rect x="250" y="195" width="300" height="50" fill="url(#gatewayGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="220" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    API Gateway
  </text>
  <text x="400" y="235" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /api/*
  </text>

  <!-- Arrows to endpoint groups -->
  <path d="M 400 245 L 400 260 L 180 260 L 180 280" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">
  <path d="M 400 245 L 400 280" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">
  <path d="M 400 245 L 400 260 L 620 260 L 620 280" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">

  <!-- Auth Endpoints -->
  <rect x="80" y="280" width="200" height="80" fill="url(#authGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="180" y="305" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" font-weight="600" fill="#4B5563">
    Auth Endpoints
  </text>
  <text x="180" y="325" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /auth/login
  </text>
  <text x="180" y="340" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /auth/logout
  </text>
  <text x="180" y="355" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /auth/token
  </text>

  <!-- Business Endpoints -->
  <rect x="300" y="280" width="200" height="80" fill="url(#businessGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="305" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" font-weight="600" fill="#4B5563">
    Business Endpoints
  </text>
  <text x="400" y="325" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /files/* • /users/*
  </text>
  <text x="400" y="340" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /groups/* • /tasks/*
  </text>
  <text x="400" y="355" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /sessions/*
  </text>

  <!-- Admin Endpoints -->
  <rect x="520" y="280" width="200" height="80" fill="url(#adminGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="620" y="305" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" font-weight="600" fill="#4B5563">
    Admin Endpoints
  </text>
  <text x="620" y="325" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /admin/*
  </text>
  <text x="620" y="340" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /monitoring
  </text>
  <text x="620" y="355" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    /analytics
  </text>

  <!-- Arrows converging to service layer -->
  <path d="M 180 360 L 180 380 L 400 380 L 400 400" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">
  <path d="M 400 360 L 400 400" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">
  <path d="M 620 360 L 620 380 L 400 380 L 400 400" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">

  <!-- Service Layer -->
  <rect x="250" y="400" width="300" height="70" fill="url(#serviceGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="425" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Service Layer
  </text>
  <text x="400" y="445" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    • Session Manager
  </text>
  <text x="400" y="460" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    • Auth Service • Bot Service
  </text>

  <!-- Arrows to databases -->
  <path d="M 400 470 L 400 485 L 180 485 L 180 500" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">
  <path d="M 400 470 L 400 500" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">
  <path d="M 400 470 L 400 485 L 620 485 L 620 500" stroke="#2563EB" stroke-width="2" fill="none" marker-end="url(#arrow)" opacity="0.7">

  <!-- PostgreSQL -->
  <rect x="80" y="500" width="200" height="70" fill="url(#dbGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="180" y="525" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" font-weight="600" fill="#4B5563">
    PostgreSQL
  </text>
  <text x="180" y="545" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Database
  </text>
  <text x="180" y="560" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Sessions • Users • Config
  </text>

  <!-- Valkey Cache -->
  <rect x="300" y="500" width="200" height="70" fill="url(#dbGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="525" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" font-weight="600" fill="#4B5563">
    Valkey
  </text>
  <text x="400" y="545" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Cache
  </text>
  <text x="400" y="560" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Semantic • Session • Temp
  </text>

  <!-- Qdrant -->
  <rect x="520" y="500" width="200" height="70" fill="url(#dbGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="620" y="525" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" font-weight="600" fill="#4B5563">
    Qdrant
  </text>
  <text x="620" y="545" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Vectors
  </text>
  <text x="620" y="560" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Embeddings • Search
  </text>


  </g>

</svg>