Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heist Detection Service (HDS) // "The Tabletop Twin"

A poc for a high-performance distributed system designed to secure high-value logistics through multi-modal sensor fusion, real-time edge intelligence, and a secure mission control dashboard.


🏗 System Architecture

The HDS utilizes a Hot/Cold Path architecture to ensure sub-millisecond situational awareness while maintaining a permanent forensic audit trail.

1. Intelligent Edge (Bun/Elysia)

  • Sensor Fusion Engine: 10Hz simulation loop fusing Telemetry, GPS Geofencing, and Computer Vision.
  • Black Box DVR: A memory-resident circular buffer recording the last 10 frames of context.
  • Edge AI: Runs MobileNet v2 ONNX models for real-time threat detection (Weapons, Masks).
  • Binary Burst Protocol: Streams raw binary JPEGs via Multipart Ingestion directly to the "cloud".

2. High-Performance Data Plane (Redis)

  • Hot Path: Active incidents and binary evidence are pushed directly into Redis memory for instant UI distribution.
  • Heartbeat Link: 1Hz real-time telemetry streaming ensuring the map and operational metrics are always live.
  • Pub/Sub: Orchestrates sub-millisecond event broadcasting across the Tower infrastructure.

3. Control Tower (SvelteKit/Postgres)

  • Mission Control: A professional triptych dashboard visualizing live GPS tracking, telemetry, and forensic analysis.
  • Forensic Timeline: Interactive "Black Box" scrubber allowing operators to view context frames preceding an alert.
  • Hardened Security: Zero hardcoded secrets. Strict environment-driven authentication for both M2M Ingestion (Headers) and Browser Consumption (Query Tokens).
graph TD
    subgraph EDGE ["Intelligent Edge (On Truck)"]
        Sensors[Telemetry & RF] --> Fusion[Fusion Engine]
        Camera[Camera Feed] --> DVR[Black Box DVR]
        Camera --> Vision[ONNX Inference]
        Vision --> Fusion
        Fusion --"BINARY BURST"--> Transport[Secure Uplink]
    end
    
    subgraph CLOUD ["The Tower (BFF)"]
        Ingest[Ingestion API] --> Redis[(Redis Hot Path)]
        Ingest --> Svc[Alert Service]
        Svc --> DB[(Postgres Cold Path)]
        Svc --> Disk[(Forensic Disk Archive)]
        Redis --"SSE Stream"--> UI[Operator Dashboard]
    end
    
    Transport --"Multipart + Auth"--> Ingest
Loading

🚀 Execution & Task Runner

The project is managed via a root-level Task Runner.

Prerequisites

Before running the system, ensure you have the following installed:

  • Docker & Docker Compose (for container orchestration)
  • Bun (v1.x) or Node.js (v20+) (for local scripting and testing)

4. Quick Start

Prerequisites: Docker & Docker Compose.

Step 1: Launch the System

# Spin up Edge, Tower, and Database
docker-compose -f heist-poc/docker-compose.yml up --build -d

Step 2: Initialize Data

Run the setup script to sync the database schema and seed the Cargo Manifests.

cd heist-poc && ./scripts/db_sync.sh

Step 3: Open the Dashboard

Navigate to http://localhost:5173. You will see the "Live Map" and the "Safe" status indicator.

  1. Running the Demo

The system includes a CLI Control Panel to inject scenarios into the Edge simulation.

Run the Demo:

./demo.sh

Access the Mission Control Dashboard at: http://localhost:5173

🧪 Operational Scenarios

Use the Task Runner or npm run demo to verify the system logic:

  • NORMAL: Nominal operation. Map shows Green. Dashboard is quiet.
  • FLAT_TIRE: Mechanical stop detected. Map turns Orange. Sidebar logs "Mechanical Stop" WARNING.
  • RECKLESS_DRIVING: High-velocity anomaly (>90 MPH). Map remains Green/Orange. Sidebar logs "Excessive Velocity" WARNING.
  • HEIST: Hostile takeover. RF Jamming detected + Vehicle Stop + AI Visual confirmation. Map turns Red. Dashboard flashes. CRITICAL alert reveals the Forensic Timeline context.

🤖 Agentic & QA Validation

HDS is designed for modern automated environments:

  • Playwright Suite: Run npm run test:e2e for a full multi-modal validation of all scenarios.
  • MCP Interface: Prototype Model Context Protocol server available at /tools/mcp-server.ts for AI-agent system driving.

About

Multi-modal, sensor fusion distributed system poc that showcases spec-driven development.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages