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.
Lucalmz / ScoutingPro27
Brand-new Scouting App for BIOBUZZ 2026-2027
ScoutingPro27 🚀
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 — Cell-level CRDT specs, claimed vs. actual consistency audit | ![]() Live Rankings Ladder & Telemetry — Predict Cycle Time, Swarm RP Mobility & Rule A215 Advancement |
📖 Documentation Map
- For Scouts & Team Leads: Start with the illustrated guides 👉 Bilingual User Guide Hub · English Step-by-Step Guide · 中文保姆级教程 (includes Windows
.msi/ macOS.dmginstallation & Gatekeeper bypass in Chapter 0; runnpm run export:userguide-pdfinfrontend/to generate offline PDFs). - For Developers & Contributors…
Architecture Overview: One Codebase, Two Node Roles
ScoutingPro27 runs a unified Vue 3.5 + TypeScript 6 + Vite 8 frontend across two roles:
- 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 to127.0.0.1loopback 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/*.
- 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 (
- 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 callsDate.now(), advancing strictly via monotonicperformance.now()and rejecting inbound packets with>300sfuture skew.
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:
- Physical-NIC Binding in Chromium: JCEF launches with
--force-fieldtrials=WebRTC-IPv6Default/Enabled/WebRTC-BindUsingInterfaceIndex/Enabled/...solibwebrtcbinds ICE sockets by physical interface index instead of hijacked virtual TUN adapters. - Non-Invasive UPnP / Global IPv6 + Scoped Firewall:
PortForwardingServicefilters out virtual TUN interfaces (wintun,sing-tun,198.18.*Fake-IP,wsl,tailscale) while keeping WindowsWi-Fi Directhotspots, 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. -
VirtualDataChannel3.8s Encrypted Tunnel Fallback: If carrier NAT or a mobile VPN blocks UDP completely, peers automatically activate an ECDH + AES-256-GCM encryptedVirtualDataChannelover WSS/MQTT signaling after3.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-countersignedmember_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:
- Control-plane authority (
hostEpoch, desktop-only) is strictly decoupled from data-plane HLC timestamps. - A standby laptop (or a brand-new laptop entering the immutable
inviteCode) queries mobile peers (EPOCH_WITNESS) and promotes toEpoch + 1. - If the crashed primary Host boots back up later and broadcasts a stale
Epoch = 1heartbeat, peers reply withepoch_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/TEAMscopes) parsed by a hand-written lexer/recursive-descent AST parser (zeroeval/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 withAES-256-GCM+AiUrlGuardSSRF defense), including full-duplexGemini Live/OpenAI Realtimevoice relay over/ws/ai/voice.
Engineering Verification
Because this runs live in high-stakes competitions, we keep a strict automated test bar across the stack:
- Frontend (Vitest + TypeScript 6):
120test files /1,034unit & component tests passing (vue-tsc --buildclean) - Backend (Maven + JUnit 5):
51test classes /267tests passing (covering FlywayV1–V11, ECDSA verification, FTC API/hybridPlayoff series normalization, AI SSRF/voice relay, and CRDT dirty-row projection) - Full-Stack E2E (Puppeteer):
5multi-node disaster-recovery, QR onboarding, inbox lifecycle, interactive workflow, and WebRTC resilience suites
Try It Out
- Offline Web / Mobile PWA: https://lucalmz.github.io/ScoutingPro27/
- Desktop Installers (Windows
.msi& macOS Apple Silicon.dmg): GitHub Releases - Source & Architecture Contract (
CONTRACT.md): github.com/Lucalmz/ScoutingPro27
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!



