A comprehensive poker training application built with React 19, featuring a Texas Hold'em game engine, AI opponents with adaptive strategies, and an interactive learning system.
Live Demo: https://brightlikethelight.github.io/PokerTrainer
- Complete Texas Hold'em implementation with all betting rounds
- Accurate hand evaluation and winner determination
- Side pot calculations for all-in scenarios
- Position-based play with proper blind structure
- Four distinct AI player types:
- TAG (Tight-Aggressive): Plays few hands but bets aggressively
- LAG (Loose-Aggressive): Plays many hands with high aggression
- TP (Tight-Passive): Plays few hands, prefers calling
- LP (Loose-Passive): Plays many hands, rarely raises
- Position-aware decision making
- Opponent modeling and adaptive strategies
- Practice Sessions: Scenario-based training for preflop and postflop decisions
- Concepts Library: Educational content on poker fundamentals, intermediate concepts, and advanced strategies
- Hand History: Review and analyze your played hands
- Node.js 20.0.0 or higher
- npm 9.0.0 or higher
git clone https://github.com/brightlikethelight/PokerTrainer.git
cd PokerTrainer
npm install
npm startThe application will open at http://localhost:3000.
npm start # Start development server
npm test # Run tests in watch mode
npm run test:ci # Run tests with coverage
npm run build # Create production build
npm run lint # Check code style
npm run lint:fix # Fix code style issuessrc/
├── components/ # React UI components
│ ├── game/ # Game interface (PokerTable, Card, PlayerSeat)
│ ├── study/ # Learning components (Practice, Concepts, History)
│ └── common/ # Shared components
├── game/ # Core game logic
│ ├── engine/ # Game engine, AI, betting logic
│ │ └── strategies/ # AI strategy implementations
│ ├── entities/ # Game objects (Card, Deck, Player, GameState)
│ └── utils/ # Hand evaluation, position helpers
├── hooks/ # Custom React hooks
├── analytics/ # Hand history tracking
└── constants/ # Game constants and configuration
The project maintains comprehensive test coverage:
npm run test:ci # Run all tests with coverage reportTest Suites:
- GameEngine: 51 tests
- GameState: 65 tests
- BettingLogic: 48 tests
- PositionStrategy: 30 tests
- OpponentModel: 60 tests
- ScenarioGenerator: 23 tests
- Component tests for Card, PlayerSeat, PokerTable
- Frontend: React 19.1.0
- Routing: React Router 6
- Testing: Jest, React Testing Library
- Code Quality: ESLint, Prettier, Husky
- CI/CD: GitHub Actions
- Deployment: GitHub Pages
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Make your changes with appropriate tests
- Run
npm run lintandnpm test - Commit using conventional commits (
feat:,fix:,docs:) - Push and create a pull request
MIT License - see LICENSE for details.
Bright Liu - [email protected]
This is an educational project demonstrating React development, game logic implementation, and software engineering best practices.