This plan outlines the steps to implement the real-time alert engine for the LifeLine-ICT project, as described in GitHub Issue #3.
Status: Implemented
- Create a new directory
backend/app/alert_engine. - This module will contain the logic for the real-time alert engine.
- Create a new file
backend/app/models/alert.py. - This model will represent an alert in the database, including fields for
sensor_id,metric,value,threshold, andtimestamp.
- Create a new file
backend/app/repositories/alert_repository.py. - This repository will handle the database operations for the
Alertmodel, including creating and retrieving alerts.
- Create a new file
backend/app/services/alert_service.py. - This service will contain the business logic for creating and retrieving alerts, including checking for threshold breaches.
- Create a new file
backend/app/api/alert_router.py. - This router will expose the alert endpoints to the API, including an endpoint for creating alerts and an endpoint for retrieving alerts.
- In
backend/app/main.py, import and include thealert_router. - This will make the alert endpoints available to users.
- Create a new file
backend/tests/alert_engine/test_alert_service.py. - Add unit tests to ensure that the alert engine is working correctly, including testing the threshold breach logic.
- Create a new file
.github/workflows/ci.yml. - This pipeline will automate the testing of the application on every push to the repository.