At a FIRST Tech Challenge (FTC) robotics competition, 3,000+ people pack into a gym with saturated Wi-Fi, strict RF rules, and carrier-grade NAT on cellular networks—and right before Alliance Selection, your scouting data is the single most valuable asset your team has.

Traditional setups fail in predictable ways:

  • Cloud spreadsheets spin endlessly and overwrite whole rows when multiple scouts edit at once.
  • Master-slave LAN servers suffer from a Single Point of Failure—if the lead laptop dies or loses Wi-Fi, every bleacher scout stops dead.
  • Static offline QR workflows survive blackouts, but lack real-time schedules, Pit photos, team tags, or collaborative analytics.

So as students on FTC Team 27570 B.E.A.R., we built ScoutingPro27 (now at v1.1.3): a $0/year, Local-First + WebRTC P2P + TinyBase CRDT collaborative scouting and tactical intelligence platform designed to survive blackouts, roaming networks, and sudden host crashes.

GitHub logo Lucalmz / ScoutingPro27

Brand-new Scouting App for BIOBUZZ 2026-2027

ScoutingPro27 🚀

FTC 27570 BIOBUZZ CRDT P2P Security Tests Vue.js TypeScript Java H2 Database

Language: English | 简体中文  |  Standalone User Guides (Illustrated Manuals): Bilingual Hub · English Guide · 中文教程 · Docs Index · API & Architecture Contract

Independently conceived, architected, and full-stack developed by students of FIRST Tech Challenge (FTC) Team 27570 B.E.A.R.
A Local-First + WebRTC P2P + TinyBase CRDT/HLC collaborative scouting & tactical intelligence platform built for high-interference, offline/weak-network robotics competition arenas.

📸 Screenshots









Pit Scouting & Brag Index Verification


Pit Scouting & Brag Index Verification — Cell-level CRDT specs, claimed vs. actual consistency audit

Live Rankings Ladder & Telemetry


Live Rankings Ladder & Telemetry — Predict Cycle Time, Swarm RP Mobility & Rule A215 Advancement

📖 Documentation Map

Architecture Overview: One Codebase, Two Node Roles

ScoutingPro27 runs a unified Vue 3.5 + TypeScript 6 + Vite 8 frontend across two roles:

  1. Desktop Host / Standby Laptops (Windows .msi & macOS Apple Silicon .dmg):
    • Packaged as a single-process desktop container powered by Java 21 + Javalin 7.2 (Jetty 12) + JCEF Chromium 146, backed by H2 2.2 + HikariCP + Jdbi3 + Flyway (V1–V11).
    • Inside the desktop app, JCEF talks to Javalin strictly over http://localhost:8080, while H2 binds to 127.0.0.1 loopback only.
    • In a zero-Internet arena, the Host also serves the offline PWA bundle directly over the local hotspot (:8080) with a companion LAN WebSocket signaling relay (/ws/signal/{room}), while enforcing HMAC-SHA256 JWT + event membership checks on /api/*.
  2. Bleacher Mobile Devices (Zero-Install Offline PWA):
    • Hosted statically on GitHub Pages (Live PWA) or served directly from the Host laptop's QR code.
    • All scouting records, Pit specs, ECDSA keys, and WebP photos live locally in IndexedDB and sync peer-to-peer over WebRTC DataChannels.

5 Engineering Problems We Had to Solve

1. Cell-Level CRDTs Without Date.now() Clock Drift

We model room state across 8 normalized TinyBase 10.1 MergeableStore tables (scouting_records, pit_records, pit_photo_keys, team_tags, custom_fields, schedules, assignments, member_identities).

  • Concurrent edits to the same robot's Pit profile (e.g., Scout A edits weight while Scout B edits drivetrain and uploads a photo) merge losslessly at the individual cell level.
  • Mobile phone clocks can be off by seconds or minutes in offline venues, which wrecks Last-Write-Wins (LWW) Hybrid Logical Clocks. After pairing, peers run 3 rounds of CLOCK_SYNC_REQ/RES, anchoring zero-point time on the minimum RTT sample. Runtime HLC generation never calls Date.now(), advancing strictly via monotonic performance.now() and rejecting inbound packets with >300s future skew.

Pit Scouting & Brag Index Verification

2. Dual-Stack WebRTC + Surviving TUN Proxies & Carrier NAT

Getting WebRTC hole-punching to work reliably on Windows laptops—especially when developers or students have TUN-mode proxies (Clash, Mihomo, Sing-box) or Windows Public Wi-Fi firewalls—took three layers of defense:

  1. Physical-NIC Binding in Chromium: JCEF launches with --force-fieldtrials=WebRTC-IPv6Default/Enabled/WebRTC-BindUsingInterfaceIndex/Enabled/... so libwebrtc binds ICE sockets by physical interface index instead of hijacked virtual TUN adapters.
  2. Non-Invasive UPnP / Global IPv6 + Scoped Firewall: PortForwardingService filters out virtual TUN interfaces (wintun, sing-tun, 198.18.* Fake-IP, wsl, tailscale) while keeping Windows Wi-Fi Direct hotspots, and requests short-lease UDP mappings (50000-50009/UDP) via UPnP IGDv1/v2 (WANIPv6FirewallControl:1), NAT-PMP, and PCP—without ever touching OS routing tables.
  3. VirtualDataChannel 3.8s Encrypted Tunnel Fallback: If carrier NAT or a mobile VPN blocks UDP completely, peers automatically activate an ECDH + AES-256-GCM encrypted VirtualDataChannel over WSS/MQTT signaling after 3.8s, while probing in the background to hot-upgrade back to native UDP with zero packet loss.

3. Zero-Trust P2P Security & Signed Teammate Relay

Public MQTT brokers are used only for signaling—zero business data ever touches a broker, and signaling frames are signed with a 100,000-iteration PBKDF2-HMAC key derived from the room's immutable 6-character inviteCode (plus NonceLruCache replay defense).

  • 4-Digit SAS + TOFU: Peers complete ECDH P-256 key exchange and verify a 4-digit Short Authentication String (persisted in an IndexedDB TOFU store) before any CRDT traffic flows.
  • Write-Time ECDSA Signatures (authorSig): Scouts sign match records with their device's ECDSA P-256 key, backed by Host-countersigned member_identities (hostSig). That means even if Scout B goes offline before reaching the Host, Scout A can safely relay Scout B's records later and the Host can still cryptographically verify authorship.

4. Split-Brain-Proof Host Takeover (hostEpoch Fencing)

If the primary Host laptop crashes mid-tournament, we never let a new laptop's data-plane timestamp overwrite older offline scout cells:

  1. Control-plane authority (hostEpoch, desktop-only) is strictly decoupled from data-plane HLC timestamps.
  2. A standby laptop (or a brand-new laptop entering the immutable inviteCode) queries mobile peers (EPOCH_WITNESS) and promotes to Epoch + 1.
  3. If the crashed primary Host boots back up later and broadcasts a stale Epoch = 1 heartbeat, peers reply with epoch_superseded, forcing it to auto-demote to a Standby Client and merge its pre-crash local records into the new Host instead of causing split-brain.

5. Isomorphic Java + TypeScript Formula Engine & Analytics

Beyond data sync, we built competition analytics that run identically on the Java Host and the TypeScript PWA:

  • SP-NP OPR (Prior-Regularized Non-Penalty OPR): Uses scout-recorded phase scores as priors against official penalty-free alliance totals, paired with outlier-trimmed cycle time telemetry and FTC Rule A215 advancement point calculations (AdvancementCalculator.java & advancement.ts).
  • Custom Fields & Safe AST Formula Engine: Teams can define dynamic custom fields and derived formulas (MATCH / PIT / TEAM scopes) parsed by a hand-written lexer/recursive-descent AST parser (zero eval/Function), guarded by 3-color DFS cycle detection and a 500-step execution budget, verified identically across Java and TypeScript via a shared conformance suite (shared/formula-conformance-cases.json).
  • Multi-Protocol AI Copilot + Full-Duplex Live Voice: Supports OpenAI-compatible endpoints, Google Gemini (v1beta), and Anthropic Claude (keys encrypted at rest with AES-256-GCM + AiUrlGuard SSRF defense), including full-duplex Gemini Live / OpenAI Realtime voice relay over /ws/ai/voice.

Live Rankings Ladder & Telemetry

Engineering Verification

Because this runs live in high-stakes competitions, we keep a strict automated test bar across the stack:

  • Frontend (Vitest + TypeScript 6): 120 test files / 1,034 unit & component tests passing (vue-tsc --build clean)
  • Backend (Maven + JUnit 5): 51 test classes / 267 tests passing (covering Flyway V1–V11, ECDSA verification, FTC API /hybrid Playoff series normalization, AI SSRF/voice relay, and CRDT dirty-row projection)
  • Full-Stack E2E (Puppeteer): 5 multi-node disaster-recovery, QR onboarding, inbox lifecycle, interactive workflow, and WebRTC resilience suites

Try It Out

If you're building Local-First apps, WebRTC P2P tools, or FTC/FRC robotics software, we'd love your feedback, questions, or stars on GitHub!