Developer Overview

Welcome to the Poker Engine developer guide. This documentation is for developers who want to understand, extend, or contribute to the codebase.

Prerequisites

SoftwareVersionPurpose
Node.js20.19+Runtime
npm10.x+Package manager
Docker24.x+PostgreSQL container
Git2.x+Version control

Quick Start

# 1. Clone and install
git clone <repository-url>
cd poker-engine
npm install          # Root install covers the client and packages/* workspaces

# 2. Start PostgreSQL
docker compose up -d postgres

# 3. Configure environment
cp .env.example .env
# Edit .env — the placeholder secrets are rejected at startup; see setup.md

# 4. Set up the database
npm run db:generate
npm run db:migrate
npm run db:seed

# 5. Start development servers
npm run dev          # Backend: http://localhost:3000
npm run dev:client   # Frontend: http://localhost:5173

Verify Installation

curl http://localhost:3000/health   # "status" is "ok" when healthy
npm test                            # Run the test suite
npm run typecheck                   # Type-check backend, scripts and workspaces

Guide Index

Core Development

GuideContents
SetupDocker, environment variables, database, IDE config
ArchitectureLayer overview, tech stack, data flow, directory structure
Game EngineCards, hand evaluation, state machine, pot management, all variants
API DevelopmentREST routes, Zod validation, response format, error handling, middleware
WebSocket DevelopmentConnection lifecycle, typed events, pipeline, broadcasting, client hooks
DatabasePrisma operations, migrations, transactions, schema conventions, seeding
TestingVitest, unit/integration tests, property-based testing, mocking

Feature Systems

GuideContents
Tournament EngineMTT, Sit & Go, Satellite, rule profiles, audits, compliance scenarios
Bot SystemBot architecture, strategy profiles, identity pool, scheduler
FrontendReact components, Zustand store, WebSocket hooks, Vite config
Integration APIDeveloper API, external user sync, JWT authentication
Player SessionsSession lifecycle, table tracking, stats, orphan healing
Payment ProvidersStripe, CoinPayments, BTCPay Server, PayPal, Skrill, Neteller, MuchBetter, ecoPayz, bank transfer

Infrastructure & Ops

GuideContents
SecurityAuthentication, CSRF, rate limiting, KYC, 2FA
ConfigurationAdmin Panel settings, DB-backed config, feature flags
Extension GuideAdding variants, payment providers, bot strategies
MonorepoShared packages, workspace structure, mobile app
CI/CD & ReleasesGitHub Actions, Docker, release workflow, versioning

Key Concepts

  • Game settings are in the database, not env vars. SMTP, rake, buy-in limits, feature flags — all managed via the Admin Panel.
  • Environment variables are validated at startup via Zod (src/config/env-schema.ts, loaded by src/config/env.ts). Missing required vars will crash on startup.
  • WebSocket events flow through a typed pipeline (validation → authorization → rate limiting → idempotency, then the event handler and its broadcasts).
  • Poker variants each have a dedicated evaluator registered in HandEvaluatorFactory. To add a new variant, register a new evaluator there.
  • Tournament procedure claims must match the active rule profiles and the deterministic compliance matrix in src/game/verification/tournament-compliance.ts. See Tournament Engine and Gameplay Verification Suite.

Last Updated: October 2026

Try the live demo Pricing

Have questions about Poker Engine? We reply fast.