diff --git a/README.md b/README.md new file mode 100644 index 0000000..11bfe8a --- /dev/null +++ b/README.md @@ -0,0 +1,221 @@ +
+
+ ♠ ♥ ♣ ♦
+
+
+ The Operating System for Poker Venues
+
+ Run a complete tournament offline on a €100 device — it just works.
+
+ Features • + Architecture • + Getting Started • + Development • + Project Structure • + License +
+ +--- + +**Felt** replaces the fragmented tools poker venues cobble together — TDD, whiteboards, spreadsheets, Blind Valet, BravoPokerLive — with one integrated platform. From a 3-table Copenhagen bar to a 40-table casino floor. + +TDD's brain. Linear's face. Dark-room ready. + +## Features + +### Tournament Engine +- **Clock Engine** — Countdown, blind levels, antes, breaks, chip-ups, pause/resume, hand-for-hand. 100ms tick resolution with configurable warnings +- **Blind Structure Wizard** — Generate playable structures from target duration, starting chips, and game type. Mixed-game rotation, big-blind antes, chip-up breaks +- **Financial Engine** — Buy-ins, rebuys, add-ons, bounties (standard + PKO), payouts, rake — all `int64` cents, never `float64`. CI-gated: sum of payouts always equals prize pool +- **ICM Calculator** — Exact Malmuth-Harville for ≤10 players, Monte Carlo (100K iterations) for 11+. Chop/deal support: ICM, chip-chop, even-chop, custom split, partial chop +- **Player Management** — Full-text search, buy-in with auto-seating, bust-out with hitman tracking, undo with full re-ranking, CSV import/export, QR codes +- **Table & Seating** — Configurable layouts, auto-balancing with clockwise distance fairness, break table (fully automatic), tap-tap seat moves +- **Multi-Tournament** — Run simultaneous tournaments with fully independent state (clocks, financials, players, tables) +- **Audit Trail** — Every state-changing action logged. Any financial transaction or bust-out undoable with full re-ranking + +### Operator UI +- **Mobile-first, touch-native** — 48px touch targets, FAB with contextual actions, persistent header with tournament switcher +- **Catppuccin Mocha** dark theme (dark-room ready) with Latte light alternative +- **Overview** — Large clock display, player counts, table balance status, financial summary, activity feed +- **Financials** — Prize pool breakdown, transaction history, payout preview, bubble prize, chop/deal flow +- **Players** — Typeahead search, buy-in flow (search → auto-seat → confirm → receipt), bust-out flow (minimal taps) +- **Tables** — SVG oval table view with seat positions, list view for large tournaments, balancing panel +- **Templates** — LEGO-style building blocks: chip sets, blind structures, payout structures, buy-in configs, assembled into reusable tournament templates + +### Architecture +- **Single Go binary** — Embeds HTTP server, SvelteKit frontend, NATS JetStream, and LibSQL. One process, zero dependencies +- **Offline-first** — Entire operation works without internet. Cloud is never a dependency during a tournament +- **WebSocket real-time** — State changes propagate to all clients within 100ms +- **PIN authentication** — Operators log in with 4-6 digit PINs. Argon2id hashing, rate limiting, JWT sessions + +## Architecture + +``` +┌──────────────────────────────────────────────┐ +│ Leaf Node │ +│ │ +│ ┌──────────┐ ┌──────────┐ ┌────────────┐ │ +│ │ SvelteKit │ │ Go │ │ NATS │ │ +│ │ Frontend │──│ Server │──│ JetStream │ │ +│ │ (embed) │ │ (HTTP) │ │ (embedded) │ │ +│ └──────────┘ └──────────┘ └────────────┘ │ +│ │ │ +│ ┌─────┴─────┐ │ +│ │ LibSQL │ │ +│ │ (SQLite) │ │ +│ └───────────┘ │ +└──────────────────────────────────────────────┘ + │ │ │ + ┌────┴────┐ ┌────┴────┐ ┌────┴────┐ + │ Operator │ │ Display │ │ Player │ + │ Phone │ │ TV/Pi │ │ Phone │ + └─────────┘ └─────────┘ └─────────┘ +``` + +**Stack:** + +| Layer | Technology | Why | +|-------|-----------|-----| +| Backend | Go 1.24 | Single binary, ARM cross-compile, goroutine concurrency | +| Frontend | SvelteKit 2 | Reactive UI, SPA for operator, SSR for public pages | +| Database | LibSQL (SQLite) | Embedded, zero-config, WAL mode, crash-safe | +| Messages | NATS JetStream | Embedded, 10MB RAM, persistent queuing, ordered replay | +| Auth | Argon2id + JWT | Offline PIN login, role-based access | +| Theme | Catppuccin Mocha | Dark-room optimized, systematic accent palette | + +## Getting Started + +### Prerequisites + +- **Go 1.24+** with CGO enabled +- **Node.js 20+** and npm +- Linux (developed on Debian/Ubuntu in LXC) + +### Build & Run + +```bash +# Clone the repository +git clone ssh://git@your-forgejo-instance/mikkel/felt.git +cd felt + +# Build frontend + backend +make all + +# Run in development mode +make run-dev + +# Run tests +make test +``` + +The server starts at `http://localhost:8080`. Open it on any device on the local network. + +### First Run + +1. Navigate to `http://
+ Built with Go, SvelteKit, LibSQL, and NATS JetStream.
+
+ Designed for dark rooms and fast decisions.
+