MATIH Platform is in active MVP development. Documentation reflects current implementation status.
8. Platform Services
Architecture

API Gateway Architecture

The API Gateway is the single entry point for all client requests to the MATIH platform. Built on Spring Boot 3.2 with Kong as the underlying proxy, it provides service routing, rate limiting, traffic management, plugin orchestration, and load balancing. The gateway runs on port 8080 and manages all inbound traffic across control plane and data plane services.


Service Overview

PropertyValue
Service Nameapi-gateway
Port8080
TechnologySpring Boot 3.2, Java 21, Kong Gateway
Proxy BackendKong Admin API (port 8001)
CacheIn-memory ConcurrentHashMap for route/service configs
SecurityJWT authentication, RBAC via @PreAuthorize
API DocumentationOpenAPI 3.0 (Swagger)

Architecture

                    API Gateway (Port 8080)
                           |
    +----------+-----------+-----------+-----------+
    |          |           |           |           |
 REST API   Kong Proxy  Health     Plugins     Metrics
 (mgmt)     (traffic)   (/health)  (rate-limit) (/prometheus)
    |          |           |           |           |
    +----------+-----------+-----------+-----------+
                           |
              +------------+------------+
              |            |            |
    GatewayMgmtService  LoadBalancer  Plugin
    (routes, services)   Service      Registry
              |            |            |
              +------------+------------+
                           |
                   Kong Admin API (:8001)

Controllers

The API Gateway exposes a single management controller that covers all gateway operations:

ControllerBase PathPurpose
GatewayController/api/v1/gatewayService, route, plugin, rate limit, traffic, and upstream management

Key Components

GatewayManagementService

Manages Kong services, routes, plugins, rate limiting, and traffic control (canary deployments, traffic mirroring) via the Kong Admin API.

LoadBalancerService

Manages Kong upstreams and targets for load balancing. Supports round-robin, weighted, consistent-hashing (header and cookie), and latency-based algorithms.


Security

All management endpoints require the ADMIN role via @PreAuthorize("hasRole('ADMIN')"). Health endpoints are publicly accessible.


Configuration

server:
  port: 8080
 
gateway:
  kong:
    admin-url: http://localhost:8001

Next Steps