Every system has a gap between what it knows and what it can do. RAPID AI’s gap is precisely documented: 451+ engineering rules, 320 failure modes, 100 IMS rows, 300 imperfection rules, 88 FRETTLSM factors — all defined as data. This chapter maps the path from current state to production deployment.
├── rapid/ ← RAPID AI Engine (:8000) — 1332 tests
├── horizon/ ← Horizon Dashboard (:5173) — SvelteKit canvas, bits-ui, SSR
├── sense/ ← RAPID Sense — sensor-agnostic data pipeline
│ ├── backend/ ← FastAPI (:8001) — 44 tests (ingest, DSP, bridge, pairing)
│ └── mobile/ ← SenseMobile PWA on CF Workers — 129 DSP tests
├── contracts/ ← OpenAPI SSOT chain (Pydantic → OpenAPI → TypeScript)
├── infra/ ← Docker + Dockerfiles
└── docs/ ← This documentation (30+ chapters)
Component Status Tests Detail Five-module pipeline (A→E) Complete 1332 Signal → Faults → Fusion → Prognostics → Maintenance Rule evaluator Complete — 263 active (126 component + 121 signal + 16 guard) SEDL entropy + SSI fusion Complete — 22 BSR rules, 4 system states AI diagnostician (DDE) Complete — Gemini-powered narrative reports Horizon canvas dashboard Complete 0 errors Route-per-level SvelteFlow, edit lock, bits-ui RAPID Sense backend Complete 44 Ingest, DSP, quality, bridge, pairing, sessions SenseMobile PWA Live 129 Dual-sensor capture, session flow, ISO gauge Contract layer (SSOT) Complete — Pydantic → OpenAPI → TypeScript types Auth + RBAC Complete — better-auth, 4 roles, admin-only creation PostgreSQL + pgvector Complete — 15 domain tables, Drizzle migrations Docker Compose Complete — 3-service stack with hot-reload
Feature Status Accelerometer capture (60Hz) ✅ Microphone capture (44.1kHz) ✅ Dual-sensor mode (accel + mic) ✅ Client-side DSP (RMS, peak, kurtosis, FFT, ISO) ✅ Session-based multi-capture ✅ IndexedDB offline buffer + sync ✅ QR-based sensor pairing ✅ bits-ui Dialog + Tabs ✅ View transitions ✅ iOS PWA meta tags + safe areas ✅ CSP security headers ✅ SPA deep-link fallback ✅ Memory caps (5min accel, 2min mic) ✅ Snapshot state preservation ✅ prefers-reduced-motion ✅
CF Workers ← SenseMobile PWA (static SPA, edge-distributed)
VPS (Coolify) ← RAPID Engine (:8000) + Sense Backend (:8001) + Horizon (:5173)
PostgreSQL ← Shared DB (pgvector, Drizzle migrations)
Goal: Make RAPID Sense impeccable — the best phone vibration tool in the market.
Goal: Client-side ML for instant fault classification without backend roundtrip.
Training (Python, server-side):
Labeled FFT spectra → train CNN classifier
→ bearing defect / imbalance / misalignment / looseness / normal
→ export SavedModel → tensorflowjs_converter → model.json
Inference (browser, Web Worker):
Phone capture → FFT → tf.loadLayersModel() → predict()
→ instant fault classification (no network needed)
→ cross-validate with RAPID Engine result when online
Goal: Camera-based displacement measurement via Eulerian Video Magnification.
Accel (60Hz) → severity, low-freq faults
Mic (44.1kHz) → bearing defects, gear mesh, envelope
Camera (120fps) → visual displacement, sub-pixel tracking
Three-signal cross-validation → highest confidence diagnosis
MIT Eulerian Video Magnification (Rubinstein et al.)
Real-time mobile motion amplification (arXiv:2206.08422)
OpenCV.js WASM compilation for browser
Goal: Support any vibration sensor, not just phones.
Tier 1: Phone built-in (free)
├── Accelerometer (60Hz) — screening
├── Microphone (44.1kHz) — contact vibration
├── Camera (30-120fps) — visual displacement
└── TensorFlow.js — on-device ML
Tier 2: USB-C External ($200-500)
├── Digiducer 333D01 — piezoelectric, 1Hz-20kHz
├── Any USB-C accelerometer — shows up as audio input
└── Same Web Audio API code path — zero additional code
Tier 3: BLE Wireless ($300-2500)
├── SKF QuickCollect — Web Bluetooth API
├── Custom MEMS (ADXL345 + nRF52) — DIY $50 sensor
└── New code path (Web Bluetooth)
Tier 4: Industrial Integration
├── MQTT → Sense Backend (RPi + MEMS agents)
├── OPC-UA → adapter service
├── CSV/WAV upload through Horizon UI
└── SCADA historian adapters
Goal: Sense data visible on the factory canvas.
Fleet-level SSI overview: all assets across all plants
Comparative analysis: same equipment type across plants
Worst-first ranking by failure probability
Plant dependency graph visualization
Self-service tenant provisioning
Asset import wizard (CSV → registry → sensor mapping)
Guided IMS configuration
Onboarding validation with sample data
Package rules by industry vertical
Version-controlled rule packs
Install/upgrade/rollback workflow
Layer Language Rationale Engine (Ring 0) Python NumPy/SciPy DSP, physics rules, ML training Server (Ring 1) Python (FastAPI) Best REST framework, Pydantic validation Frontend (Ring 2) TypeScript (SvelteKit) Svelte 5 runes, canvas-first UI PWA (Ring 2) TypeScript (SvelteKit) Client-side DSP, TF.js inference Contract bridge OpenAPI Pydantic → JSON → TypeScript types
Service Platform Rationale SenseMobile PWA CF Workers Static SPA, edge, SPA fallback RAPID Engine VPS (Coolify) PostgreSQL, long-running DSP Sense Backend VPS (Coolify) DB writes, service-to-service calls Horizon VPS (Coolify) SSR, SSE streams, better-auth
Library Product Purpose fft.js Sense PWA Client-side FFT (phone data) TensorFlow.js Sense PWA (future) On-device fault classification OpenCV.js Sense PWA (future) Video-based vibration bits-ui Both frontends Headless UI primitives (a11y) @xyflow/svelte Horizon Factory canvas Chart.js → uPlot Both (migration) Signal visualization SvelteKitPWA Sense PWA Service worker + manifest
When to adopt SvelteKit remote functions? Experimental but powerful. Wait for stable release, then migrate Horizon BFF.
uPlot vs Chart.js: Run bundle analysis first, then decide. uPlot is 4x smaller but less feature-rich.
Shared UI package (@rapidai/ui): Trigger when SeverityGauge appears in both apps (Rule of Three).
ARQ for swarm task queue: Only when /agent SSE endpoint goes live.
Capacitor vs PWABuilder: PWABuilder first (free, zero code changes), Capacitor when CoreMotion needed.
Standard Relevance ISO 13374 Condition monitoring — full 6-level compliance target ISO 55000/55001 Asset management maturity model ISO 10816-1 Vibration severity classification (implemented in Sense PWA)
Version Date Author Changes 3.0.0 2026-03-26 Rick D Complete rewrite: added RAPID Sense, multi-sensor strategy, ML roadmap, video vibration, deployment architecture, technology decisions 2.1.0 2026-03-17 Rick D Added standards alignment, living doc metadata, changelog 2.0.0 2026-03-17 Rick D Enriched with production codebase content 1.0.0 2026-03-17 Rick D Initial chapter creation