A web bridge game. Goal: parity with BBO, then better — decentralized identity (nostr / NIP-98), signed portable results, and first-class learning/analysis.
- Solo: you sit South against robots playing a simple natural system (openings, responses, overcalls, rebids; drawing trumps, sensible leads). Claim, undo, session score sheet, double-dummy analysis after every board (par, makeable-contracts table, DD optimum vs actual) and IMPs vs par. Session persists across refresh.
- Online: thin WebSocket server (same engine) hosting tables — create a table, share the id, friends take seats, robots fill the rest. Server deals and keeps hands hidden; every action is validated server-side. Identity via xlogin (Nostr NIP-07 / Solid) with guest fallback.
npm install
npm start # play at http://localhost:8787 (client + game server, one process)
npm test # engine unit + integration testsNo build step: the client is plain ES modules served straight from src/
(plus vendor/bridge-dds/ for the double-dummy WASM solver). Production is
the same single process serving the client and the WebSocket on one port.
Deploying is that plus TLS termination (e.g. caddy/nginx) and optionally Ben
below.
Dropped connections keep their seat for 5 minutes; reloading the page
reclaims it automatically.
The game also mounts inside a JavaScript Solid
Server so pod
and nostr identities sign in through the host's own auth
(node jss-plugin/serve.js — see jss-plugin/NOTES.md for the findings).
Online-table robots can be driven by Ben, a neural-network bridge engine, instead of the built-in heuristics:
scripts/ben-setup.sh # one-time (~4 GB, no root needed)
scripts/ben-start.sh & # REST API on :8085 (~30s to load)
BEN_URL=http://localhost:8085 npm run server # robots now bid & play via BenAny Ben error or timeout falls back to the heuristic bots for that single
decision, so tables never stall. Ben also returns bid explanations
("5+ !S; 11-20 HCP") — not surfaced in the UI yet.
src/engine/— pure JavaScript rules engine, no framework dependencies: deal, auction, play, duplicate scoring, plus a placeholder robot. This is the foundation for everything later (server, multiplayer, bots).src/ui/— vanilla DOM render helpers: table, hands, bidding box, auction history (state object + render functions + event listeners).tests/— engine tests, including an integration test that plays 50 random boards to completion.
Core engine + solo table vs robotsDouble-dummy analysis via DDS compiled to WASM(LIN/PBN import still open)Tables with friends: thin server, WebSockets, xlogin identity(first cut)Real robot (Ben) behind a provider interface(online tables; solo still heuristic)Signed login (NIP-98 tickets), table chat, online analysis/review- Deploy publicly
- Kibitzing, disclosure UX (alerts, own-bid explanations), LIN/PBN import
- Duplicate tournaments, matchpoints across tables, results as signed nostr events