This project implements a microservices-based taxi dispatch system using Python, FastAPI, SQLAlchemy, and Docker. It consists of a dispatch service that manages taxi assignments and trip statuses, and worker services that simulate taxi operations. The system supports dynamic taxi allocation, trip lifecycle management, and real-time status updates via RESTful APIs.
Main features:
- FastAPI-based dispatch API for trip creation and status updates
- Asynchronous worker services representing taxis
- Docker integration for managing taxi worker containers
- SQL database for persistent storage of taxis and trips
this will crate a virtual environment and install all dependencies
this will build the docker image
this will apply the database migrations
this will start the docker container
curl -X 'POST' \
'http://0.0.0.0:8000/api/v1/trips' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"user_id": "string",
"start_x": 71,
"start_y": 22,
"end_x": 3,
"end_y": 4
}'
and get response
{
"trip_id": 8,
"taxi_id": "a8a3fcb445e5",
"status": "assigned"
}