This project simulates customers asking for rides and autonomous taxis moving around a shared map. The point isn't a single program but several services, started separately, that have to keep working together.
Distributed architecture
There are 7 Python services. Kafka carries events between the central server, the taxis and the customers, TCP sockets handle the direct connection with each taxi, and Flask REST APIs expose the taxi registry and other supporting services. MySQL stores the shared data and a React frontend shows the system live.
- Taxi positions and states updated in real time on a 20×20 map.
- Taxis react to the weather, which comes from an external API.
Security and auditing
Messages between each taxi and the central server are encrypted with AES-256-GCM, with one key per taxi, and taxis authenticate with session tokens that can be revoked. There is also an audit log of system events that you can query through an API and a React dashboard.
Running it locally
Docker Compose starts Kafka, MySQL and the frontends on a shared network, so the whole environment runs locally with one command. Along the way I ran into the typical problems of distributed systems, such as services starting in the wrong order, the broker's address, many actors moving at once and keeping state in sync.