34 - App Startup
Startup Sequence
1. load and validate .env
2. import Flask extensions, databases, services, RESTX, proxy integration
3. create_app()
- Flask + Socket.IO
- EventBus subscribers
- CSRF + limiter + CORS + CSP
- security, traffic, latency, health hooks
- React, RESTX, and feature blueprints
- optional Remote MCP
- request guards and scoped-session teardown
4. setup_environment()
- plugin discovery and broker capabilities
- database/table initialization
- schedulers and restoration
- sandbox workers and scalping risk monitor
- broker keepalive and configured bots
5. start WebSocket proxy when embedded mode applies
6. run Socket.IO server for direct startup, or expose app to gunicornRequired Configuration
Route Registration Order
Remote MCP Gate
Database Readiness
Background Services
WebSocket Startup
Direct Run
Adding Startup Work
Last updated