Architecture Overview
FeatureSignals is built as a modular, self-hosted platform with a clear separation between the API server, Flag Engine, SDKs, and relay proxy.
Components
API Server (Go)
The core server built with Go and the chi router handles REST API, evaluation engine, in-memory cache, SSE server, webhook dispatcher, and flag scheduler.
Flag Engine (Next.js)
A React/Next.js web application providing a visual interface for all management operations. Uses Zustand for state management.
PostgreSQL
The single data store for all persistent state with LISTEN/NOTIFY channels for real-time cache invalidation.
SDKs
Client libraries for Go, Node.js, Python, Java, .NET, Ruby, React, and Vue. All follow the same pattern: initial fetch, background sync, local evaluation.
Data Flow
text
# Flag Evaluation
SDK → (X-API-Key) → API Server
→ Resolve environment from API key
→ Load ruleset from cache (or DB on miss)
→ Evaluate flag(s) against context
→ Return result(s)
# Flag Change Propagation
Flag Engine / API → Update flag in PostgreSQL
→ PostgreSQL NOTIFY on channel
→ Cache evicts stale ruleset
→ SSE server broadcasts flag-update event
→ SDKs receive SSE → refetch flags