How start.sh orchestrates a full run from scratch: clean up, build, wait for Kafka to be healthy, run the simulation and finally the analytics.
Solid arrows: calls or published messages. Dashed: replies or returns. Green: success. Red: rejections and errors. Dashed amber boxes: alternative branches; dashed blue boxes: optional steps or loops.
What to notice
down -v at the start deletes the Kafka volume; without it, analytics would add up payments from earlier runs.
up -d --wait kafka does not return until the healthcheck (kafka-broker-api-versions.sh) passes.
run --no-deps runs each service in turn without Compose starting dependencies again; the script enforces the order.
With set -euo pipefail, if the simulation exits with an error the script stops and analytics never runs. In quiet mode, a failed build prints its full log.
./stop.sh runs down -v --remove-orphans: it stops Kafka and deletes containers, network and volumes.