Skip to content

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"]
}
}
}
Terminal window
flowlayer-server -c ./flowlayer.jsonc

Use explicit session flags:

Terminal window
flowlayer-client-tui -addr 127.0.0.1:6999 -token dev-token-local-stack

Or keep a separate client config file:

{
"session": {
"addr": "127.0.0.1:6999",
"token": "dev-token-local-stack"
}
}
Terminal window
flowlayer-client-tui -config ./flowlayer.tui.jsonc

Server 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

In one session, you can:

  • restart only orders-consumer after schema or topic changes
  • stop and start worker without touching api
  • inspect Kafka-facing services and API logs side by side from the TUI

Command contracts are described in Actions and Logs.

  • 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.