Production
PPF Workshop Monitoring
Smart IoT SaaS for Paint Protection Film workshops. Monitors each pit continuously via ESP32 sensors, alerts owners when conditions go out of spec, tracks every job through its lifecycle, and lets customers follow their car's progress via a public link.
# Architecture
┌─────────────────────────────────────────────────┐
│ PPF WORKSHOP (on-site) │
│ │
│ [ESP32 + DHT22 / BME680 / PMS5003] │
│ │ MQTT publish (QoS 1) │
│ ▼ │
│ [Mosquitto Broker :1883] │
│ │ paho-mqtt subscriber │
│ ▼ │
│ [FastAPI Backend :8000] ── [PostgreSQL :5432] │
│ │ WebSocket push │
│ │ REST API (/api/v1/…) │
│ │
│ [Hikvision Camera] ─RTSP─▶ [MediaMTX :8554] │
│ WebRTC / HLS │
└─────────────────────────────────────────────────┘
│ │
▼ ▼
┌─────────────────────────────────────┐
│ React Frontend (:5173) │
│ Owner Dashboard · Job Management │
│ Customer Tracking · Live Video │
└─────────────────────────────────────┘
Data flow: Sensor → MQTT → Backend → DB + alerts
→ WebSocket → React UI# What It Does
Real-time Monitoring
ESP32 sensors publish temperature, humidity, and particulate matter via MQTT (QoS 1). Backend parses readings, stores in PostgreSQL, checks thresholds, and pushes alerts via WebSocket.
Job Lifecycle
Create jobs, assign staff, track status pipeline (received → in_progress → quality_check → complete). State machine prevents invalid transitions.
Customer Tracking
Public tracking link (no login needed). Customers see their car's status, vehicle info, and ETA countdown. Generated automatically when a job is created.
Live Video
Hikvision cameras stream via RTSP to MediaMTX. Frontend connects via WebRTC WHEP (primary) or HLS (fallback). Video.js 8 player.
# Key Endpoints
| Method | Endpoint |
|---|---|
| POST | /api/v1/auth/login |
| GET | /api/v1/workshops/{id}/pits |
| POST | /api/v1/workshops/{id}/jobs |
| GET | /api/v1/track/{token} |
| GET | /api/v1/pits/{id}/sensors/latest |
| POST | /api/v1/devices/{id}/command |
| WS | /ws |
# Role-Based Access
# Business Model
# Full Stack
| Backend | FastAPI 0.115 · SQLAlchemy 2 (async) · PostgreSQL 16 · Alembic · Pydantic v2 |
| Auth | JWT HS256 · bcrypt cost-12 · role-based dependency guards |
| Real-time | paho-mqtt (backend) · PubSubClient (ESP32) · native WebSocket |
| Frontend | React 18 · Vite 5 · TypeScript 5 · Redux Toolkit 2 · Tailwind CSS v3 |
| Video | MediaMTX · WebRTC WHEP (primary) · HLS (fallback) · Video.js 8 |
| Firmware | Arduino/ESP-IDF · PlatformIO · ArduinoJson 6 · WiFiManager |
| Infra | Docker Compose · Mosquitto 2 · pgAdmin 4 |
| Testing | pytest 126 backend · Playwright 8 E2E · Live ESP32 demo verified |