# 🎯 Analytics & AI Dashboard — Quick Reference Guide

## 📋 Access the Menu
**Sidebar:** ANALYTICS & AI (icon: 📊)  
**URL:** `http://localhost:5173/ic3/?tab=<dashboard-id>`

---

## 🚀 9 Dashboards at a Glance

| # | Dashboard | Icon | URL Param | Use Case | Best For |
|---|-----------|------|-----------|----------|----------|
| 1 | **Executive Summary** | 📊 | `executive-summary` | Strategic KPIs | Managers, Directors |
| 2 | **Anomaly Detection** | 🔴 | `anomaly-detection` | Real-time alerts | Operators, Analysts |
| 3 | **Leak Detection** | 💧 | `leak-detection` | Find & fix leaks | Field Teams, Planners |
| 4 | **Pump Health** | 🔧 | `pump-health` | Maintenance scheduling | Technicians, Planners |
| 5 | **Water Quality** | 🧪 | `water-quality` | Regulatory compliance | QA, Compliance |
| 6 | **Demand Forecast** | 📈 | `demand-forecast` | Optimize pumping | Operations, Planning |
| 7 | **Root Cause** | 🔬 | `root-cause` | Incident analysis | Investigators, Engineers |
| 8 | **NRW Attribution** | 🎯 | `nrw-attribution` | Loss reduction | Asset Managers, CFO |
| 9 | **Energy Optimization** | ⚡ | `energy-optimization` | Cost reduction | Operations, Sustainability |
| Bonus | **Trends** | 📊 | `trends` | Time-series analysis | All roles |

---

## 📍 Direct Links

```
Executive Summary:        http://localhost:5173/ic3/?tab=executive-summary
Anomaly Detection:        http://localhost:5173/ic3/?tab=anomaly-detection
Leak Detection:           http://localhost:5173/ic3/?tab=leak-detection
Pump Health:             http://localhost:5173/ic3/?tab=pump-health
Water Quality:           http://localhost:5173/ic3/?tab=water-quality
Demand Forecast:         http://localhost:5173/ic3/?tab=demand-forecast
Root Cause Assistant:    http://localhost:5173/ic3/?tab=root-cause
NRW Attribution:         http://localhost:5173/ic3/?tab=nrw-attribution
Energy Optimization:     http://localhost:5173/ic3/?tab=energy-optimization
Trend Charts:            http://localhost:5173/ic3/?tab=trends
```

---

## 🎯 Key Metrics by Dashboard

### 📊 Executive Summary
- System Availability (%)
- Network Loss / NRW (%)
- Water Quality Score (/100)
- Equipment Efficiency (%)
- Critical Anomalies (count)
- Detection Latency (min)
- MTTR (min)

### 🔴 Anomaly Detection
- **Tabs:** Live | History | Config | Reports
- Anomaly count (real-time)
- Severity matrix (frequency vs. impact)
- Sensor health scores
- Alert rules configuration
- Historical patterns

### 💧 Leak Detection
- Leak probability (0-100%)
- Leak vs. Burst classification
- Location (GPS + address)
- Volume loss (m³/day)
- Repair priority (Critical/High/Med/Low)
- Leak age
- Cost impact (€)

### 🔧 Pump Health
- Fleet overview (total/operating/idle)
- Vibration (mm/s)
- Current draw (A)
- Temperature (°C)
- Runtime hours
- Efficiency degradation (%)
- Remaining Useful Life (RUL) days
- Failure probability (%)

### 🧪 Water Quality
- pH level
- Turbidity (NTU)
- Chlorine residual (mg/L)
- Coliform risk (%)
- Heavy metals
- Compliance status
- Regulatory alignment

### 📈 Demand Forecast
- 24-72 hour forecast
- Peak demand time
- Minimum Night Flow (MNF)
- Weather-adjusted projection
- Weekly patterns
- Seasonal trends
- Forecast accuracy (MAPE %)

### 🔬 Root Cause Analysis
- Incident investigation
- Causality chains
- Contributing factors (ranked)
- Similar case patterns
- Recommended actions
- Outcome tracking

### 🎯 NRW Attribution
- Real losses (%)
  - Mains leakage
  - Service connections
  - Distributed system
- Apparent losses (%)
  - Meter errors
  - Illegal connections
  - Theft/bypass
- DMA analysis
- Geographic heatmaps
- Financial impact (€)

### ⚡ Energy Optimization
- Real-time consumption (kW)
- Daily usage (kWh)
- Cost tracking (€/day)
- Carbon footprint (kg CO₂)
- Pump scheduling optimization
- VFD tuning recommendations
- Time-of-use opportunities
- Peak reduction potential

---

## 🔄 Typical Workflows

### **Morning Operations Review** (15 min)
1. **Dashboard** → Check overall health
2. **Executive Summary** → Review KPIs
3. **Alarms** → Check active incidents
4. **Anomaly Detection** → Verify no false positives

### **Weekly Maintenance Planning** (30 min)
1. **Pump Health** → Identify degrading equipment
2. **Leak Detection** → Schedule repair campaigns
3. **NRW Attribution** → Identify loss hotspots
4. **Energy** → Optimize pump schedules

### **Incident Investigation** (30-60 min)
1. **Anomaly Detection** → Find the incident
2. **Root Cause** → Identify contributing factors
3. **Trends** → Analyze before/after
4. **Leak Detection** → If water loss related
5. **Demand Forecast** → Predict recovery time

### **Compliance Reporting** (Weekly/Monthly)
1. **Water Quality** → Verify regulatory standards
2. **Executive Summary** → Document KPI performance
3. **Reports** → Generate compliance documents
4. **NRW Attribution** → Loss reduction progress

### **Long-term Planning** (Quarterly)
1. **Demand Forecast** → 3-12 month projections
2. **Pump Health** → Asset replacement planning
3. **Leak Detection** → Network rehabilitation strategy
4. **Energy** → Budget forecasting
5. **Executive Summary** → Year-over-year trends

---

## 💡 Pro Tips

### Navigation
- 🔍 Sidebar search: Click group header to expand/collapse
- ⌨️ Keyboard: Not implemented yet (but could be)
- 📱 Mobile: Sidebar collapses to icons for more space

### Data
- 🔄 Auto-refresh: WebSocket connection (see TopBar indicator)
- 📥 Export: Available in most dashboards
- 🔗 Deep linking: Use URL params to share specific views
- 📊 Trends: Available across all dashboards

### Performance
- ⚡ Fast loading: React/Vite optimized
- 🎯 Lazy loading: Dashboards load on demand
- 💾 Caching: Check network tab for 304 responses
- 🌙 Dark mode: Automatic based on system preference

---

## 🔗 Related Resources

- **Full Documentation:** `ANALYTICS_AI_MENU_DOCUMENTATION.md`
- **Source Code:** `frontend/src/modules/analytics/ai/`
- **API Docs:** [To be created]
- **Architecture:** See documentation > Architecture Overview

---

## 📞 Troubleshooting

| Problem | Solution |
|---------|----------|
| Dashboard won't load | Check browser console (F12), verify API endpoints |
| Data not updating | Check WebSocket indicator in TopBar |
| Slow performance | Check network tab, look for slow API responses |
| Layout broken | Clear cache (Ctrl+Shift+Del) and reload |
| Menu items missing | Verify sidebar group is expanded |

---

## ✅ Implementation Status

✅ **Complete:**
- All 9 dashboards implemented
- Menu navigation fully working
- TypeScript type safety
- Responsive design
- Dark theme support
- Component structure ready

⏳ **Backend Required:**
- API endpoint implementation
- ML model inference pipelines
- Real-time data streams
- Database schema

---

**Last Updated:** June 4, 2026  
**Status:** Production Ready (Frontend)  
**Next Step:** Backend API implementation
