How arjunbalaji123/campus-energy-consumption-and-anomaly-detection-system- works
Campus Energy Intelligence is a dashboard-backed service for exploring campus energy, predicting expected loads, and investigating anomalies. The main workflow runs from a user-selected dashboard view through frontend API requests to FastAPI endpoints, which query persisted readings or invoke prediction and anomaly analysis; results return to the dashboard. The README documents preprocessing, feature engineering, model evaluation, severity classification, contextual explanations, and the major analytics, exploration, and settings capabilities. Some endpoint and frontend relationships are documented in the source index or API paths; unsampled implementation details are not inferred.
Main entry points: api.ts API client · App.tsx Dashboard router · main.py FastAPI application · campus.py Campus prediction
Components 31
Dashboard
- Dashboard router
frontend/src/App.tsx - Overview
frontend/src/pages/Overview.tsx - Energy analytics
frontend/src/pages/EnergyAnalytics.tsx - Building intelligence
frontend/src/pages/BuildingIntelligence.tsx - Facility predictor
frontend/src/pages/FacilityPredictor.tsx - Prediction analysis
frontend/src/pages/PredictionAnalysis.tsx - Anomaly center
frontend/src/pages/AnomalyCenter.tsx - Anomaly investigation
frontend/src/pages/AnomalyInvestigation.tsx - Model performance
frontend/src/pages/ModelPerformance.tsx - Data explorer
frontend/src/pages/DataExplorer.tsx - Settings
frontend/src/pages/SettingsPage.tsx - API client
frontend/src/services/api.ts
API
- FastAPI application
backend/app/main.py - Campus prediction
backend/app/api/endpoints/campus.py - Energy analytics API
backend/app/api/endpoints/analytics.py - Building API
backend/app/api/endpoints/buildings.py - Overview API
backend/app/api/endpoints/overview.py - Prediction API
backend/app/api/endpoints/predictions.py - Anomaly API
backend/app/api/endpoints/anomalies.py - Model metrics API
backend/app/api/endpoints/model_info.py - Telemetry explorer API
backend/app/api/endpoints/data_explorer.py - Pipeline control
backend/app/api/endpoints/pipeline.py - API schemas
backend/app/schemas/api_schemas.py
Energy intelligence
- Telemetry preprocessing
backend/app/ml/data_pipeline.py - Load predictor
backend/app/ml/predictor.py - Anomaly analysis
backend/app/ml/anomaly_engine.py - Dataset and training seeder
backend/app/ml/seeder.py
Persistence
- Runtime settings
backend/app/core/config.py - Database sessions
backend/app/core/database.py - Energy records
backend/app/models/db_models.py
Other components
- Campus user
Connections 48
- Campus user → Dashboard router: uses
README.md - Dashboard router → Overview: routes to
frontend/src/App.tsx - Dashboard router → Energy analytics: routes to
frontend/src/App.tsx - Dashboard router → Building intelligence: routes to
frontend/src/App.tsx - Dashboard router → Facility predictor: routes to
frontend/src/App.tsx - Dashboard router → Prediction analysis: routes to
frontend/src/App.tsx - Dashboard router → Anomaly center: routes to
frontend/src/App.tsx - Dashboard router → Anomaly investigation: routes to
frontend/src/App.tsx - Dashboard router → Model performance: routes to
frontend/src/App.tsx - Dashboard router → Data explorer: routes to
frontend/src/App.tsx - Dashboard router → Settings: routes to
frontend/src/App.tsx - Overview → API client: requests data
frontend/src/pages/Overview.tsx - Energy analytics → API client: requests data
frontend/src/pages/EnergyAnalytics.tsx - Building intelligence → API client: requests data
frontend/src/pages/BuildingIntelligence.tsx - Facility predictor → API client: requests prediction
frontend/src/pages/FacilityPredictor.tsx - Prediction analysis → API client: requests data
frontend/src/pages/PredictionAnalysis.tsx - Anomaly center → API client: requests anomalies
frontend/src/pages/AnomalyCenter.tsx - Anomaly investigation → API client: requests detail
frontend/src/pages/AnomalyInvestigation.tsx - Model performance → API client: requests metrics
frontend/src/pages/ModelPerformance.tsx - Data explorer → API client: requests readings
frontend/src/pages/DataExplorer.tsx - Settings → API client: runs pipeline
frontend/src/pages/SettingsPage.tsx - API client → Campus prediction: calls campus routes
frontend/src/services/api.ts - API client → Overview API: calls summary
frontend/src/services/api.ts - API client → Energy analytics API: calls trends
frontend/src/services/api.ts - API client → Building API: calls building routes
frontend/src/services/api.ts - API client → Prediction API: calls analysis
frontend/src/services/api.ts - API client → Anomaly API: calls anomaly routes
frontend/src/services/api.ts - API client → Model metrics API: calls metrics
frontend/src/services/api.ts - API client → Telemetry explorer API: calls explorer routes
frontend/src/services/api.ts - API client → Pipeline control: calls pipeline
frontend/src/services/api.ts - FastAPI application → Campus prediction: registers routes
backend/app/main.py - FastAPI application → Overview API: registers routes
backend/app/main.py - FastAPI application → Energy analytics API: registers routes
backend/app/main.py - FastAPI application → Building API: registers routes
backend/app/main.py - FastAPI application → Prediction API: registers routes
backend/app/main.py - FastAPI application → Anomaly API: registers routes
backend/app/main.py - FastAPI application → Model metrics API: registers routes
backend/app/main.py - FastAPI application → Telemetry explorer API: registers routes
backend/app/main.py - FastAPI application → Pipeline control: registers routes
backend/app/main.py - Campus prediction → Load predictor: invokes prediction
backend/app/api/endpoints/campus.py - Campus prediction → Anomaly analysis: invokes analysis
backend/app/api/endpoints/campus.py - Campus prediction → Telemetry preprocessing: uses features
backend/app/api/endpoints/campus.py - Pipeline control → Dataset and training seeder: runs seeding
backend/app/api/endpoints/pipeline.py - Dataset and training seeder → Telemetry preprocessing: generates features
backend/app/ml/seeder.py - Dataset and training seeder → Load predictor: trains model
backend/app/ml/seeder.py - Dataset and training seeder → Anomaly analysis: trains detector
backend/app/ml/seeder.py - Energy analytics API → Database sessions: queries readings
backend/app/api/endpoints/analytics.py - Overview API → Database sessions: queries summary
backend/app/api/endpoints/overview.py