Backend
The backend layer handles all communication with external systems and exposes utilities consumed by the services layer.
Modules
Section titled “Modules”| Module | Responsibility |
|---|---|
config.py | Loads and exposes application configuration |
database.py | PostgreSQL connection pool and query helpers |
fetch_experiment_ids.py | Lightweight query for available experiment IDs |
generic.py | Shared utility functions (transformation, formatting) |
logger_config.py | Centralised setup_logger() factory |
ml.py | Feature preparation and input validation for ML models |
model_handler.py | Dispatches inference requests to the correct model |
model_io.py | Serialises and deserialises model artefacts from disk |
prediction_db.py | Persists sensor readings and prediction results |
websocket.py | WebSocket client with paginated batch fetching |