Introduction
Core entry point of the Python app (backend):
- Initialize app
- Managing app lifecycle (startup & shutdown)
- Running the simulation engine
- Starting the AI agent loop (background task)
- Handling real-time communication (WebSocket)
- Registering API routes
- Managing global error handling
Types of main.py
1. CLI App
print("Hello World")
2. Backend Server
- Entry point for web applications
app = FastAPI()