# Strong Room 24x7 Surveillance Dashboard

## PURPOSE
An interactive Streamlit + Plotly dashboard that lets an SP or control-room officer
see, at a glance, whether every strong-room centre in the district is under constant
24-hour CCTV surveillance with armed police cover. It renders a per-centre uptime
heatmap across the day, an alert timeline of camera dropouts, and headline KPIs
(cameras online, sites compliant, minutes without surveillance).

## WHY THIS MATTERS
The transcript reports a security order: CCTV cameras installed for 24-hour
surveillance plus armed police for full-scale protection. An order is only as good as
the visibility that lets a supervisor verify it. This project teaches **monitoring
visualisation**: turning raw uptime samples and shift logs into a single screen where
coverage gaps are impossible to miss — the difference between "cameras were
installed" and "surveillance held all night".

## HOW TO BUILD
1. Load camera-health samples and guard-shift records into Pandas (or query the
   integration service's SQLite DB).
2. Build a 24-hour heatmap: rows = centres, columns = hour of day, cell = fraction of
   cameras active that hour. Use `plotly.graph_objects.Heatmap`.
3. Add an alert timeline (`plotly.express.timeline` or scatter) marking each camera
   dropout with its duration.
4. Put KPI tiles at the top via `st.metric` and a `st.sidebar` date/site filter.
5. Ensure the whole page recomputes from a deterministic sample loader when no DB is
   present, so students can run it immediately.

Key snippet:
```python
import streamlit as st, plotly.graph_objects as go

st.metric("Cameras Online", online, f"{offline} down")
fig = go.Figure(go.Heatmap(
    z=hourly_uptime.values, x=list(range(24)), y=hourly_uptime.index,
    colorscale="RdYlGn", zmin=0.0, zmax=1.0,
))
st.plotly_chart(fig, use_container_width=True)
```

## WHEN TO USE IN PRODUCTION
Use it in a district control room or for a daily security briefing where a human
scans many sites and must spot the non-compliant one immediately. It suits strong
rooms, vaults, and evidence stores under an uptime mandate. Do NOT use it as the
alarm system itself — this is a read-only situational view; put hard alerting in a
service. Avoid it for a single site, where a table is enough.

## HOW IT HELPS STUDENTS
Students learn Streamlit layout, Plotly charting (heatmaps, timelines), Pandas
aggregation, and dashboard UX — the skills that turn data into decisions.

## STARTER CODE
See `starter/main.py` for a Streamlit app with sample data, heatmap and timeline
charts, an armed-guard roster view, and `# TODO` markers.
