High-Level Architecture

STING CE is a self-hosted, Docker Compose–orchestrated platform built around a microservices architecture. All services run on a single host within a private Docker bridge network (sting_local), communicating over internal DNS.

┌─────────────────────────────────────────────────────────────────┐
│                         Client (Browser)                        │
└────────────────────────────────┬────────────────────────────────┘
                                 │ HTTPS :8443
┌────────────────────────────────▼────────────────────────────────┐
│               Nginx / React Frontend (frontend)                 │
│         Serves SPA, proxies API requests to backend             │
└──────┬──────────────┬──────────────┬───────────────┬────────────┘
       │              │              │               │
  ┌────▼────┐   ┌─────▼─────┐  ┌────▼─────┐  ┌─────▼──────┐
  │Flask API│   │ Knowledge │  │Messaging │  │ Public Bee │
  │  (app)  │   │  Service  │  │ Service  │  │  Service   │
  │  :5050  │   │   :8090   │  │  :8889   │  │   :8092    │
  └────┬────┘   └─────┬─────┘  └────┬─────┘  └────────────┘
       │              │              │
  ┌────▼──────────────▼──────────────▼────────────────────────┐
  │                      Data Layer                           │
  │  PostgreSQL :5432 │ Redis :6379 │ ChromaDB :8000 │ Vault │
  └───────────────────────────────────────────────────────────┘

Architecture Layers

STING CE is organized into four logical layers:

LayerComponentsPurpose
ClientBrowser SPA (React 18)User interface, passkey/WebAuthn auth
GatewayNginx reverse proxy, LLM Gateway ProxyTLS termination, routing, LLM failover
ApplicationFlask API, FastAPI services, workersBusiness logic, AI orchestration, messaging
DataPostgreSQL, Redis, ChromaDB, VaultPersistence, caching, vectors, secrets

Service Inventory

All services run as Docker containers orchestrated by Docker Compose.

ServiceContainerInternal PortExposed PortTechnology
vaultsting-ce-vault82008200HashiCorp Vault
utilssting-ce-utilsPython init helper
dbsting-ce-db54325433PostgreSQL 16
kratossting-ce-kratos4433, 44344433, 4434Ory Kratos 1.3
appsting-ce-app50505050Flask 2.x + Gunicorn
report-workersting-ce-report-workerPython (thin proxy → app)
profile-sync-workerPython background worker
report-beePython report quality review
frontendsting-ce-frontend808443React 18 + Nginx 1.27
mailpitsting-ce-mailpit1025, 80251025, 8025Mailpit (dev only)
chromasting-ce-chroma80008000ChromaDB 0.5.20
searxngsting-ce-searxng8080SearXNG metasearch
knowledgesting-ce-knowledge80908090FastAPI (Honey Jars)
llm-gateway-proxy80808085Nginx LLM proxy
chatbotsting-ce-chatbot8081, 88888081, 8888Python chatbot
messagingsting-ce-messaging88898889FastAPI messaging
redissting-ce-redis63796379Redis
external-aisting-ce-external-ai80918091FastAPI LLM gateway
public-beesting-ce-public-bee80928092FastAPI public API
demo-aisting-ce-demo-ai80958095FastAPI mock LLM

Request Flow

Standard API Request

Browser → Nginx (frontend :8443)
       → Flask API (app :5050)
       → Kratos session validation
       → Route handler (Blueprint)
       → PostgreSQL / Redis
       → JSON response

LLM Request Flow

App (or Chatbot)
  → external-ai-service :8091  (FastAPI ProviderRegistry)
  → llm-gateway-proxy :8085   (Nginx reverse proxy)
  → Ollama / OpenAI / Anthropic / LM Studio / vLLM
  → Streamed response back through the chain

The LLM gateway proxy provides upstream failover and streaming support (proxy_buffering off, 300-second timeouts). The external AI service’s singleton ProviderRegistry manages provider configuration and routing.

Knowledge Search Flow

User query
  → knowledge service :8090
  → ChromaDB :8000 (vector similarity search)
  → PostgreSQL (metadata enrichment)
  → Ranked results returned

Docker Compose Orchestration

All services are defined in a single docker-compose.yml and share the sting_local bridge network. Key orchestration patterns:

  • Health checks — every service defines a HEALTHCHECK in its Dockerfile (30s interval, 10s timeout, 40s start period, 3 retries).
  • Startup orderingdepends_on with condition: service_healthy ensures services start in the correct order (e.g., db and vault before app).
  • Environment configuration — each service reads from dedicated .env files in STING/env/.
  • Resource limits — production deployments use Docker deploy constraints for memory and CPU.

Network Architecture

All containers communicate over a single Docker bridge network:

networks:
  sting_local:
    driver: bridge

No service is exposed to the public internet by default. The Nginx frontend container is the sole entry point, handling TLS termination and proxying requests to internal services.

Design Principles

PrincipleImplementation
MicroservicesEach service has a single responsibility and its own container
Zero TrustEvery request is authenticated; services validate tokens independently
Data SovereigntyAll data stays on-premises; no external telemetry or cloud dependencies
Graceful DegradationServices handle dependency failures with retries and fallbacks
Infrastructure as CodeFull stack defined in Docker Compose with environment-driven configuration

Hive-only features: ChatOps connectors (Slack, Teams, Discord), Nectar Worker bot management, and Beeacon observability are available in STING Hive but are not included in Community Edition.

Last updated: