# khusshhhhh/teen-patti-pot architecture

> Architecture diagram of the GitHub repository khusshhhhh/teen-patti-pot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khusshhhhh/teen-patti-pot
- Repository: https://github.com/khusshhhhh/teen-patti-pot

## Overview

Teen Patti Pot is a single-page, shareable virtual-chip tracker. Players host or join a table, take turns betting or folding, and the host manages rounds; live table state is shared through Firestore. The README documents cards, reactions, archives, profiles, and device preferences as additional capabilities. The tree contains only index.html and no source excerpts were provided, so all app components map to that file and the graph includes only relationships described in the README.

Main entry points: [`index.html`](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html) (Live table state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tables["Table access"]
  node_table_entry["Host or join<br/>[index.html]"]
  node_table_link["Room link and QR<br/>[index.html]"]
  node_table_roster["Your tables<br/>[index.html]"]
  node_pin_check["Optional PIN<br/>[index.html]"]
end

subgraph group_gameplay["Round gameplay"]
  node_round_setup["Start round and boot<br/>[index.html]"]
  node_card_deal["Deal and view cards<br/>[index.html]"]
  node_hand_rank["Hand ranking<br/>[index.html]"]
  node_turn_betting["Turn betting and fold<br/>[index.html]"]
  node_host_fold["Fold for player<br/>[index.html]"]
  node_showdown["Showdown reveal<br/>[index.html]"]
  node_round_resolution["Award or void<br/>[index.html]"]
  node_reactions["Player reactions<br/>[index.html]"]
end

subgraph group_records["State and records"]
  node_live_table[("Live table state<br/>[index.html]")]
  node_action_feed["Latest action feed<br/>[index.html]"]
  node_leaderboard_history["Leaderboard and history<br/>[index.html]"]
  node_best_hand["Best hand tonight<br/>[index.html]"]
  node_csv_export["CSV export<br/>[index.html]"]
  node_table_archive[("Past Games archive<br/>[index.html]")]
end

subgraph group_device["Device features"]
  node_device_profiles[("Lifetime profiles<br/>[index.html]")]
  node_device_settings["Sound and theme<br/>[index.html]"]
end

node_host(("Host"))
node_players(("Players"))
node_firebase[("Firebase Firestore")]

node_host -->|"hosts table"| node_table_entry
node_players -->|"join table"| node_table_entry
node_table_entry -->|"checks PIN"| node_pin_check
node_table_entry -->|"creates or joins"| node_live_table
node_table_entry -->|"shares room"| node_table_link
node_table_entry -->|"records membership"| node_table_roster
node_table_roster -->|"reopens table"| node_live_table
node_host -->|"starts round"| node_round_setup
node_round_setup -->|"updates round"| node_live_table
node_round_setup -->|"deals cards"| node_card_deal
node_players -->|"views own cards"| node_card_deal
node_card_deal -->|"shows rank"| node_hand_rank
node_players -->|"bets or folds"| node_turn_betting
node_turn_betting -->|"updates turn"| node_live_table
node_host -->|"folds for player"| node_host_fold
node_players -->|"reveals hand"| node_showdown
node_showdown -->|"tracks best hand"| node_best_hand
node_host -->|"awards or voids"| node_round_resolution
node_round_resolution -->|"updates chips"| node_live_table
node_round_resolution -->|"updates standings"| node_leaderboard_history
node_players -->|"sends reaction"| node_reactions
node_live_table -->|"shows actions"| node_action_feed
node_live_table -->|"supplies table results"| node_leaderboard_history
node_leaderboard_history -->|"exports standings"| node_csv_export
node_host -->|"ends table"| node_table_archive
node_table_archive -->|"removes live table"| node_live_table
node_table_entry -->|"reads lifetime stats"| node_device_profiles
node_host -->|"sets preferences"| node_device_settings
node_players -->|"sets preferences"| node_device_settings
node_live_table -->|"syncs shared state"| node_firebase
node_table_archive -->|"stores archive"| node_firebase
node_device_profiles -->|"stores stats"| node_firebase

click node_table_entry "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_table_link "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_table_roster "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_pin_check "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_round_setup "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_card_deal "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_hand_rank "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_turn_betting "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_host_fold "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_showdown "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_round_resolution "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_reactions "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_live_table "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_action_feed "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_leaderboard_history "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_best_hand "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_csv_export "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_table_archive "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_device_profiles "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"
click node_device_settings "https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html"

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_table_entry,node_table_link,node_table_roster,node_pin_check toneBlue
class node_round_setup,node_card_deal,node_hand_rank,node_turn_betting,node_host_fold,node_showdown,node_round_resolution,node_reactions,node_firebase toneAmber
class node_live_table,node_action_feed,node_leaderboard_history,node_best_hand,node_csv_export,node_table_archive toneMint
class node_device_profiles,node_device_settings toneRose
class node_host,node_players toneIndigo
```

## Components

### Table access

- [Host or join](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Room link and QR](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Your tables](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Optional PIN](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`

### Round gameplay

- [Start round and boot](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Deal and view cards](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Hand ranking](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Turn betting and fold](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Fold for player](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Showdown reveal](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Award or void](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Player reactions](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`

### State and records

- [Live table state](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Latest action feed](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Leaderboard and history](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Best hand tonight](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [CSV export](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Past Games archive](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`

### Device features

- [Lifetime profiles](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`
- [Sound and theme](https://github.com/khusshhhhh/teen-patti-pot/blob/main/index.html): `index.html`

### Other components

- **Host**
- **Players**
- **Firebase Firestore**

## Connections

- Host → Host or join: hosts table
- Players → Host or join: join table
- Host or join → Optional PIN: checks PIN
- Host or join → Live table state: creates or joins
- Host or join → Room link and QR: shares room
- Host or join → Your tables: records membership
- Your tables → Live table state: reopens table
- Host → Start round and boot: starts round
- Start round and boot → Live table state: updates round
- Start round and boot → Deal and view cards: deals cards
- Players → Deal and view cards: views own cards
- Deal and view cards → Hand ranking: shows rank
- Players → Turn betting and fold: bets or folds
- Turn betting and fold → Live table state: updates turn
- Host → Fold for player: folds for player
- Players → Showdown reveal: reveals hand
- Showdown reveal → Best hand tonight: tracks best hand
- Host → Award or void: awards or voids
- Award or void → Live table state: updates chips
- Award or void → Leaderboard and history: updates standings
- Players → Player reactions: sends reaction
- Live table state → Latest action feed: shows actions
- Live table state → Leaderboard and history: supplies table results
- Leaderboard and history → CSV export: exports standings
- Host → Past Games archive: ends table
- Past Games archive → Live table state: removes live table
- Host or join → Lifetime profiles: reads lifetime stats
- Host → Sound and theme: sets preferences
- Players → Sound and theme: sets preferences
- Live table state → Firebase Firestore: syncs shared state
- Past Games archive → Firebase Firestore: stores archive
- Lifetime profiles → Firebase Firestore: stores stats
