@startuml deployment
!theme plain
skinparam nodeBackgroundColor #F8F9FA
skinparam nodeBorderColor #495057
skinparam componentBackgroundColor #E9ECEF

title Sistema de Registro de Estudiantes - Diagrama de Despliegue

node "Cliente" as client {
    component "Navegador Web" as browser {
        [Angular SPA]
    }
}

node "Docker Host" as docker {

    node "student-frontend" as frontendContainer <<container>> {
        component "Nginx" as nginx {
            [Static Files]
            [Reverse Proxy]
        }
    }

    node "student-api" as apiContainer <<container>> {
        component "ASP.NET Core" as aspnet {
            [Kestrel Server]
            [GraphQL Endpoint]
            [Health Check]
        }
    }

    node "student-db" as dbContainer <<container>> {
        database "SQL Server 2022" as sqlserver {
            [StudentEnrollment DB]
        }
    }
}

' Conexiones
browser --> nginx : HTTP :80
nginx --> aspnet : HTTP :5000\n/graphql
aspnet --> sqlserver : TCP :1433

note right of nginx
  <b>Nginx Config:</b>
  - Gzip/Brotli compression
  - Static file caching
  - GraphQL proxy
  - Security headers
end note

note right of aspnet
  <b>Optimizaciones:</b>
  - Server GC
  - ReadyToRun
  - Connection pooling
  - Rate limiting
end note

note right of sqlserver
  <b>Recursos:</b>
  - 2 CPU cores
  - 2.5 GB RAM
  - Persistent volume
end note

@enduml
