FlowFrame Architecture DSL Reference
FlowFrame Domain Specific Language (.flow) is a declarative infrastructure-as-code language built to design, compile, visualize, and simulate complex distributed systems and microservices architectures in real time.
System Simulation Rules & Runtime Behavior
Every topology in FlowFrame executes according to these 8 deterministic engine rules:
01Cache-First Precedence (Redis + Postgres)
Data AccessWhen a Server node is connected to both a Redis cache and a PostgreSQL database, the engine always queries Redis first. If the key exists (CACHE_HIT), it returns immediately. Only on CACHE_MISS does the server forward to Postgres.
02Postgres TCP Connection Pool Limits
DatabaseEach server maintains a bounded connection pool defined by tcpConnectionsToPostgres. When concurrent requests exceed the pool size, excess queries enter a POSTGRES_POOL_WAIT queue state until active connections free up.
03Load Balancer Health Verification
Traffic BalancingLoad balancers inspect downstream server capacity. If all server nodes in a pool are exhausted, the load balancer rejects the request with a 503 Service Unavailable error.
04Endpoint & Method Matching Contracts
REST RoutingServers validate that incoming requests match declared acceptedEndpoints and HTTP verbs (GET, POST, PUT, DELETE). Unmatched paths trigger 404 Not Found or 405 Method Not Allowed.
05Async Message Queue Ack
Publishing to a MessageQueue sends an immediate 202 Accepted ack back to the client while worker servers process messages in the background.
06PubSub Event Fan-Out
PubSub brokers broadcast published event messages to all subscribed servers registered with the matching topic channel.
07Valet Key Pre-Signed Uploads
When valet: true, the client first requests an upload token from the server, then streams data directly to cloud storage.
08Queue Overflow Controls
MessageQueue buffers that exceed queueSize adhere to BLOCK (producer waits) or REJECT (503 error).
Syntax & Token Rules
The DSL follows a concise declarative structure with loose keyword tolerances.
Node Declarations
- The
definekeyword is optional. - Node types can be uppercase or lowercase (e.g.
CLIENTorclient). - Identifiers are unique string names (e.g.
c1,s1,lb1).
Connection Syntax
- Chained connections (
a -> b -> c) split into directed edges (a -> bandb -> c). - The
connectkeyword is optional.
Supported Node Schemas (8 Components)
FlowFrame supports 8 core infrastructure component types: clients, servers, gateways, balancers, caches, databases, message queues, and pubsub brokers.
1. CLIENT & 2. SERVER
Core Runtimes3. GATEWAY & 4. LOADBALANCER
Traffic Management5. REDIS & 6. POSTGRES
State & Storage7. MESSAGEQUEUE & 8. PUBSUB
Asynchronous MessagingFlagship Enterprise Microservices Blueprint
Full-scale microservices system with API Gateway, 2 Load Balancers, 7 Servers, RabbitMQ Queue, PubSub, Redis, and PostgreSQL.
Video Deep Dive — Event-Driven Architecture from Scratch
Watch the full-stack walkthrough building and simulating this production-grade microservices system.
Error Diagnostics & Open Source License
The FlowFrame compiler performs strict Lexer, Parser, and Semantic checks prior to visual rendering or simulation execution.
Syntax Errors
Catches unexpected tokens, unclosed braces, or missing identifiers.
Duplicate Checks
Prevents re-declaration of duplicate node identifier names.
Strict Schema Rules
Enforces valid property names per node type using ALLOWED_VARIABLES.
PolyForm Noncommercial License 1.0.0
ndk123-web/flowframeFlowFrame source code is available for educational, personal, and non-commercial research purposes under the PolyForm Noncommercial License 1.0.0. Feel free to inspect the Rust backend, TypeScript compiler pipeline, and simulation runtime.