⚠️ This repository has been archived. BrainDrive is building a new personal AI system on top of the Personal AI Architecture — an MIT-licensed, open architecture with zero lock-in. See the architecture repo for the foundation, and visit braindrive.ai for updates.
A working demonstration plugin for BrainDrive's Event Service Bridge functionality. This plugin showcases real-time inter-module communication within the BrainDrive platform through three interactive components that send, receive, and monitor events.
The ServiceExample_Events plugin in action, showing real-time event communication between the Event Sender, Event Receiver, and Event Display modules.
This plugin serves as a working demo of BrainDrive's Event Service Bridge, demonstrating:
- How modules communicate with each other on a BrainDrive page
- Real-time event passing between different plugin modules
- Event Service Bridge integration patterns
- Best practices for inter-module communication in BrainDrive
- Event Sender - Send messages to other modules
- Event Receiver - Receive and display incoming messages
- Event Display - Monitor all event activity in real-time
- Complete Event Service wrapper implementation
- Proper service bridge connection handling
- Real-time event subscription and publishing
- Module-to-module communication patterns
- BrainDrive platform (this plugin runs inside BrainDrive)
- Plugin Manager access in BrainDrive
- Install the plugin through BrainDrive's Plugin Manager
- The plugin will be available in your module library
- Create a new page in BrainDrive
- Add the demo modules to your page:
- Drag "Event Sender" module to the page
- Drag "Event Receiver" module to the page
- Drag "Event Display" module to the page
- Test the communication:
- Type a message in Event Sender
- Select target module (Event Receiver or Event Display)
- Click "Send Message" or "Send Broadcast"
- Watch real-time updates in Event Receiver and Event Display
- Target Selection: Choose which module to send messages to
- Message Composition: Type custom messages
- Send Options:
- Send targeted message to specific module
- Send broadcast message to multiple modules
- Real-time Feedback: Status updates and confirmations
- Auto-listening: Automatically receives events when placed on page
- Message Display: Shows incoming messages with timestamps
- Sender Information: Displays who sent each message
- Message History: Keeps track of received messages
- Clear Function: Reset message history
- Event Monitoring: Logs all event activity on the page
- Event Categorization: Color-coded event types
- Timestamp Tracking: Shows both sent and received times
- Connection Status: Visual indicator of Event Service connection
- Event Statistics: Total event count and activity status
This plugin demonstrates key Event Service Bridge concepts:
// How the Event Service Bridge is initialized
eventService.setServiceBridge(services.event);// Send targeted message
eventService.sendMessage('target-module-id', messageData);
// Send broadcast message
eventService.sendMessage('event-receiver', broadcastData);
eventService.sendMessage('event-display', broadcastData);// Subscribe to incoming events
eventService.subscribeToMessages(handleMessage);After using this demo, developers will understand:
- How BrainDrive's Event Service Bridge works
- Patterns for inter-module communication
- Event subscription and publishing in BrainDrive
- Service bridge integration best practices
- Real-time communication between plugin modules
- Place all three modules on a BrainDrive page
- Use Event Sender to send a message to Event Receiver
- Watch the message appear in Event Receiver
- Check Event Display to see the event was logged
- Try broadcast messages to see multiple modules receive events
- Test with multiple Event Receiver modules on the same page
- Send different message types and observe categorization
- Monitor connection status indicators
- Test message history and clearing functionality
- Class-based React components for BrainDrive compatibility
- Proper webpack configuration for plugin loading
- Service bridge integration following BrainDrive patterns
interface EventMessage {
type: string; // Event type (e.g., 'simple-message', 'broadcast')
text: string; // Message content
timestamp: string; // ISO timestamp when sent
from: string; // Sender module identifier
}- Proper service bridge initialization
- Event subscription management
- Cleanup on component unmount
This plugin serves as a reference implementation for:
- Event Service Bridge integration
- Inter-module communication patterns
- BrainDrive plugin architecture
- Service bridge connection handling
src/services/eventService.ts- Event Service Bridge wrappersrc/components/EventSender.tsx- Message sending componentsrc/components/EventReceiver.tsx- Message receiving componentsrc/components/EventDisplay.tsx- Event monitoring component
- BrainDrive Platform: This plugin must run inside BrainDrive
- Event Service: Requires BrainDrive's Event Service to be available
- Module Support: Page must support multiple modules for full demo
- No events received: Ensure Event Service is available in BrainDrive
- Modules not communicating: Check that modules are on the same page
- Connection issues: Verify Event Service Bridge is properly initialized
- Check browser console for Event Service logs
- Use Event Display module to monitor all event activity
- Verify module IDs match between sender and receiver
Experience BrainDrive's Event Service Bridge in Action! 🌉
This is a demonstration plugin designed to run within the BrainDrive platform. It showcases real-time inter-module communication capabilities.
