An interactive PokerBot designed for players to train and improve their poker skills by competing against an AI that plays a game-theoretically optimal (GTO) strategy. The React frontend communicates via WebSockets with a Node/Express backend, which invokes a Python GTO.py script to calculate perfect-play recommendations (fold, call, raise). 🚀
- React Frontend
GameControls: deal rounds (hole, flop, turn, river), fold to reset, checks to check, and bet to bet moneyScrollBar: select bet sizing- WebSocket integration for sending hole‑card filenames and receiving analysis
- Node.js Backend
- Serves static card images under
- WebSocket server listens on port 3030
- Buffers four card filenames per deal, identifies hole cards, invokes Python analysis
- Forwards JSON output from Python directly to the client
- Python GTO Analysis (
GTO.py)- Parses two hole‑card filenames and current round
- Computes hand strength via
treysevaluator - Classifies into raise, call, or fold based on thresholds
- Calculates an optional raise amount proportional to pot size
- Node.js v14+ and npm
- Python 3.7+ with packages:
treys
- Clone this repository:
git clone https://github.com/yourusername/pokerbot.git cd pokerbot - Install Node.js dependencies:
npm install
- Install Python dependencies:
pip install treys
- Ensure a
cards/folder exists at project root with all 52 PNG files (e.g.1C.png–13S.png).
node server.js- HTTP server on
http://localhost:3000 - WebSocket server on
ws://localhost:3030
npm startOpens React app on http://localhost:3001 (or configured port).
- Click Check to deal new cards each round.
- Use the ScrollBar to choose a bet amount.
- Click Bet to wager (deducts from balance).
- Click Fold to reset the hand.
MIT © Kurtis Lin
Its not gambling if you know you are going to win