Whitebox Architecture¶
Whitebox is built on a modular, event-driven architecture designed for extensibility and real-time operations.
System Overview¶
- Django Channels Server: Provides the foundation for real-time communication via WebSockets.
- Plugin System: Allows for easy extension of functionality through self-contained modules.
- Event System: Facilitates communication between components and enables reactive architecture.
- Database Integration: Offers persistent storage for flight data with revision history.
Key Components¶
Django Channels Server¶
- Handles asynchronous requests for improved performance
- Manages WebSocket consumers for real-time, bidirectional communication
- Utilizes channel layers for inter-instance communication
Explore the whitebox codebase to learn more about the server implementation.
Plugin System¶
- Supports dynamic loading and unloading of plugins at runtime from the environment
- Provides isolated environments for each plugin
- Offers standardized APIs for data persistence, event handling and event emission
Explore the plugin codebase to learn more about the plugin implementation.
Event System¶
- Defines system events (e.g.,
flight_start
,flight_end
) - Allows custom events for plugin-specific functionality
- Implements asynchronous event handling for improved responsiveness
Database Integration¶
- Supports PostgreSQL
- Uses Django's ORM for database interactions
- Provides migration support for managing schema changes
Real-Time Communication Flow¶
- Clients connect to the server via WebSockets
- Server accepts connections and adds clients to the
flight
group - Clients send commands or requests to the server
- Server processes commands, potentially triggering plugin actions
- Plugins emit events in response to actions or internal processes
- Server broadcasts relevant events to connected clients and other plugins that have subscribed to those events
- Clients update their state based on received events
Next Steps¶
- Check out the Development Guide
- Explore the Plugin Guide for creating custom plugins