Skip to main content

Architecture Overview

STOA Platform is designed as a cloud-native, multi-tenant gateway platform built for both traditional APIs and AI agents.

High-Level Architecture​

STOA follows a Control Plane / Data Plane separation pattern, similar to Kubernetes and Istio.

Control Plane vs Data Plane​

AspectControl PlaneData Plane
RoleConfiguration & ManagementTraffic Execution
ComponentsCore API, Portal, ConsoleSTOA Gateway (Rust)
LatencyHuman-scale (ms OK)Machine-scale (sub-ms)
ScalingModerateHigh (per-request)
Architecture Decision

This separation is documented in ADR-001: API Exposure Strategy.

Core Components​

Control Plane API​

The central management API built with Python and FastAPI.

AspectDetails
LanguagePython 3.12+
FrameworkFastAPI (async)
DatabasePostgreSQL + SQLAlchemy
Event StreamingKafka/Redpanda
AuthKeycloak (OIDC)

Responsibilities:

  • Subscription management
  • Tenant provisioning
  • Tool catalog
  • Usage tracking
  • Policy enforcement

STOA Gateway​

The STOA Gateway is the unified data plane component, handling both MCP protocol interactions for AI agents and traditional API traffic. Built with Rust and Tokio/axum, it has been in production since February 2026.

AspectDetails
LanguageRust (stable)
FrameworkTokio + axum
Policy EngineOPA (Open Policy Agent)
ProtocolMCP, REST

Responsibilities:

  • MCP protocol handling (tools/list, tools/call, SSE)
  • OAuth2/OIDC authentication via Keycloak
  • Request routing and rate limiting
  • Metrics collection and observability
  • Multi-gateway adapter orchestration (Kong, Gravitee, Apigee, Azure APIM, AWS API Gateway, webMethods)

Portal UI​

Self-service developer portal built with React and TypeScript.

Features:

  • API/Tool catalog browsing
  • Subscription management
  • API key generation
  • Usage dashboards
  • Documentation access

Console UI​

Admin management console built with React and TypeScript.

Features:

  • Tenant management
  • User administration
  • Policy configuration
  • System monitoring
  • Audit logs

Security Layer​

Keycloak​

Identity and access management providing:

  • OIDC/OAuth2 authentication
  • SSO (Single Sign-On)
  • RBAC (Role-Based Access Control)
  • Multi-factor authentication
  • User federation

HashiCorp Vault​

Secrets management for:

  • API key encryption
  • Database credentials
  • TLS certificates
  • Service tokens

Data Layer​

PostgreSQL​

Primary database storing:

  • Subscriptions
  • Tenants
  • Users
  • Tool definitions
  • Audit logs

Kafka/Redpanda​

Event streaming for:

  • Audit events
  • Usage metrics
  • Cross-service communication
Internal Only

Kafka is strictly internal with zero external exposure (ADR-017). All external integrations use REST APIs.

Observability Stack​

ComponentPurpose
PrometheusMetrics collection
GrafanaDashboards & visualization
LokiLog aggregation
AlertmanagerAlert routing

Request Flow​

  1. AI Agent sends a tool invocation request with an API key
  2. MCP Gateway validates the API key against Keycloak
  3. Gateway checks subscription status with Control Plane API
  4. Control Plane verifies the subscription is active
  5. Gateway forwards the request to the appropriate MCP Server
  6. MCP Server executes the tool and returns the response
  7. Gateway returns the response to the AI Agent

Deployment​

STOA Platform runs on Kubernetes and can be deployed using:

  • Helm Charts: Available in stoa-infra/charts/
  • GitOps: ArgoCD compatible
  • IaC: Terraform modules available

Kubernetes Namespace​

All components run in the stoa-system namespace:

kubectl get pods -n stoa-system

Ingress Endpoints​

ServiceURL Pattern
Portalportal.<domain>
Consoleconsole.<domain>
APIapi.<domain>
Gatewaygateway.<domain>
Authauth.<domain>

Technology Stack Summary​

LayerTechnologyNotes
Control PlanePython, FastAPIManagement API
STOA GatewayRust, Tokio, axumMCP + API traffic
FrontendReact, TypeScript, TailwindPortal & Console
DatabasePostgreSQLPrimary data store
Event StreamingKafka/RedpandaInternal events
StreamingKafka/RedpandaInternal events
AuthKeycloakOIDC/OAuth2
SecretsHashiCorp VaultEncryption, credentials
ObservabilityPrometheus, Grafana, LokiMetrics, logs
InfrastructureKubernetes, Helm, ArgoCDDeployment

Next Steps​