How kilowatt-commando/controller-service works
Main Components
a. External Interfaces:
• Kafka Message Broker (show both input and output topics)
• WebSocket Interface (for push notifications)
• REST API endpoints
b. Internal Components:
• Core Controller Service
• Message Handlers Layer
• Data Management Layer
• Monitoring System
• Push Notification System
Component Organization
TOP LAYER:
• External Client Communications
• REST Controllers (PowerplantRestController)
• WebSocket Interface (PushNotificationController)
MIDDLE LAYER:
• Message Processing
• Kafka Consumers (PowerPlantListener)
• Kafka Producers (PowerPlantCommandSender)
• Command Handlers (PowerPlantActivityHandler)
• Status Handlers (PowerPlantStatusHandler)
BOTTOM LAYER:
• Data Management
• PowerPlantActivity Repository
• Activity Monitoring System
Key Interactions to Highlight
• Incoming Kafka messages from power plant status topic
• Outgoing commands through control topic
• WebSocket push notifications to clients
• REST API interactions
• Data flow between handlers and repository
• Monitoring system interactions
Additional Details
A notes section showing:
• Environment configurations
• Kafka topic names
• Key DTOs (PlantStatus, PowerplantCommand, etc.)
Monitoring and logging capabilities
Keep the abstraction level focused on the architectural components while showing the key integration points with external systems. This will help developers understand both the internal structure and how the service fits into the larger system.
This design should reflect the service's primary responsibilities of:
• Processing power plant status updates
• Sending control commands
• Monitoring plant activities
• Providing real-time updates via WebSocket
• Maintaining activity history
• Exposing REST endpoints for control operations