| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A server-authoritative No-Limit Texas Hold'em platform and C++ poker-AI research lab.
PokerArena combines a real-time multiplayer poker application with an experimental MCCFR engine. The web and iOS clients send player intent; the backend owns cards, legal actions, pots, showdown, persistence, and AI orchestration.
Important
The application is playable, but the AI research is not a finished GTO product. This repository does not claim NL50 strength, low exploitability, or production-ready game-theoretic optimality. Trained blueprints are large generated artifacts and are not included in Git.
PokerArena deliberately separates working software from unproven poker strength.
The detailed research record is in:
HTTPS / WebSocket
┌────────────────┐ ┌──────────────────────────┐
│ Web / iOS │ ◄─────────────────► │ FastAPI backend │
│ clients │ │ │
└────────────────┘ │ • auth and rooms │
│ • authoritative game │
│ • persistence and stats │
│ • AI orchestration │
└────────────┬─────────────┘
│ line-delimited JSON
▼
┌──────────────────────────┐
│ C++20 engine │
│ │
│ • blueprint lookup │
│ • MCCFR training │
│ • profiling / research │
│ • decision server │
└──────────────────────────┘
The backend is always authoritative. Clients never decide card order, action legality, pot distribution, or winners.
PokerArena/
├── backend/ FastAPI, rooms, game engine, auth, stats, AI glue
│ ├── api/ HTTP and WebSocket routes
│ ├── application/ Room and hand orchestration
│ ├── domain/ Transport-independent room rules
│ ├── game/ Hold'em state machine and settlement
│ ├── infrastructure/ai/ Persistent C++ decision client
│ └── tests/ Backend regression suite
├── frontend/ React 19 + TypeScript + Vite client
├── engine/ C++20 trainer, runtime, probes, and tests
├── clients/ios/ iOS client/reference code
├── scripts/ Training, evaluation, and diagnostic tools
├── doc/ Architecture and research documentation
└── start.sh Local backend/frontend launcher
git clone https://github.com/nullptr0807/PokerArena.git
cd PokerArena
python3 -m venv backend/.venv
source backend/.venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r backend/requirements.txt
cd frontend
npm ci
cd ..source backend/.venv/bin/activate
cd backend
python -m uvicorn api.server:app --host 127.0.0.1 --port 8000 --reloadCheck it:
curl http://127.0.0.1:8000/healthAPI documentation is available at http://127.0.0.1:8000/docs.
In a second terminal:
cd frontend
npm run dev -- --host 127.0.0.1 --port 3000Open http://127.0.0.1:3000.
After installing both backend and frontend dependencies:
./start.shFor a deployment mounted below /poker/ instead of /, set:
VITE_BASE_PATH=/poker/ ./start.shThe development defaults use SQLite and an in-memory room registry.
| Variable | Purpose | Default |
|---|---|---|
| POKER_DATABASE_URL | SQLModel database URL | sqlite:///./data/poker_arena.db |
| POKER_JWT_SECRET | JWT signing secret | development-only placeholder |
| POKER_ENV | development or production | development |
| POKER_ENABLE_LEGACY_WS | Enable unauthenticated legacy game socket | enabled outside production |
| POKER_ROOM_REGISTRY | memory or redis | memory |
| POKER_REDIS_URL | Redis connection URL | redis://localhost:6379/0 |
| POKER_AI_DECIDE_BINARY | Path to the C++ decision server | engine/build/decide |
| POKER_AI_BLUEPRINT_PATH | Path to a compatible blueprint | local generated run |
Warning
Production startup rejects the default JWT secret. Set a strong POKER_JWT_SECRET, restrict CORS to trusted origins, disable the legacy WebSocket route, and use TLS at the reverse proxy.
cmake -S engine -B engine/build -DCMAKE_BUILD_TYPE=Release
cmake --build engine/build -j
ctest --test-dir engine/build --output-on-failureMain binaries:
| Binary | Purpose |
|---|---|
| engine/build/train | MCCFR training |
| engine/build/decide | Persistent JSON decision server |
| engine/build/blueprint_probe | Inspect one runtime decision |
| engine/build/abstraction_audit | Audit abstraction distortion |
| engine/build/continuation_probe | Generate continuation-value evidence |
| engine/build/advantage_probe | Generate repeated-action advantage evidence |
A model run normally contains:
engine/runs/<run-id>/
├── blueprint.bin
├── abstraction.bin
├── metadata.json
├── checkpoint_*.bin
└── training.log
engine/runs/ and *.bin are intentionally ignored. Do not copy an arbitrary blueprint into the runtime and assume compatibility; validate its metadata and run a decision/evaluation smoke first.
source backend/.venv/bin/activate
cd backend
python -m pip install pytest
python -m pytest -qCurrent verified result: 272 passed, 16 skipped.
cd frontend
node --test tests/*.test.ts
npm audit --audit-level=high
npm run buildCurrent verified result: 24 tests passed, 0 known npm vulnerabilities, production build succeeded.
cmake --build engine/build -j
ctest --test-dir engine/build --output-on-failureCurrent verified result: 3/3 CTest targets passed.
A higher average score is not enough. A candidate must be compared with the current baseline using:
A candidate that improves one matchup by weakening another is recorded as an experiment, not promoted.
Generated and local-only data must stay out of Git:
If a model must be distributed, publish it through a separate artifact store with its metadata, engine revision, checksums, and evaluation report.
No open-source license is currently granted. Public source availability does not by itself grant permission to copy, modify, or redistribute the code.
| Back | FazBrowse Home | New Git URL |