Digital T3

Revolutionizing Industrial Worker Safety

Accelerating EHS Application Engineering with AI: Renewi’s 2-Day BRD-to-Build Blueprint for Real-Time CCTV-Based PPE & Worker Safety Monitoring

This production use case build demonstrates a full end-to-end, prompt-engineering-driven SDLC in action: an industrial-grade PPE Compliance & Worker Safety Monitoring Platform, architected directly from a Business Requirements Document (BRD) and built on a pre-trained YOLOv8 computer vision model, into a fully functional, stakeholder-ready, cloud-native application in just 48 hours. What typically requires months of human sprint cycles — requirements analysis, AI infrastructure design, backend services, compliance data pipelines, and enterprise frontend dashboards — was executed methodically through structured AI collaboration, with the Principal Solution Architect directing and the AI acting as lead engineer across every layer.

Managing PPE compliance across industrial worksites is one of the most manual, high-risk operational challenges in the EHS sector. Ensuring workers continuously wear required safety equipment — hard hats, high-visibility vests, and other PPE — across multiple zones and CCTV-monitored areas cannot be reliably enforced through human observation alone. Observer fatigue, delayed inspection cycles, absence of photographic evidence, and the impossibility of simultaneous multi-zone monitoring leave organisations exposed to regulatory liability, safety incidents, and audit failures.

Renewi tackled this high-stakes operational problem head-first. The platform delivers always-on AI-driven PPE violation detection, real-time alert generation, restricted zone intrusion monitoring, and executive-grade analytics dashboards — backed by annotated photographic evidence and a full audit trail. The following is the detailed account of how this platform was engineered from BRD to production in 48 hours.

Target

Purpose and Value Proposition

The core mandate for worker safety in regulated industrial environments is strictly defined by regulations including ISO 45001, OSHA 1910, and COSHH in the UK. Manual PPE enforcement workflows are fragile — introducing significant risk during site operations, compliance spot-checks, and incident reporting. Relying on CCTV footage reviewed only after incidents, manual sign-off sheets, and disjointed supervision rosters leaves massive traceability gaps and creates a reactive rather than preventive safety posture.

This platform was engineered to eliminate those gaps. By leveraging a structured AI-driven build process to translate complex operational requirements — specifically derived from the Renewi EHS Lighthouse BRD — into a fully governed, automated detection system, the team delivered a platform that identifies PPE violations in real time, generates evidentiary snapshots at the moment of violation, and maintains a complete audit trail satisfying the traceability standards required by EHS compliance frameworks.

How It Can Be Used

  • HSE Directors / EHS Managers: Monitor live violation rates, active alert volumes, and compliance trends across all monitored zones via the executive KPI dashboard. View violation timelines and drill into specific incidents for audit readiness.
  • Site Supervisors / Safety Officers: Receive real-time push alerts the moment a PPE violation or restricted zone intrusion is detected. Review annotated photographic evidence directly in the platform and acknowledge alerts with a traceable digital action.
  • Platform Architects / Engineering Leads: Access production-ready backend service architecture built on SOLID principles, a clean FastAPI layer with 11 REST and WebSocket endpoints, Supabase PostgreSQL repositories, and Docker Compose deployment topology.
  • Quality & Compliance Auditors: Execute full audit readiness by inspecting violation evidence packages, tracing alerts back to originating detection events, verifying SHA-annotated snapshot URLs in Supabase Storage, and reviewing the complete event and alert audit log.
  • Executive Stakeholders / Innovation Teams: Open the enterprise React dashboard and experience a fully working, stakeholder-presentation-ready AI safety monitoring platform — from live stream detection through evidence forensics and analytics — without requiring any manual setup.

Value Provided

  • Requirement-to-Code Precision: Every high-level EHS requirement — from real-time helmet violation detection to polygon-based restricted zone enforcement — was mapped directly to production FastAPI endpoints, Pydantic validation schemas, Supabase repository methods, and React dashboard components. The rule engine, temporal smoothing logic, and event deduplication mechanism were all implemented in strict alignment with the original BRD specification.
  • Sub-2-Second Violation Alert Generation: The YOLOv8 inference pipeline (FR-02) completes single-image detection in under 200ms on CPU and under 50ms on GPU in testing. Combined with the temporal smoothing rule engine enforcing a 1.5-second violation persistence window and the WebSocket push channel to the dashboard, end-to-end alert delivery from violation event to dashboard notification occurs in under 2 seconds.
  • Evidence-First Safety Enforcement: Every confirmed violation triggers an annotated snapshot generation pipeline: bounding boxes, class labels, and confidence scores are rendered directly onto the captured frame, uploaded to Supabase Storage, and linked to the event record with a permanent public URL. Audit teams receive photographic evidence for every alert without manual screenshot workflows.
  • Zero Model Training Overhead: The platform treats the pre-trained YOLOv8 model (best.pt — trained on 23,000+ industrial images, mAP50 86.6% for helmets, 93.5% for safety vests, 85.3% for gloves) as a production-ready external AI asset. No dataset collection, labeling, fine-tuning, or training infrastructure was required. The full engineering effort was invested in the platform layer around the model.

•        Model Asset & Attribution:The platform utilizes the best.pt model weights from the Workspace Safety Detection repository created by Hafiz Qaim (https://github.com/hafizqaim/Workspace-Safety-Detection-using-YOLOv8).

Licensing & Compliance Note: The core YOLOv8 model architecture and pre-trained weights are governed by the GNU AGPL-3.0 License via Ultralytics. While the surrounding enterprise platform layers (FastAPI backend infrastructure, Supabase data pipelines, and React dashboard) are engineered to a production-ready standard, any commercial production deployment of the underlying model asset must strictly adhere to AGPL open-source copyleft provisions or secure an upstream commercial enterprise license from Ultralytics.

  • Complete Audit Trail by Default: Every detection, event, alert, and acknowledgement action is logged in Supabase with UTC timestamps, camera source attribution, and user identity. The event lifecycle — NEW → ACTIVE → ACKNOWLEDGED → RESOLVED — is fully traceable, providing the complete audit evidence required for EHS incident reporting and regulatory inspection.

Technique: The Kavia AI Streamlined Workflow

The technique used to build this platform represents a fundamental shift in how EHS software systems can be engineered. Traditional delivery of a platform of this complexity — encompassing computer vision AI services, real-time streaming architecture, a multi-table cloud database, an enterprise React dashboard, and production Docker deployment — would typically require 4–6 weeks of sprint cycles across specialised engineers.

This delivery compressed that timeline to 48 hours by positioning a structured, prompt-engineering-driven AI collaboration workflow as the primary delivery mechanism. The Principal Solution Architect acted as strategic director, compliance authority, and integration decision-maker — directing the AI through a three-stage build pipeline that sequentially produced every platform layer from architecture documentation through to deployed frontend.

Crucially, the AI did not just “write code.” It acted as the lead architect and planner — ingesting the full BRD, decomposing requirements into functional service boundaries, generating sequence diagrams for complex operations like the RTSP stream inference pipeline and the alert lifecycle state machine, and producing enterprise-grade implementation decisions. This rigorous AI-driven planning phase minimized requirement drift and ensured the YOLOv8 inference singleton pattern, temporal rule engine, and Supabase repository architecture were designed correctly before a single line of implementation code was produced.

 

The Platform Stack Defined at Architecture Stage: React + TypeScript + TailwindCSS + Framer Motion (Frontend) | Python 3.11 + FastAPI + Ultralytics YOLOv8 + OpenCV (Backend) | Supabase PostgreSQL + Supabase Storage (Data)

Model Asset: YOLOv8 best.pt — Workspace Safety Detection. Trained on 23,000+ images. mAP50: head_helmet 86.6%, vest 93.5%, hand_noglove 85.3%. Treated as a production-ready external asset — zero retraining required.

 

Project Timeline and the 2-Day Build

Below is the high-velocity pipeline followed to build the PPE Compliance & Worker Safety Monitoring Platform from BRD to a fully functional, stakeholder-ready application:

  1. Requirement Ingestion and Solution Architecture Design

The build began with the AI ingesting the Renewi EHS Lighthouse BRD in full, performing an automated decomposition into user stories, functional requirements, and non-functional requirements. Within the first session, the AI drafted a complete 22-section Solution Architecture Document (SAD) covering Executive Summary, Business Context, Objectives, Scope, Assumptions, Constraints, all Functional and Non-Functional Requirements, End-to-End Architecture, Component Architecture, AI/ML Architecture, Data Flow Architecture, Security Architecture, Integration Architecture, and Deployment Architecture.

It generated detailed Mermaid-syntax architecture diagrams for the full system topology, the AI inference pipeline, the alert lifecycle state machine, and the Supabase integration layer — establishing the complete engineering blueprint before any implementation began. Technology stack decisions were formally documented at this stage with explicit rationale for each choice, ensuring architectural consistency across all subsequent build phases.

  1. Backend Implementation — FastAPI + YOLOv8 AI Services

With the architecture blueprint established, the AI implemented the backend as a robust Python 3.11 microservice architecture using FastAPI, built around a singleton YOLOInferenceService that loads best.pt exactly once during application startup via the FastAPI lifespan context manager. The model is never reloaded per request, ensuring consistent sub-200ms inference latency across the service lifetime.

The backend delivered the following core service components:

  • YOLOInferenceService: Singleton model loader and inference orchestrator supporting image upload, video file processing with configurable frame sampling, and RTSP live stream processing. Runs inference in a thread pool executor to preserve async FastAPI event loop performance.
  • RuleEngine + TemporalSmoothingEngine: Evaluates detections against three violation rules — missing helmet, missing safety vest, missing gloves. Enforces a 1.5-second persistence window before violation confirmation, preventing false positive alerts from momentary occlusions or frame noise.
  • RestrictedZoneEngine: Polygon-based digital geofencing using zones.yaml camera configuration. Point-in-polygon validation identifies persons inside configured hazard areas per camera source.
  • AlertService + EventService: Full event lifecycle management (NEW → ACTIVE → ACKNOWLEDGED → RESOLVED) with deduplication logic preventing duplicate alert storms for ongoing violations.
  • SnapshotService: Renders annotated violation frames with bounding boxes and confidence scores using OpenCV, uploads to Supabase Storage, and writes the public URL to the event record in PostgreSQL.
  • Supabase Repository Layer: Clean repository classes for all five database tables — events, alerts, detections, audit_logs, users — with async Supabase client integration and structured error handling.

The AI also established the clean folder architecture: src/api/, src/services/, src/repositories/, src/core/, src/schemas/, src/config/, src/middleware/, src/utils/ — strictly enforcing separation of concerns and SOLID principles throughout.

For quality assurance, a comprehensive Pytest unit test structure was generated covering route wiring, inference service contracts, rule engine logic, and repository interaction patterns.

  1. Frontend Build — Enterprise React Dashboard

The AI then generated a premium enterprise-grade React + TypeScript frontend, purpose-built to communicate industrial safety, operational intelligence, and AI-powered decision support — inspired by Palantir Foundry, Datadog, and modern NOC command centres. The interface uses a professional dark theme, subtle glassmorphism, Framer Motion animations, and enterprise visual hierarchy rather than generic admin templates.

The dashboard is structured as a ten-section single-page application with smooth scrolling and animated transitions:

  • Hero Section: Full-screen animated landing with particle/grid effects, platform branding, and AI safety messaging — optimised for executive demonstrations and stakeholder presentations.
  • Live Operations Bar: Sticky system health status bar with real-time indicators for Model, Database, Storage, and WebSocket connectivity using Font Awesome icons and animated status chips.
  • KPI Command Centre: Executive glassmorphism KPI cards with count-up animations displaying Total Events, Active Alerts, Helmet Violations, Gloves Violations, Vest Violations, and Zone Intrusions.
  • AI Video Analysis Centre: Image and video upload interface with real-time detection overlay rendering — bounding boxes, confidence scores, and violation colour coding: green (compliant), amber (warning), red (violation).
  • Real-Time Event Timeline: WebSocket-driven live event feed consuming /ws/events with staggered Framer Motion insertion animations, severity indicators, snapshot thumbnails, and camera attribution.
  • Alert Management Centre: Active alert console with full acknowledge workflow. All actions update instantly via React Query cache invalidation — no page refresh required.
  • Evidence & Forensics Viewer: Professional incident review panel with zoom support, bounding box metadata, confidence scores, and event history — designed to resemble enterprise investigation tooling.
  • Analytics Dashboard: Animated Recharts visualisations covering violations over time, event trends, alert distribution, PPE compliance breakdown, and zone intrusion frequency.
  • Platform Architecture Flow: Animated AI pipeline diagram for stakeholder demonstrations: Camera Feed → AI Detection → Rule Engine → Event Generation → Alert → Supabase → Dashboard.
  • Enterprise Footer: Professional footer with platform version, backend status, model version, and build metadata — no marketing clutter.

Deployment / Hosting: Production-Grade Orchestration via Kavia AI

The platform bridges enterprise-grade architecture with seamless execution by deploying a production Docker topology natively hosted through Kavia AI. Rather than forcing a choice between raw configuration and automated simplicity, Kavia AI ingests and parses the repository’s underlying Docker Compose deployment topology directly. This eliminates the need for manual cloud infrastructure provisioning or custom DevOps scripting while preserving full architectural visibility.

  • Automated Containerization: Kavia AI automatically builds the FastAPI backend container and handles the compilation of the React frontend to serve it as a high-performance, static Nginx asset.
  • Zero-Ops Stack Orchestration: Multi‑service dependencies, networking, and environment variables are orchestrated natively with zero manual infrastructure configuration or external cloud overhead (AWS, Azure, GCP).
  • Live Operational Runtime: The deployment instantly provisions a secure, live HTTPS URL, instantiates automatic container health checks, and hooks up live log streaming directly to the Kavia AI dashboard.

Architectural Alignment: By leveraging Kavia AI to ingest the team’s production Docker configuration, the entire multi-service ecosystem transitioned from a raw repository to a live, stakeholder-ready environment in under 4 minutes—completely removing manual DevOps friction without abstracting away the underlying system design

Before vs. After: Transforming PPE Compliance Enforcement

Before — Manual PPE Enforcement

After — AI-Powered Monitoring Platform

Human observer fatigue across multiple CCTV feeds

always-on YOLOv8 inference on live RTSP streams — mitigating human observer fatigue

Violation detected only during scheduled manual inspections

Real-time violation detection with < 2-second alert delivery to dashboard

No photographic evidence at moment of PPE violation

Annotated violation snapshots auto-generated and stored in Supabase Storage

Restricted zones enforced only by physical signage

Digital polygon geofencing with real-time intrusion alerts per camera zone

Incident reports written from memory hours after events

Complete event records with UTC timestamps, camera ID, and confidence scores

No compliance trend analytics or audit-ready reporting

Executive analytics dashboard with violation trends and audit trail

 

Team: Human-AI Collaboration

This platform build was brought to life through a lean, high-trust collaboration model between a single human architect and an AI acting as the primary engineer — producing a fully functional, stakeholder-ready AI safety monitoring platform in just 48 hours. This synergy delivered a complex, cloud-native CCTV analytics system — encompassing computer vision AI, multi-service backend architecture, enterprise frontend, and production Docker deployment — in a timeline that would typically require 4–6 weeks of sprint cycles across a specialised engineering team.

How the Work Was Divided

  • The AI (Architect, Backend Developer, Frontend Developer, QA Engineer): Owned the full engineering scope — Solution Architecture Document generation, HLD/LLD design, FastAPI service implementation, YOLOv8 inference service architecture, Supabase repository layer, React + TypeScript UI across all ten dashboard sections, Docker Compose configuration, health endpoints, and the complete Pytest unit test structure.
  • The Human Collaborator (Principal Solution Architect): Provided the critical strategic layer — clarifying EHS operational context, confirming YOLOv8 model asset selection and production constraints, directing the no-retraining mandate, validating the temporal smoothing and deduplication design decisions, and confirming the enterprise dashboard design philosophy against stakeholder presentation requirements.

Conclusion

The Renewi EHS Lighthouse PPE Compliance & Worker Safety Monitoring Platform is a clear demonstration of how structured AI-driven engineering can solve real-world industrial safety challenges at enterprise scale and startup speed. By leveraging a pre-trained YOLOv8 model as a production-ready AI asset — and focusing the entire engineering effort on the platform layer, services, and user experience around it — the team delivered a solution that proves AI can build complex, cloud-native, presentation-ready enterprise software in 48 hours.

The platform goes from BRD to a fully operational CCTV analytics system: detecting PPE violations in real time, generating photographic evidence, enforcing restricted zone intrusion policies, and delivering live operational intelligence through an enterprise React dashboard — all accessible to HSE directors, site supervisors, compliance auditors, and executive stakeholders through a single browser URL.

More than a technical demonstration, this platform represents a new operating model for EHS software delivery: one where the engineering timeline is measured in hours rather than months, architectural quality is not traded for speed, and every platform requirement — from SOLID backend architecture to Framer Motion dashboard animations — is delivered to production standard in a single structured collaboration workflow.

See What We Built

The PPE Compliance & Worker Safety Monitoring Platform went from BRD to a fully functional, production-ready application in under 2 days, using AI as the primary engineer across architecture, backend, frontend, and deployment. Want to see what your EHS platform requirements can become?

Contact us to discuss your production use case build — connect@digitalt3.com

Scroll to Top