app/ - application code routes/ - HTTP endpoints services/ - business logic models.py - database models schemas.py - request/response validation tests/ - automated tests
requirements.txt - python dependencies dockerfile - how to build the API container (starts app using uvicorn) docker-compose.yml - defines the environment (runs whole backend ecosystem: API service, MySQL db, redis, rabbitMQ, all connected via internal docker network)
hostnames: db - MySQL redis - Redis rabbitmq - RabbitMQ (we don't use localhost)
.env - config (db credentials, service hostnames) out of code
mysql_data - volume for persistent db storage (prevents losing data when container restarts)
The services/ folder is meant for: business rules. complex operations, cross-table logic, external integrations (Redis, RabbitMQ, etc.), reusable logic across routes
Redis: to cache events RabbitMQ: to process orders asynchronously
(from inside ticket-api)
docker compose down # if you want to restart
docker compose up --build
(e.g. you change things in models.py)
Run ./scripts/dev_migrate.sh which will use alembic to generate and apply a migration
Restart containers: docker compose up
Go to localhost:8000/docs for the swagger UI
Check /openapi.json for the open api file generated by FastAPI