Local Distributed Stack
Use this when your local stack mixes APIs, workers, a broker, and data services and you need a single deterministic boot from one config.
FlowLayer treats every process as a peer with explicit dependencies, so Postgres, Redis, and Kafka come up before the API and workers that need them — with one source of truth for state and logs.
Server config for a local distributed stack
Section titled “Server config for a local distributed stack”{ "session": { "bind": "127.0.0.1:6999", "token": "dev-token-local-stack" }, "services": { "postgres": { "cmd": ["postgres", "-D", "./var/postgres"], "port": 5432, "ready": { "type": "tcp" } }, "redis": { "cmd": ["redis-server", "./infra/redis.conf"], "port": 6379, "ready": { "type": "tcp" } }, "kafka": { "cmd": ["kafka-server-start.sh", "./infra/kafka/server.properties"], "port": 9092, "ready": { "type": "tcp" } }, "api": { "cmd": ["pnpm", "--dir", "services/api", "dev"], "dependsOn": ["postgres", "redis", "kafka"], "port": 3000, "ready": { "type": "http", "url": "http://127.0.0.1:3000/health" } }, "worker": { "cmd": ["pnpm", "--dir", "services/worker", "dev"], "dependsOn": ["api", "redis", "kafka"] }, "orders-producer": { "cmd": ["pnpm", "--dir", "services/orders-producer", "dev"], "dependsOn": ["api", "kafka"] }, "orders-consumer": { "cmd": ["pnpm", "--dir", "services/orders-consumer", "dev"], "dependsOn": ["kafka", "postgres", "redis"] } }}Start the server runtime
Section titled “Start the server runtime”flowlayer-server -c ./flowlayer.jsoncConnect the official TUI
Section titled “Connect the official TUI”Use explicit session flags:
flowlayer-client-tui -addr 127.0.0.1:6999 -token dev-token-local-stackOr keep a separate client config file:
{ "session": { "addr": "127.0.0.1:6999", "token": "dev-token-local-stack" }}flowlayer-client-tui -config ./flowlayer.tui.jsoncServer and client config stay separate:
- server listens with
session.bind - client connects with
session.addr - do not reuse server config as TUI config unless you authored it for that purpose
Practical operations
Section titled “Practical operations”In one session, you can:
- restart only
orders-consumerafter schema or topic changes - stop and start
workerwithout touchingapi - inspect Kafka-facing services and API logs side by side from the TUI
Command contracts are described in Actions and Logs.
Boundaries
Section titled “Boundaries”- FlowLayer is not a production orchestrator.
- FlowLayer does not replace Kubernetes, Docker Compose, PM2, or systemd.
- Use this pattern to simulate distributed development behavior and runtime interactions.