0xYurii
Back to work

01 — API Gateway

Aegis

Custom API gateway & microservice orchestrator

04.2026 — 05.2026 · Solo project

Aegis is a custom API gateway and microservice orchestrator built to understand — and own — everything that sits between a client request and the service that answers it. Instead of reaching for NGINX or Kong, I implemented the routing, resilience, and security layers myself, in Node.js and TypeScript.

The result is a nine-service system wired together with Docker Compose, with every request traceable end-to-end by a UUID that follows it across service boundaries.

Highlights

  • Round-robin load balancer fronted by a custom three-state circuit breaker (closed / open / half-open) that reroutes around failing instances and self-heals on recovery.
  • Distributed, Redis-backed rate limiter shared across gateway replicas.
  • Centralized JWT middleware that verifies tokens once and injects sanitized user context into downstream services.
  • 100% Jest coverage on the core logic (breaker, balancer, limiter).
  • GitHub Actions CI that runs the test suite and publishes Docker images to GHCR on every merge.
  • UUID-based request tracing across all nine services via a custom logging plugin.
Aegis request path A request flows from a client through the Aegis gateway (rate limiter, JWT auth, circuit breaker, load balancer) out to service instances; one instance is circuit-open and receives no traffic. client x-request-id aegis — gateway :8080 rate limiter jwt auth circuit breaker load balancer redis :6379 users-svc :8081 · healthy orders-svc :8082 · healthy billing-svc :8083 · circuit: open half-open probe in 12s
fig.01 — one request through Aegis: rate limiting → auth → circuit breaking → load balancing, traced end-to-end by UUID.