# AegisVision — Unified Console (UI Plan) Pure-HTML + Tailwind replacement for the React dashboard, plus the analysis of what makes this an "ultimate" surveillance command center. Served directly by FastAPI (no build step). --- ## 1. Why rebuild - React app duplicated views, hardcoded the API host, and carried orphaned MUI/Firebase pages. - A monitored (no-build) HTML + Tailwind console is simpler to deploy (served by the same FastAPI process), theme-consistent, and instantly hackable. - Backend now exposes a typed API (11 route groups) plus WS alerts — the UI just needs to consume it well. ## 2. Feature analysis — what makes the "ultimate" console ### Must-have (already in API, needs first-class UI) - **Live multi-camera grid** — per-cam MJPEG feed, camera selector, online/offline badges, snapshot. - **Live occupancy** (gate): currently-inside, peak, today entries/exits. - **Incident feed** — severity badges, live WS push (ALERT / ALERT_RESOLVED), toast + sound, resolve. - **Personnel roster** — Enroll via photo upload, delete; search. - **Productivity / Health tables** — per-person state, drowsiness/posture badges. - **Spatial assets** — register asset with **visual bbox picker** (click-drag on the camera still), owner, live status badges. - **Copilot** — chat UI w/ quick-prompt chips. - **Analytics** — Chart.js time-series (attendance/productivity/alerts) + per-person daily summary. ### New "ultimate" additions in this build - **Auth + admin panel**: login page, JWT session, admin-only actions (enroll/delete, asset CRUD, alert resolve, system logs). Operator read-only view. - **System health**: camera worker status, uptime, DB + vector counts, live log tail, config summary. - **Occupancy trend chart** + alert severity breakdown on the dashboard. - **Global search** across personnel + incidents. - **Responsive dark "command-center" theme**; keyboard shortcuts (1–0 to switch views, `/` search). ### Next (post-MVP, in PLAN.md phases) - Export CSV of any table · multi-site health · watchlist/biometry · retention policy UI · real estate/floor heatmaps · PWA offline · i18n. --- ## 3. UI architecture (pure HTML + Tailwind, no framework) ``` frontend/ login.html # admin/operator sign-in index.html # console shell: sidebar + topbar +
css/app.css # small custom layer (scrollbars, animations) on top of Tailwind CDN js/api.js # fetch wrapper (Authorization header, 401→login), WS helper js/main.js # router (hash-based), sidebar/state, toast, clock, logout js/views/dashboard.js # KPIs, occupancy, occupancy trend + alert chart js/views/live.js # MJPEG grid, snapshot, asset bbox picker overlay js/views/attendance.js # in/out table + per-person day summary modal js/views/productivity.js # per-person state table js/views/health.js # drowsiness/posture/fatigue table js/views/assets.js # register/list/delete assets (uses bbox picker) js/views/incidents.js # alert feed, filter, resolve js/views/copilot.js # chat js/views/analytics.js # Chart.js hourly series (multi-metric) js/views/personnel.js # enroll modal + table + delete (ADMIN) js/views/system.js # system health / logs / config (ADMIN) ``` - **Tailwind**: Play CDN (`