What Sentinel is
Sentinel turns existing CCTV or recorded video into an operations workflow: detect and track vehicles, estimate speed with calibrated lines, package evidence, and support human review with analytics and audit history.
| System | Role | Default URL |
|---|---|---|
| Dashboard | Auth, cameras, review, analytics | http://localhost:8080 |
| AI worker | Video processing & evidence | http://localhost:8090 |
Camera / MP4 → Python AI Worker (detect, track, speed, evidence) → Supabase (orgs, cameras, incidents, audit) → Dashboard (live, review, analytics)
Who should use it
| Audience | Typical use |
|---|---|
| Municipal / corridor teams | Screen speed risk on roads and school zones |
| Logistics hubs & fleet yards | Gate and yard speed policy monitoring |
| Industrial / warehouse sites | Internal road compliance screening |
| Campuses & checkpoints | Evidence-backed incident review |
| Operators & reviewers | Run jobs and decide on incidents |
| Org admins | Cameras, users, demo seed, audit |
Roles and permissions
| Role | Can do |
|---|---|
| org_admin | Cameras, users, demo seed, AI control, review, audit |
| operator | Start/stop AI jobs; operate monitoring |
| reviewer | Approve / reject / escalate incidents |
| viewer | Read-only operational views |
| auditor | Read-only incidents, audit history and report exports |
| super_admin | Full platform access, including camera and member management |
New sign-ups typically become org_admin of their own workspace.
Prerequisites
- Node.js 20+ for the dashboard
- Python 3.12+ for the AI worker
- Lovable Cloud / Supabase project connected
- Service role key for AI worker only (never use VITE_ prefix)
- Keep the worker private; configure matching server and worker shared secrets
First-time installation
Dashboard:
npm install npm run dev
AI worker:
cd ai-service python -m venv .venv .venv\Scripts\activate pip install -r requirements.txt copy .env.example .env # Set SUPABASE_URL + SUPABASE_SERVICE_ROLE_KEY # Place video at data/samples/road.mp4 .venv\Scripts\python.exe -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8090
Get the service role key from Lovable → Cloud → Secrets, or the linked Supabase project → Settings → API → service_role.
Daily start checklist
- Start AI worker on port 8090
- Start dashboard with npm run dev
- Confirm authenticated worker health through Backend control
- Sign in at /auth
- Select the correct organization if you belong to more than one
Dashboard map
| Page | Path | Purpose |
|---|---|---|
| Landing | / | Public product page |
| Auth | /auth | Sign in / sign up |
| Overview | /dashboard | 24h KPIs; load demo data |
| Live monitoring | /dashboard/live | Annotated stream + camera tiles |
| Backend control | /dashboard/control | Start / stop AI jobs |
| Incidents | /dashboard/incidents | Human review queue |
| Analytics | /dashboard/analytics | Trends, ranking, speed bins, CSV export |
| Validation | /dashboard/validation | Calibration QA vs reference device |
| Cameras | /dashboard/cameras | Camera setup and calibration |
| Users & roles | /dashboard/users | Members and roles |
| Audit log | /dashboard/audit | Action history (admin) |
| Settings | /dashboard/settings | Workspace + disclaimer |
End-to-end workflow
- Sign in and create/open a workspace
- Overview → Load demo data (org_admin, first time)
- Cameras → set speed limits and virtual line calibration
- Backend control → start job with data/samples/road.mp4
- Live monitoring → watch annotated stream
- Incidents → approve, reject, or escalate with notes
- Analytics & Audit → trends and compliance history
Speed calibration
Measure the real-world distance between virtual line A and line B. The worker estimates:
speed_kmh = (distance_metres / elapsed_seconds) * 3.6
Incidents are created only after multiple speed samples exceed the limit plus tolerance, with enough track duration and detection confidence.
Phase roadmap
| Phase | Scope | Status |
|---|---|---|
| 1 | Local MP4 + YOLO + ByteTrack + speed + evidence | Implemented |
| 2 | RTSP live camera support | Implemented |
| 3 | License plate recognition (OCR) | Implemented |
| 4 | Multi-camera processing (fleet + Live grid) | Implemented |
| 5 | Deeper AI analytics / reporting (CSV export) | Implemented |
| 6 | Calibration validation QA (not legal certification) | Implemented |
Configuration
Dashboard (root .env): VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY, AI_SERVICE_URL and AI_WORKER_SECRET (server-only)
AI worker (ai-service/.env): SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, SUPABASE_STORAGE_BUCKET, WORKER_SHARED_SECRET, YOLO_MODEL, DETECTOR_CONFIDENCE, SPEED_TOLERANCE_KMH
Troubleshooting
| Symptom | Fix |
|---|---|
| AI worker unreachable | Start uvicorn on 8090; check server AI_SERVICE_URL and matching worker secret |
| Jobs run but no DB incidents | Set SUPABASE_SERVICE_ROLE_KEY; restart worker |
| Video not found | Use data/samples/road.mp4 from ai-service folder |
| Cannot start job | Need org_admin or operator role |
| Cannot review | Need reviewer or org_admin role |
| Speeds look wrong | Recalibrate distance_metres and line positions |
Security notes
- Do not expose the Phase 1 AI worker to the public internet
- Never put the service role key in VITE_ variables or Git
- Treat evidence as sensitive operational data
- Analytics/screening only — enforcement needs legal approval
- Avoid force-pushing published Lovable-connected git history
First 30 minutes
- Confirm dashboard + AI health
- Sign in and open a workspace
- Load demo data
- Start a sample job on Backend control
- Watch Live monitoring
- Practice one approve and one reject on Incidents
- Skim Analytics and Audit log