How abideya/sensorwatch works
SensorWatch is a serverless IoT monitoring and anomaly-detection platform. Its main workflow sends simulated sensor readings through the REST ingestion API, validates and stores them, then asynchronously analyzes them to update device state and create alerts. Separate scheduled jobs detect silent devices and produce daily statistics and exports; administrators query device status, history, alerts, and statistics. The dashboard is a documented capability, but no frontend source appears in the tree. Edges reflect shown calls or README-described triggers; unsampled infrastructure wiring is not inferred.
Main entry points: analyze/app.py Anomaly analysis · aggregate_export/app.py Daily aggregation · db.py DynamoDB helpers · ingest/app.py Measurement ingestion
Components 27
Measurement ingestion
- Measurement ingestion
backend/ingest/app.py
Detection and reporting
- Anomaly analysis
backend/analyze/app.py - Offline detection
backend/offline_check/app.py - Daily aggregation
backend/aggregate_export/app.py
Administration API
- Device and history API
backend/devices_query/app.py - JWT authorizer
backend/authorizer/app.py
Shared runtime services
- Input validation
backend/common/validation.py - DynamoDB helpers
backend/common/db.py - Detection rules
backend/common/rules.py - Threshold configuration
backend/common/config.py - Statistics helpers
backend/common/stats.py - HTTP responses
backend/common/http.py - JWT utilities
backend/common/jwt_utils.py - Alert identifiers
backend/common/ids.py - Logs and metrics
backend/common/logs.py
Simulation and scheduling
- Sensor simulator
simulator/simulator.py
Other components
- IoT simulator actor
- Administrator
- EventBridge scheduler
- API Gateway
- Measurements table
- Device and alert data
- Amazon DynamoDB
- AWS Lambda
- Amazon SNS
- SSM Parameter Store
- Amazon S3
Connections 40
- IoT simulator actor → Sensor simulator: runs
README.md - Sensor simulator → API Gateway: sends readings
README.md - API Gateway → Measurement ingestion: routes requests
README.md - Measurement ingestion → Input validation: validates
backend/ingest/app.py - Measurement ingestion → DynamoDB helpers: uses
backend/ingest/app.py - Measurement ingestion → Measurements table: writes readings
backend/ingest/app.py - Measurement ingestion → Device and alert data: updates device
backend/ingest/app.py - Measurement ingestion → AWS Lambda: invokes asynchronously
backend/ingest/app.py - AWS Lambda → Anomaly analysis: dispatches analysis
- Anomaly analysis → Detection rules: evaluates readings
backend/analyze/app.py - Anomaly analysis → Threshold configuration: loads thresholds
backend/analyze/app.py - Anomaly analysis → DynamoDB helpers: uses
backend/analyze/app.py - Anomaly analysis → Measurements table: reads history
backend/analyze/app.py - Anomaly analysis → Device and alert data: writes alerts and state
backend/analyze/app.py - Anomaly analysis → Amazon SNS: publishes alerts
backend/analyze/app.py - EventBridge scheduler → Offline detection: triggers checks
README.md - Offline detection → Threshold configuration: loads thresholds
backend/offline_check/app.py - Offline detection → DynamoDB helpers: uses
backend/offline_check/app.py - Offline detection → Device and alert data: marks offline; stores alerts
backend/offline_check/app.py - Offline detection → Amazon SNS: publishes alerts
backend/offline_check/app.py - EventBridge scheduler → Daily aggregation: triggers daily export
README.md - Daily aggregation → DynamoDB helpers: uses
backend/aggregate_export/app.py - Daily aggregation → Input validation: validates day
backend/aggregate_export/app.py - Daily aggregation → Statistics helpers: summarizes measurements
backend/aggregate_export/app.py - Daily aggregation → Measurements table: reads measurements
backend/aggregate_export/app.py - Daily aggregation → Device and alert data: reads alerts; stores statistics
backend/aggregate_export/app.py - Daily aggregation → Amazon S3: writes daily reports
backend/aggregate_export/app.py - Administrator → API Gateway: uses administration API
README.md - API Gateway → Device and history API: routes requests
backend/devices_query/app.py - Device and history API → DynamoDB helpers: uses
backend/devices_query/app.py - Device and history API → Measurements table: queries history
backend/devices_query/app.py - Device and history API → Device and alert data: queries devices and alerts
backend/devices_query/app.py - Device and history API → HTTP responses: formats responses
backend/devices_query/app.py - Device and history API → JWT utilities: uses token utilities
backend/devices_query/app.py - JWT authorizer → JWT utilities: verifies tokens
backend/authorizer/app.py - JWT authorizer → Logs and metrics: logs decisions
backend/authorizer/app.py - DynamoDB helpers → Amazon DynamoDB: accesses tables
backend/common/db.py - Threshold configuration → DynamoDB helpers: creates SSM client
backend/common/config.py - Threshold configuration → Logs and metrics: logs configuration issues
backend/common/config.py - Threshold configuration → SSM Parameter Store: loads parameters
backend/common/config.py