How spider-loki/smart-ppe-monitoring-system works
Smart PPE is an industrial safety monitoring product: camera video is analyzed for worker identity and PPE compliance, attendance/compliance is recorded, and operators review live status, worker records, alerts, and reports in a web dashboard. The README documents the detection, API, dashboard, and MySQL roles; sampled source confirms worker-photo synchronization, worker-management requests, reporting utilities, and email delivery. Several page implementations and detection-to-API details were not sampled, so those connections are shown only where documentation supports them.
Main entry points: App.jsx Routes and layout · backend_app.py Backend API · ppe_stream_server.py PPE detector · email_sender.py Email alerts
Components 22
Detection and streaming
- PPE detector
backend/detection/ppe_stream_server.py - Worker photo sync
backend/detection/sync_workers.py
Backend services
- Backend API
backend/api/backend_app.py - MySQL PPE data
Web dashboard
- React entry
frontend/src/main.jsx - Routes and layout
frontend/src/App.jsx - Theme state
frontend/src/contexts/ThemeContext.jsx - Role state
frontend/src/contexts/UserRoleContext.jsx - Worker management
frontend/src/pages/Workers.jsx - Login page
frontend/src/pages/Login.jsx - Safety dashboard
frontend/src/pages/Dashboard.jsx - Attendance history
frontend/src/pages/Attendance.jsx - Compliance reports
frontend/src/pages/Reports.jsx - Alerts
frontend/src/pages/Alerts.jsx - Announcements
frontend/src/pages/Announcements.jsx - System settings
frontend/src/pages/Settings.jsx - HTTP client
frontend/src/api/client.js
Shared utilities
- Email alerts
backend/utils/email_sender.py - CSV reporting
backend/utils/report_utils.py
Other components
- Camera
- Dashboard user
- SMTP server
Connections 23
- Camera → PPE detector: supplies video
README.md - PPE detector → Backend API: records attendance
README.md - PPE detector → Dashboard user: streams video
README.md - Worker photo sync → Backend API: fetches worker photos
backend/detection/sync_workers.py - Backend API → MySQL PPE data: reads and writes
backend/api/backend_app.py - Backend API → CSV reporting: generates CSV reports
backend/api/backend_app.py - Backend API → Email alerts: sends violation alerts
backend/api/backend_app.py - Dashboard user → React entry: opens dashboard
README.md - React entry → Routes and layout: renders
frontend/src/main.jsx - Routes and layout → Theme state: provides theme state
frontend/src/App.jsx - Routes and layout → Role state: provides role state
frontend/src/App.jsx - Routes and layout → Login page: routes to
frontend/src/App.jsx - Routes and layout → Safety dashboard: routes to
frontend/src/App.jsx - Routes and layout → Worker management: routes to
frontend/src/App.jsx - Routes and layout → Attendance history: routes to
frontend/src/App.jsx - Routes and layout → Compliance reports: routes to
frontend/src/App.jsx - Routes and layout → Alerts: routes to
frontend/src/App.jsx - Routes and layout → Announcements: routes to
frontend/src/App.jsx - Routes and layout → System settings: routes to
frontend/src/App.jsx - Worker management → HTTP client: calls
frontend/src/pages/Workers.jsx - HTTP client → Backend API: sends API requests
README.md - Email alerts → MySQL PPE data: loads alert settings
backend/utils/email_sender.py - Email alerts → SMTP server: sends messages
backend/utils/email_sender.py