# purujitaggarwal/fullhouse-hackathon-poker-bot architecture

> Architecture diagram of the GitHub repository purujitaggarwal/fullhouse-hackathon-poker-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/purujitaggarwal/fullhouse-hackathon-poker-bot
- Repository: https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot

## Overview

This repository is a Texas Hold’em competition bot and its local match runtime. The principal workflow is a match runner requesting an action from a bot, applying that action in the poker engine, and repeating until a hand or match completes. Mybot’s decision pipeline updates opponent and range estimates, consults street- and player-count-specific trained strategies, then uses equity-based EV and survival rules as fallback. Training modules and local tournament support are shown as separate capabilities. Several strategy modules are indexed but unsampled, so their internal links are limited to README-documented relationships.

Main entry points: [`bots/mybot/bot_impl.py`](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/bot_impl.py) (Mybot decision), [`sandbox/match.py`](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/sandbox/match.py) (Match runner), [`bots/mybot/preflop_chart.py`](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_chart.py) (Preflop chart), [`bots/mybot/postflop_chart.py`](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_chart.py) (Postflop chart)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Match runtime"]
  node_match["Match runner<br/>[match.py]"]
  node_engine["Poker engine<br/>[game.py]"]
end

subgraph group_strategy["Decision strategy"]
  node_mybot["Mybot decision<br/>[bot_impl.py]"]
  node_profiles["Opponent profiling<br/>[opponent_model.py]"]
  node_tracker["Range tracking<br/>[range_tracker.py]"]
  node_preflop["Preflop chart<br/>[preflop_chart.py]"]
  node_postflop["Postflop chart<br/>[postflop_chart.py]"]
  node_equity["Equity calculation<br/>[equity.py]"]
  node_ranges["Hand ranges<br/>[ranges.py]"]
  node_bluff["Bluff selection<br/>[bluff.py]"]
end

subgraph group_training["Strategy training"]
  node_pre_hu["HU preflop CFR<br/>[preflop_cfr.py]"]
  node_pre_4["4-max preflop CFR"]
  node_pre_6["6-max preflop MCCFR"]
  node_post_hu["HU postflop CFR<br/>[postflop_cfr_hu.py]"]
  node_post_3["3-way postflop CFR"]
  node_abstraction["Postflop abstraction"]
  node_board_buckets["Board buckets"]
end

subgraph group_competition["Tournament play"]
  node_tournament["Tournament rules<br/>[tournament.py]"]
end

node_players(("Bot participants"))

node_players -->|"submit bots"| node_match
node_match -->|"requests state"| node_engine
node_match -.->|"requests action"| node_mybot
node_match -->|"applies action"| node_engine
node_mybot -->|"updates profile"| node_profiles
node_mybot -->|"updates ranges"| node_tracker
node_mybot -->|"consults preflop"| node_preflop
node_mybot -->|"consults postflop"| node_postflop
node_mybot -->|"computes equity"| node_equity
node_mybot -->|"uses ranges"| node_ranges
node_mybot -->|"selects bluffs"| node_bluff
node_preflop -.->|"uses strategy"| node_pre_hu
node_preflop -.->|"uses strategy"| node_pre_4
node_preflop -.->|"looks up strategy"| node_pre_6
node_postflop -.->|"uses strategy"| node_post_hu
node_postflop -.->|"uses strategy"| node_post_3
node_post_hu -.->|"uses abstraction"| node_abstraction
node_post_3 -.->|"uses abstraction"| node_abstraction
node_abstraction -.->|"uses board classes"| node_board_buckets
node_tournament -.->|"pairs competitors"| node_match

click node_match "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/sandbox/match.py"
click node_engine "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/engine/game.py"
click node_mybot "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/bot_impl.py"
click node_profiles "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/opponent_model.py"
click node_tracker "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/range_tracker.py"
click node_preflop "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_chart.py"
click node_postflop "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_chart.py"
click node_equity "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/equity.py"
click node_ranges "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/ranges.py"
click node_bluff "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/bluff.py"
click node_pre_hu "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_cfr.py"
click node_pre_4 "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_cfr_4max.py"
click node_pre_6 "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_cfr_6max.py"
click node_post_hu "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_cfr_hu.py"
click node_post_3 "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_cfr_3max.py"
click node_abstraction "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_buckets.py"
click node_board_buckets "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_board_buckets.py"
click node_tournament "https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/engine/tournament.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_match,node_engine toneBlue
class node_mybot,node_profiles,node_tracker,node_preflop,node_postflop,node_equity,node_ranges,node_bluff toneAmber
class node_pre_hu,node_pre_4,node_pre_6,node_post_hu,node_post_3,node_abstraction,node_board_buckets toneMint
class node_tournament toneRose
class node_players toneIndigo
```

## Components

### Match runtime

- [Match runner](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/sandbox/match.py): `sandbox/match.py`
- [Poker engine](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/engine/game.py): `engine/game.py`

### Decision strategy

- [Mybot decision](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/bot_impl.py): `bots/mybot/bot_impl.py`
- [Opponent profiling](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/opponent_model.py): `bots/mybot/opponent_model.py`
- [Range tracking](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/range_tracker.py): `bots/mybot/range_tracker.py`
- [Preflop chart](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_chart.py): `bots/mybot/preflop_chart.py`
- [Postflop chart](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_chart.py): `bots/mybot/postflop_chart.py`
- [Equity calculation](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/equity.py): `bots/mybot/equity.py`
- [Hand ranges](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/ranges.py): `bots/mybot/ranges.py`
- [Bluff selection](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/bluff.py): `bots/mybot/bluff.py`

### Strategy training

- [HU preflop CFR](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_cfr.py): `bots/mybot/preflop_cfr.py`
- [4-max preflop CFR](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_cfr_4max.py): `bots/mybot/preflop_cfr_4max.py`
- [6-max preflop MCCFR](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/preflop_cfr_6max.py): `bots/mybot/preflop_cfr_6max.py`
- [HU postflop CFR](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_cfr_hu.py): `bots/mybot/postflop_cfr_hu.py`
- [3-way postflop CFR](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_cfr_3max.py): `bots/mybot/postflop_cfr_3max.py`
- [Postflop abstraction](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_buckets.py): `bots/mybot/postflop_buckets.py`
- [Board buckets](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/bots/mybot/postflop_board_buckets.py): `bots/mybot/postflop_board_buckets.py`

### Tournament play

- [Tournament rules](https://github.com/purujitaggarwal/fullhouse-hackathon-poker-bot/blob/main/engine/tournament.py): `engine/tournament.py`

### Other components

- **Bot participants**

## Connections

- Bot participants → Match runner: submit bots (evidence: `sandbox/match.py`)
- Match runner → Poker engine: requests state (evidence: `sandbox/match.py`)
- Match runner → Mybot decision: requests action
- Match runner → Poker engine: applies action (evidence: `sandbox/match.py`)
- Mybot decision → Opponent profiling: updates profile (evidence: `bots/mybot/bot_impl.py`)
- Mybot decision → Range tracking: updates ranges (evidence: `bots/mybot/bot_impl.py`)
- Mybot decision → Preflop chart: consults preflop (evidence: `bots/mybot/bot_impl.py`)
- Mybot decision → Postflop chart: consults postflop (evidence: `bots/mybot/bot_impl.py`)
- Mybot decision → Equity calculation: computes equity (evidence: `bots/mybot/bot_impl.py`)
- Mybot decision → Hand ranges: uses ranges (evidence: `bots/mybot/bot_impl.py`)
- Mybot decision → Bluff selection: selects bluffs (evidence: `bots/mybot/bot_impl.py`)
- Preflop chart → HU preflop CFR: uses strategy
- Preflop chart → 4-max preflop CFR: uses strategy
- Preflop chart → 6-max preflop MCCFR: looks up strategy
- Postflop chart → HU postflop CFR: uses strategy
- Postflop chart → 3-way postflop CFR: uses strategy
- HU postflop CFR → Postflop abstraction: uses abstraction
- 3-way postflop CFR → Postflop abstraction: uses abstraction
- Postflop abstraction → Board buckets: uses board classes
- Tournament rules → Match runner: pairs competitors
