A RESTful CRUD API built with FastAPI to manage driver records for Linfox Melbourne logistics operations.
This API serves as the data management layer that complements the Linfox RAG Chatbot. The chatbot answers operational queries -- this API manages the structured driver data behind those answers.
| Method | Endpoint | Description |
|---|---|---|
| GET | /drivers |
List all drivers. Filter by shift_type, roster_pattern, licence_class |
| GET | /drivers/{driver_id} |
Get a single driver by employee ID |
| POST | /drivers |
Add a new driver |
| PUT | /drivers/{driver_id} |
Partially update a driver record |
| DELETE | /drivers/{driver_id} |
Deactivate a driver (soft delete) |
Soft delete -- deactivating a driver sets is_active=False rather than removing the record. Operational history is retained for NHVR compliance purposes.
Computed licence expiry -- is_licence_expired is calculated on every GET request by comparing licence_expiry against today's date. It is never stored -- always accurate.
Filtering via query parameters -- /drivers?shift_type=night&licence_class=MC rather than a separate /filter endpoint, which is REST standard.
- FastAPI
- Pydantic
- Python 3.13
- JSON file as data store (POC only -- no concurrency protection)
git clone https://github.com/deesk/linfox-driver-api
cd linfox-driver-api
python -m venv venv
venv\Scripts\Activate.ps1
pip install fastapi uvicorn
uvicorn main:app --reloadVisit http://localhost:8000/docs for interactive API documentation.
Linfox RAG Chatbot -- domain-specific RAG chatbot built on Azure AI Foundry.