Desktop & IoT Tools
2023 — Present Desktop & IoT Tools Suite
Local-First Electron Apps for Privacy & Performance
Suite of 5 local-first desktop tools — ~73K lines across 114 files. ML Trainer (OpenAI-compatible API), WhatsApp Agent (20K lines with stealth + STT + vision), Scraper (25K lines, 7 scraper types), IoT Hub (automation engine + 60+ devices), and AudioHub (Python Whisper bridge).
Year
2023 — Present
Role
Full-Stack Developer
Tech Stack
10 technologies
The Challenge
- Certain workloads require local processing: ML model training on private data, WhatsApp automation needing a real browser with anti-detection, IoT device communication via MQTT/Serial, and team audio coordination
- Each tool must be standalone yet sync with Cadences cloud — local-first for privacy and hardware access, cloud-synced for data persistence and workflow triggers
- Anti-detection is critical for WhatsApp Agent and web scrapers — requiring stealth plugins, human-like behavior simulation, and rotating user agents
The Approach
- Consistent architecture: all 5 tools use Fastify for local HTTP APIs, SQLite for persistence (better-sqlite3 or sql.js WASM), and Cadences sync via WebSocket/REST
- Electron shell for tools needing OS access (ML Trainer, WhatsApp, IoT Hub, AudioHub) — Scraper runs as pure Node.js server
- Stealth layer: Playwright + puppeteer-extra-plugin-stealth with navigator.webdriver removal, plugin overrides, user agent rotation, and persistent browser contexts
- Python bridge (AudioHub): JSON-line IPC over stdin/stdout for Whisper STT + Edge TTS, with capability detection and 10s startup timeout
The Solution
- ML Trainer (11.5K lines): OpenAI-compatible API (/v1/embeddings, /v1/chat/completions, /v1/classify, /v1/entities, /v1/predict, /v1/similarity), training types: Embeddings (MiniLM-L6-v2), Classifier (DistilBERT), NER (BERT-NER), Regression with cross-validation, LoRA fine-tuning (GPT-2/TinyLlama). Models registered as LOCAL_MODEL in Cadences
- WhatsApp Agent (20.4K lines): Playwright stealth with humanDelay module (humanType char-by-char, humanClick + mouse movement, readingDelay WPM-based), Smart Pipeline with 5 AI providers (Cloudflare/Gemini/Groq/OpenAI/DeepSeek), STT via Groq/OpenAI/Workers Whisper, Image analysis via Gemini/OpenAI Vision/LLaVA, contact sync + group tracking
- Scraper (25.3K lines): 7 scraper types — Real Estate (1,256 lines, anti-detection with Gaussian delays + anti-bot evasion), Freelance (9+ job platforms across 4 regions), Documents (PDF/Excel/CSV/Word/TXT/JSON), FileSystem (disk scan + MD5/SHA256 dedup), ML Pipeline (TensorFlow.js bridge), Legal (5 government gazette + procurement sources), API. Plus AI File Analyzer (735 lines), Cross-Disk Sync (700 lines), Remote Worker for Cadences job polling
- IoT Hub (8.4K lines): 3 core protocols (MQTT v5.10, SerialPort v12, HTTP polling) + 14 protocol types defined (CoAP, Modbus, Zigbee, Z-Wave, LoRa, BLE, RTSP, ONVIF...). 60+ device types across 10 categories (Environmental, Security, Energy, Camera, Industrial...). Automation Engine (796 lines) with triggers (device_state/threshold/schedule/sunrise-sunset/webhook/scene), Camera Manager (619 lines) with PTZ + FFmpeg, auto-sync to Cadences every 5 min
- AudioHub (7.4K lines): Bluetooth device scanning (earpieces, headsets) with heartbeat monitoring, Python bridge for local Whisper STT (configurable model size), TTS via ElevenLabs (12 voice presets), OpenAI, Edge-TTS/gTTS/pyttsx3 fallback chain, MD5-based audio caching
Key Results
- ~73K lines across 114 files — 5 local-first tools syncing with Cadences
- ML Trainer: OpenAI-compatible API with 5 training types + model sync
- WhatsApp Agent: 20.4K lines with stealth, 5 AI providers, STT + vision
- Scraper: 25.3K lines, 7 scraper types, 9+ freelance platforms, Remote Worker
- IoT Hub: 60+ device types, automation engine, camera manager with PTZ
- AudioHub: Python Whisper bridge + 3 TTS providers with fallback chain
Tech Stack
Electron Node.js Fastify Playwright SQLite Python MQTT SerialPort @xenova/transformers Whisper
$ cat project.json
{
"name": "Desktop & IoT Tools Suite",
"status": "production",
"stack": [10],
"results": [6]
}