Concept Flow - Startup and shutdown events
App starts
Run startup event
App ready to handle requests
App receives shutdown signal
Run shutdown event
App stops
When the FastAPI app starts, it runs startup events first. After that, it handles requests. When stopping, it runs shutdown events before fully stopping.