Ticket Booking API used in workshop exercises for deterministic, constraint-driven AI-assisted engineering.
Docker is the default boot path for a clean-room local environment.
- Docker Engine 24+ (or compatible)
- Docker Compose v2
Build and run with the default script mode:
sh run.sh --dockerAlternative detached mode:
sh run.sh --docker-detachedThe API is exposed at:
curl http://localhost:5000/api/healthExpected response:
{"status":"ok","message":"API running"}sh run.sh --downThe Compose service mounts:
- ./instance:/app/instance
This mount only persists files written under /app/instance.
python run.pyPopulate the database with sample events and tickets for workshop exercises:
# Docker
docker compose exec api flask --app run:app seed-db
# Local
flask --app run:app seed-dbThis creates 3 events and 10 tickets, including a high-demand ticket for race condition testing. Running the command again clears and re-seeds the data.
A standalone HTTP client for interacting with the running API (no external tools required):
python cli_tool.pyOptionally specify a custom API URL:
python cli_tool.py --base-url http://localhost:5000Features: health check, list events, list tickets, book a ticket.