Back to Projects

Poker Trainer

Next.js 16React 19TypeScriptTailwind v4OllamaClaude APIRecharts

A web-based poker trainer built for sharpening real No-Limit Hold'em decisions, not for entertainment. You sit at seat 0 of a 9-handed $1/$2 NLHE table against 8 AI opponents that each play to a distinct archetype — TAG, LAG, Nit, Calling Station, Maniac, Rock, Fish, Reg — so you face a realistic mix of playing styles. Drill Mode lets you practice specific spots (preflop opens, 3-bet pots, flush draws, river bluff-catching). Every hand can be sent for AI review that grades your decisions street by street with EV estimates and notes. Session stats, bankroll tracking, hand history, and a built-in strategy guide round it out, all stored locally — no accounts, no servers, no money.

Tech Details

Built on Next.js 16 (App Router) with React 19 and TypeScript. The code is split along strict boundaries: pure game logic (dealing, hand evaluation, pot math, action validation) lives in `lib/poker/` with zero React imports — it's a standalone engine that's easy to unit-test and can be re-used for headless simulations. The bot engine in `lib/ai/` implements eight playing archetypes as rule-based policies keyed off hand strength, position, pot odds, and stack depth; keeping bots deterministic rather than LLM-driven means they're fast, cheap, and consistent across hands. AI analysis is a two-track setup. The default is local: an Ollama server runs the review model on the user's machine, so nothing leaves the box and there are no API costs. Optional fallback is the Anthropic SDK with Claude for higher-quality reviews when the user configures an API key. The review prompt ships the full hand history in structured form plus a RAG-style recall of similar past hands pulled from the user's own session log — the model grades each street with EV notes and flags leaks. Persistence is localStorage-only: no backend, no accounts. Session stats, bankroll across sessions, and hand history are all client-side. Recharts drives the stats visualisations. The result is a fully offline-capable training tool that respects privacy and costs nothing to run.

Gallery