This is the supporting repository for a project: Tesla speed check with Kafka and Flutter Web.
The backend part of the project is fully containerised. You will need Docker and Docker Compose to run it.
- In the project directory (where the docker-compose.yml located), spin up the local single-node Kafka cluster:
$ docker compose up
- Check the cluster is up and running (wait for "started" to show up):
$ docker-compose logs -f broker | grep "started"
Show a stream of transactions in the speed.check topic (optionally add --from-beginning
):
$ docker-compose exec broker kafka-console-consumer --bootstrap-server localhost:9092 --topic speed.check
Topics:
current.speed
: current speed provided by the user of Flutter Web applicationspeed.check
: processed speed from the upstream consumer
Example current.speed:
111
Example speed.check result:
{'speed': 111, 'exceeds': True}
To stop the transaction generator and fraud detector:
$ docker compose down
To stop the Kafka cluster (use down
instead to also remove contents of the topics):
$ docker compose stop
To remove the Docker containers:
$ docker compose rm