Skip to content

sarogamedev/CyberDeck

Repository files navigation

CyberDeck

CyberDeck - A portable offline knowledge, AI, and communication platform. Run local LLMs, Wikipedia, maps, and mesh networking without internet.

A self-hosted, offline-first communication and survival platform that transforms any Android phone or Node.js device into a decentralized mesh node. CyberDeck enables real-time messaging, delay-tolerant packet routing, air-gapped data transfer, and peer-to-peer content sharing, all without requiring an internet connection.

When the grid goes down, CyberDeck keeps you connected.

Communication & Networking

CyberDeck is built around a multi-layered communication stack that works in any connectivity scenario from full Wi-Fi to complete radio silence.

Layer Module How It Works
Real-time LAN Chat WebSocket-based group chat across all devices on the same network. Zero config, instant join.
Store-and-Forward DTN Engine Delay-Tolerant Networking with automatic Epidemic Sync via UDP beacons + mDNS. Devices exchange packets in the background whenever they come within Wi-Fi range, carry data across air-gaps like a physical courier.
Direct Transfer WebRTC P2P Browser-to-browser file transfers over LAN. No server storage touched.
Air-Gapped Mesh Network Transmit data with no network at all: Acoustic MFSK (audio frequencies), Optical QR (camera), or BLE (Bluetooth Low Energy).
Content Sharing LAN Content Sync Browse and pull downloaded datasets, models, and knowledge packs directly from nearby CyberDeck nodes over the LAN. License metadata travels with the content.

How Devices Communicate

CyberDeck A                          CyberDeck B
┌───────────────┐                   ┌───────────────┐
│ DTN Spool     │◄── Wi-Fi/LAN ────►│ DTN Spool     │
│ Epidemic Sync │   (auto-discover) │ Epidemic Sync │
│               │                   │               │
│ Content Store │◄── LAN Sync ─────►│ Content Store │
│               │                   │               │
│ Mesh Radio    │◄── Audio/QR/BLE ─►│ Mesh Radio    │
└───────────────┘                   └───────────────┘

Nodes discover each other automatically via mDNS and UDP Subnet Beacons (bypasses Android hotspot restrictions). When two CyberDecks come within range, they perform TLS-encrypted background sync - no user action needed.

Knowledge & AI (Offline)

Module Description
AI Chat Chat with local LLMs (Llama 3, Phi-3, Mistral) via Ollama. 100% offline, streaming responses, and Model List Refresh.
Wikipedia Offline encyclopedia via Kiwix with Dynamic ZIM Initialization.
Maps Offline/online maps via Leaflet with geolocation tracking and Offline Tile Downloader.
Nearby Auto-discover other CyberDecks on your LAN and pull content/models offline from them via specialized P2P protocols.
RAG Module Augmented AI Chat with local knowledge retrieval from ZIM datasets.
Ebooks EPUB reader and PDF viewer with saved reading progress.
Survival Built-in offline survival guides (Water, Fire, Shelter, First Aid, Navigation).
Security Hardened HMAC-signed file IDs, DTN resource quotas, Vault AES-256-GCM, and strictly sanitized UI.

Content Store & Distribution

CyberDeck includes a built-in store for downloading open-source knowledge packs, AI models, and datasets:

  • Catalog Manifest Architecture - items defined in catalog.json, zero code changes to add content
  • Resumable Downloads - HTTP Range pause/resume for multi-GB files
  • LAN Content Sync (P2P) - Share ZIM files and Ollama AI Models between devices without internet. Integrated aggregate progress and speed tracking.
  • Cross-Platform Sync - Seamlessly pull content between Android (Termux), Windows, and Linux.
  • SHA256 Integrity Verification - post-download hash check, auto-delete corrupted files
  • License Sidecar Files - .license.json accompanies every download with full attribution
  • Attribution Compliance - all content clearly labeled with license, source, and distributor

Media & Storage

Module Description
Music Stream FLAC/MP3/OGG with metadata, album art, visualizer, and persistent queue.
Photos Photo gallery with lazy thumbnails, date grouping, EXIF data, and lightbox viewer.
Videos Stream videos with range-request seeking and fullscreen support.
Vault AES-256-GCM encrypted storage. Zero-knowledge - encryption happens in-browser.

Utilities

Module Description
Tools Compass, Calculator, Unit Converter, Morse Code generator, Flashlight, Coordinates.
Power System monitor: CPU load, RAM, storage, battery, temperature, service status.
PWA Progressive Web App, install to home screen, cache UI shell for instant offline loading.
Mobile Sync Fully responsive UI with off-canvas navigation, optimized for one-handed use on smartphones.

Quick Start

CyberDeck works on any device running Node.js. Choose your platform:

Android (via Termux) Ideal portable mesh node

# Install Termux + Termux:API from F-Droid (not Play Store)
pkg update && pkg upgrade
pkg install git Termux:API
git clone https://github.com/sarogamedev/CyberDeck.git
cd CyberDeck/server && bash setup-android.sh

Linux (Ubuntu/Debian, Fedora, Arch)

git clone https://github.com/sarogamedev/CyberDeck.git
cd CyberDeck/server && sudo bash setup-linux.sh

Windows (PowerShell)

git clone https://github.com/sarogamedev/CyberDeck.git
cd CyberDeck\server
# Run as Administrator
.\setup-windows.ps1
# if installation fails, run the following command:
powershell -ExecutionPolicy Bypass -File .\setup-windows.ps1

Windows Desktop App (Electron)

For a standalone experience with a dedicated window and taskbar icon:

  1. Follow the Windows (PowerShell) setup above first.

  2. From the root CyberDeck directory, install Electron dependencies (if command fails, run Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass first):

    npm install
  3. Build the portable executable:

    npm run build

    The .exe will be generated in the dist folder.

  4. To run without building:

    npm start

Android Native Server App (Standalone) Easiest setup

The server now runs natively as a standalone app, no CLI needed.

  1. Download the latest CyberDeck_Server_V1.0.5.apk from the Releases page.
  2. Install and launch on your Android device.
  3. Tap START SERVER. The app handles the Node.js runtime and asset extraction automatically.
  4. Access the UI directly in the app or via browser on other devices.

Android Native Client

For a native experience with automatic discovery and one-tap connection:

  1. Download the latest CyberDeck_Client_V1.0.0.apk from the Releases page.
  2. Install the APK on your Android device.
  3. Launch the app to automatically scan for nearby CyberDeck nodes on your Wi-Fi network.
  4. Tap any discovered node to connect instantly.

Starting the Server

node server.js

The server displays your LAN IP. Open it on any device on the same network:

  • Client App: http://<ip>:8888
  • Admin Panel: http://<ip>:8888/admin
  • Secure Mode (HTTPS): https://<ip>:8443 (Required for Mesh/Camera/Microphone features)

(Default credentials: admin / cyberdeck - change immediately in Admin Panel).

Admin Panel (/admin)

  • Security: Change access credentials and rotate HMAC secrets
  • Services: Start/stop Ollama and Kiwix with Dynamic ZIM Initialization
  • Download Manager: Live progress bars with Pause/Resume/Cancel/Delete controls
  • Robustness: Automated Windows EBUSY lock release and process termination on deletion
  • Library Scanning: Force rescan media directories and aggressive directory sweeping
  • Configuration: Customize directory paths and offline Ollama model deletions
  • Metrics: Real-time performance graphing and background DOM sync for persistent progress tracking
  • Android Port Management: Integrated Asset Extraction - detects version updates and automatically wipes/re-extracts the backend to prevent corruption.

Architecture

Host Device (Termux/PC)                 Client (Any Browser)
┌──────────────────────┐               ┌──────────────────────┐
│  Node.js Server      │               │  CyberDeck SPA       │
│  ├─ Express API      │◄─── Wi-Fi ───►│  ├─ Tactical UI      │
│  ├─ DTN Engine       │   (Offline)   │  ├─ RAG Module       │
│  ├─ Content Store    │               │  ├─ WebSockets       │
│  ├─ Ollama (LLMs)    │               │  ├─ WebRTC P2P       │
│  └─ Kiwix (Wiki)     │               │  └─ Service Workers  │
└──────────────────────┘               └──────────────────────┘

Built with Vanilla JavaScript, HTML, and CSS - no heavy frameworks. Optimized for maximum performance on low-end devices, fully mobile-responsive, and featuring a high-contrast Tactical Amber aesthetic.

Requirements

  • Host: Node.js 18+ (Android via Termux, Linux, Windows, macOS)
  • Client: Any modern web browser
  • Hardware: Any smartphone from the last 10 years. For AI Chat, 6GB+ RAM (8GB recommended)
  • Network: Wi-Fi router or Mobile Hotspot (no internet required after initial setup)

Third Party Services

CyberDeck integrates with optional external software:

  • Kiwix – Offline Wikipedia server
  • Ollama – Local AI model runtime

These services are installed separately and licensed under their respective open-source licenses.

Security Audit & Hardening

CyberDeck has undergone a comprehensive multi-phase security audit to ensure a robust defense-in-depth posture:

  • Logic Hardening: Strict path normalization and validation to prevent Path Traversal.
  • Data Integrity: HMAC-signed File IDs and aggressive directory sweeping to purge orphaned cache fragments.
  • Process Management: Automatic termination of active background threads on deletion to prevent resource leaks.
  • Windows Optimization: Explicit EBUSY lock release before unlinking aborted files.
  • Encryption: AES-256-GCM Vault with per-vault random salts and server-side session management.
  • UI Sanitization: Comprehensive HTML escaping and removal of legacy dependencies (Bootstrap) for a pure CSS Tactical Amber implementation.
  • API Security: Forced same-origin CORS, rate-limited authentication, and WebSocket token verification.
  • P2P TLS Off-Grid Design: Peer-to-peer syncing uses self-signed certificates and bypasses strict CA validation (rejectUnauthorized: false). Because CyberDeck operates completely offline without access to public Certificate Authorities, this is an intentional design tradeoff. The SSRF filter bounds all peer queries exclusively to local, private LAN IPs, minimizing any MITM exposure to your direct physical network.
  • Android 15 Compatibility: Native support for Edge-to-Edge rendering and fitsSystemWindows padding to prevent layout overlaps on modern mobile OS versions.

License

MIT License. Build, mod, and survive.

For all open-source libraries used, see THIRD_PARTY_LICENSES.md.

Third-Party Models and Datasets

CyberDeck allows downloading third-party AI models and datasets via the Store module. These resources are distributed under their respective licenses. CyberDeck does not claim ownership of any downloaded content. Users must comply with the original license terms.

About

Portable offline knowledge, AI, and mesh communication platform. Run local LLMs, Wikipedia, and decentralized networking without internet.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors