๐ฏ What Is SovereignCommand?
SovereignCommand is the Sovereign AI Commerce Command Centre for ML-NIGHTWORX โ an offline-first, privacy-first unified messaging middleware that aggregates WhatsApp, Telegram, SMS, and Email into a mindful inbox with local AI reflection and cool-down timers.
It is not a SaaS messaging app. It is infrastructure you own and control. Every message, every contact, every AI inference runs on your hardware. Zero bytes leave your machine unless you explicitly send a message.
๐ Architecture Overview
SovereignCommand is built as a modular, self-hosted stack with clear separation of concerns:
Core Components
| Component | Technology | Role |
|---|---|---|
| gRPC Backend | Go 1.22 + Protocol Buffers | 18 RPCs for all operations: health, channels, contacts, messages, search, send, connect, reflect, translate, drafts, streaming |
| WhatsApp Bridge | whatsmeow (Go) | Multi-device WhatsApp Web protocol; handles pairing, sync, send/receive, real-time events |
| Encrypted Storage | SQLCipher (AES-256) | All messages, contacts, drafts, keys encrypted at rest; key derived from user passphrase |
| Local AI | Ollama + gemma2:2b | Tone analysis, emotional scoring, translation, draft generation โ 100% local, no API calls |
| Web UI | Vanilla HTML/CSS/JS | Chat view, Database view, Draft Queue, Reflect panel, Channel management โ works offline after load |
| Flutter App (Future) | Dart/Flutter | Native mobile/desktop clients connecting to same gRPC backend |
| Cloudflare Worker (Optional) | TypeScript + Workers | HTTPS proxy, auth, rate limiting, Stripe webhooks for managed tiers |
Repository Structure
sovereign-messenger/
โโโ local-node/ # Go gRPC backend + whatsmeow bridge
โ โโโ cmd/orchestrator/ # Main entry point
โ โโโ internal/
โ โ โโโ bridge/ # WhatsApp bridge (whatsmeow)
โ โ โโโ db/ # SQLCipher + SQLC codegen
โ โ โโโ reflect/ # Ollama client (gemma2:2b)
โ โ โโโ queue/ # Draft queue + cool-down timers
โ โ โโโ grpc/ # 18 RPC implementations
โ โโโ web/ # Static web UI (served by Go)
โโโ cloudflare-worker/ # Optional HTTPS proxy + auth + billing
โโโ flutter-app/ # Future: native clients
โโโ proto/ # Protocol Buffer definitions (v1)
โโโ sovereign/v1/sovereign.proto
๐ Privacy Model
Sovereignty Guarantee
"No message, contact, or AI inference ever leaves your machine."
- 0 bytes cloud egress โ All data stays on your device/network. The only network traffic is outbound WhatsApp WebSocket to Meta's servers (for message delivery) and optional Cloudflare Worker proxy for managed tiers.
- 0 telemetry โ No analytics, no crash reporting, no usage tracking. The code has no phone-home mechanisms.
- Local AI only โ Ollama runs
gemma2:2bentirely on your CPU/GPU. Reflection, translation, and draft generation never call external APIs. - Encrypted at rest โ SQLCipher with AES-256. Database key derived from your passphrase via PBKDF2 (100,000 iterations).
- Open-core transparency โ Core messaging, bridge, storage, and reflection logic are MIT-licensed. Managed service components (billing, multi-tenancy) are proprietary.
๐ Data Flow
Every message follows a deterministic, auditable path:
๐ Tech Stack
| Layer | Technology | Version | License |
|---|---|---|---|
| Language (Backend) | Go | 1.22+ | BSD-3 |
| WhatsApp Protocol | whatsmeow | latest | MIT |
| Database | SQLCipher | 4.5+ | BSD |
| SQL Codegen | SQLC | 1.27+ | MIT |
| gRPC Framework | connect-go / protobuf | latest | Apache-2.0 |
| Local LLM | Ollama + gemma2:2b | latest | Apache-2.0 / Gemma |
| Web UI | Vanilla HTML/CSS/JS | ES2022 | MIT |
| Cloudflare Worker | TypeScript + Hono | latest | Proprietary (managed) |
| Mobile (Future) | Flutter/Dart | 3.22+ | BSD-3 |
| Payments | Stripe | latest | Proprietary integration |
โ๏ธ Open-Core License
MIT License (Core)
The following are open source under MIT:
- Go gRPC backend (orchestrator, bridge, db, reflect, queue, grpc)
- SQLCipher schema and SQLC-generated code
- Protocol Buffer definitions (
proto/sovereign/v1/) - Web UI (HTML/CSS/JS)
- Flutter app (when released)
You may use, modify, distribute, and commercialize the MIT-licensed components freely.
Proprietary (Managed Service)
The following are not open source and require a Pro/Enterprise license:
- Cloudflare Worker proxy (auth, rate limiting, multi-tenancy)
- Stripe billing integration and webhook handlers
- API key management dashboard (multi-user)
- Managed deployment automation (Terraform, CI/CD)
- SLA-backed support and on-premise deployment assistance
โ ๏ธ Limitations (By Design)
Single-User, Single-Node
SovereignCommand is designed for individual sovereignty. It does not support multi-user tenancy, shared inboxes, or cluster synchronization. Each instance serves one identity.
No Cloud Sync
There is no cloud backup, no cross-device sync, and no account recovery. Your database file is your sovereign data. Back it up yourself (encrypted).
WhatsApp Only (Currently)
Telegram, SMS, and Email bridges are planned but not yet implemented. The architecture supports them via the same gRPC interface.
Local AI Hardware Requirements
Reflection requires Ollama + gemma2:2b (~1.6GB RAM minimum, 4GB+ recommended). CPU inference is slow (~5-15s per reflection); GPU (Metal/CUDA) recommended.
No Message History Import
WhatsApp's multi-device protocol does not support historical message import. Only messages sent/received after pairing are captured.
๐ Deployment Targets
| Target | Use Case | Components |
|---|---|---|
| Local Machine (macOS/Linux/Windows) | Personal sovereignty | Go binary + Ollama + Web UI |
| Home Server / NAS | Always-on, multi-device access | Go binary + Ollama + Web UI + Tailscale |
| VPS (Self-Managed) | Cloud sovereignty | Go binary + Ollama + Cloudflare Tunnel |
| Managed (Pro Tier) | Zero ops | Cloudflare Worker + Managed Go + Ollama |
| On-Premise (Enterprise) | Air-gapped, compliance | Full stack on your hardware |
๐ Links
- GitHub Repository โ Source code, issues, releases
- API Documentation โ REST + gRPC reference
- Pricing & Tiers โ Free, Pro ($49/mo), Enterprise ($499/mo)
- Terms of Service โ Privacy, license, acceptable use
- YouTube @ML-NIGHTWORX.v2 โ Build logs, architecture deep-dives