LocalFlux

A fault-tolerant offline multiplayer engine designed for unreliable high-density network environments

Description

The Problem: The Auditorium Wi-Fi Crash

Current multiplayer event software (like Kahoot or Slido) relies entirely on stable cloud architecture. In high-density venues like hackathons, school assemblies, or classrooms, the local Wi-Fi router chokes when 50+ users connect simultaneously to fetch external HTTP assets. The game lags, players disconnect, and the event halts.

The Solution: LocalFlux

LocalFlux is an offline-first, infrastructure-agnostic multiplayer engine. It decouples gameplay from ISP stability by treating the Local Area Network (LAN) as a first-class citizen. It delivers zero-latency gameplay completely offline, bypassing the global internet to prevent router hardware crashes. While initially tested with a fast-paced Movie Trivia frontend, the core architecture is entirely content-agnostic and self-hosted.

Under the Hood: Core Architecture & Features

  • Bare-Metal LAN Binding: Bypasses standard localhost by programmatically extracting the host machine's physical network interface (192.168.x.x) and binding the server directly to it.

  • In-Memory State Management: Eliminates database read/write bottlenecks entirely. The entire concurrent game state is managed in active Node.js RAM using Map() objects.

  • Base64 WebSocket Broadcasting: Prevents local router HTTP queue crashes by reading local .webp images from the disk, encoding them to Base64, and streaming them directly over Socket.io to 50+ clients simultaneously.

  • Deterministic Lag Compensation: Implements an NTP-style clock synchronization handshake. The server evaluates actions based on client-side timestamps (ping differences), guaranteeing fair competition even during micro-fluctuations on the local router.

  • Smart QR Gateway: Players join instantly by scanning a dynamically generated QR code on the host's screen—no app downloads, internet DNS resolution, or IP typing required.

  • Native Deck Studio: A built-in React UI that parses CSV files entirely in the browser using native JavaScript, allowing hosts to generate offline trivia decks locally without external APIs.

Tech Stack

  • Frontend: React.js, Vite, Tailwind CSS v4

  • Backend: Node.js, Express.js

  • Networking: Socket.io (WebSockets), Node OS Network Interfaces

  • Data Processing (Prep): Python 3, OpenCV (Haar Cascades for face-cropping)

  • Storage: Pure local File-System architecture (No cloud databases).

Open Source Impact & Significance

LocalFlux democratizes interactive education and event hosting. Teachers and organizers in underfunded schools or regions with poor internet infrastructure can now host high-tech, real-time interactive quizzes using just a single laptop and a basic Wi-Fi router. As a 100% open-source tool, it ensures total data privacy, zero latency, and software permanence without subscription fees.