Configuration
Relevant source files
The following files were used as context for generating this wiki page:Configuration in the Hold'em or Fold'em Poker application spans multiple layers, from high-level project setup and dependencies to detailed in-game parameters. This document outlines the key configuration areas, including the project's technical stack, UI theming, and the specific rules and structures that define the various poker game modes, tournaments, and cash game tables.
These configurations are primarily managed through static object definitions within React components, CSS variables for styling, and the central package.json file for project-level settings. Understanding these configurations is crucial for modifying game behavior, adding new game types, or altering the application's appearance.
Project Configuration
The root of the project's configuration is package.json, which defines metadata, scripts for running and building the application, and a comprehensive list of dependencies that form the technical foundation.
Sources: package.json
Scripts
The project utilizes Next.js scripts for development, building, and linting.
| Script | Description |
|---|---|
dev | Starts the Next.js development server. |
build | Creates an optimized production build of the application. |
start | Starts the Next.js production server. |
lint | Runs the Next.js linter to check for code quality and errors. |
Sources: package.json:5-10
Key Dependencies
The application is built on the Next.js framework with React and TypeScript. It uses Tailwind CSS for styling and relies on several key libraries for UI components, state management, and form handling.
| Dependency | Description |
|---|---|
next | The React framework for production. |
react | A JavaScript library for building user interfaces. |
tailwindcss | A utility-first CSS framework for styling. |
@radix-ui/* | A collection of unstyled, accessible UI components. |
lucide-react | A library of simply beautiful open-source icons. |
recharts | A composable charting library built on React components. |
zod | A TypeScript-first schema declaration and validation library. |
react-hook-form | A library for flexible and extensible forms with easy-to-use validation. |
Sources: package.json:12-61
UI & Theming Configuration
The application's visual theme is configured in app/globals.css using CSS custom properties. It defines two distinct themes: a default (light) theme and a dark theme, which can be activated by applying the .dark class. These variables control colors for backgrounds, text, cards, interactive elements, and charts.
Sources: app/globals.css
Color Variables
The following tables summarize the primary color variables for both light and dark themes.
Light Theme (:root)
| Variable | Value | Description |
|---|---|---|
--background | oklch(1 0 0) | Page background color. |
--foreground | oklch(0.145 0 0) | Default text color. |
--primary | rgb(88, 88, 109) | Primary interactive element color. |
--primary-foreground | rgb(255, 185, 0) | Text color on primary elements. |
--destructive | oklch(0.577 0.245 27.325) | Color for destructive actions (e.g., errors). |
--border | oklch(0.922 0 0) | Component border color. |
--chart-4 | oklch(0.828 0.189 84.429) | A primary chart and accent color. |
Sources: app/globals.css:5-41
Dark Theme (.dark)
| Variable | Value | Description |
|---|---|---|
--background | oklch(0.145 0 0) | Page background color. |
--foreground | oklch(0.985 0 0) | Default text color. |
--primary | oklch(0.985 0 0) | Primary interactive element color. |
--primary-foreground | oklch(0.205 0 0) | Text color on primary elements. |
--destructive | oklch(0.396 0.141 25.723) | Color for destructive actions (e.g., errors). |
--border | oklch(0.269 0 0) | Component border color. |
--chart-4 | oklch(0.627 0.265 303.9) | A primary chart and accent color. |
Sources: app/globals.css:44-80
Game Configuration
The core gameplay experience is defined by a set of static configurations for tournaments, cash game tables, and fundamental game rules. These are primarily located within their respective UI components.
Tournament Configuration
Tournament parameters are defined as an array of TournamentConfig objects within the TournamentLobby component. These configurations dictate everything from the tournament name and buy-in to the blind structure and prize distribution.
The diagram below shows the structure of the TournamentConfig and related BlindLevel types.
This diagram illustrates the data structure for tournament configurations.
Sources: components/tournament-lobby.tsx:21-93, components/tournament-structure.tsx:6-7
Pre-defined Tournaments
The tournament-lobby.tsx component contains a hardcoded list of available tournaments.
| Name | Type | Buy-in | Players | Blinds |
|---|---|---|---|---|
| Heads-Up Showdown | headsup | 500 | 2-8 | Heads-Up |
| Turbo Shootout | turbo | 1,000 | 6-18 | Turbo |
| Bounty Hunter | bounty | 2,000 | 9-27 | Default |
| Regular Tournament | regular | 5,000 | 9-36 | Default |
Sources: components/tournament-lobby.tsx:22-93
Cash Game Table Configuration
The TableSelection component defines the structure and available options for cash game tables. Each table is represented by a StakeTable object, which specifies the stakes, buy-in range, and other table attributes.
The diagram below shows the structure of the StakeTable interface.
This diagram illustrates the data structure for cash game table configurations.
Sources: components/table-selection.tsx:11-22
Available Stakes
The following tables are configured in table-selection.tsx for cash games.
| Name | Blinds | Min Buy-in | Max Buy-in | Difficulty | VIP |
|---|---|---|---|---|---|
| Micro Stakes | 10 / 20 | 400 | 2,000 | Beginner | No |
| Low Stakes | 50 / 100 | 2,000 | 10,000 | Beginner | No |
| Medium Stakes | 500 / 1,000 | 20,000 | 100,000 | Intermediate | No |
| High Stakes | 5,000 / 10,000 | 200,000 | 1,000,000 | Advanced | No |
| VIP Exclusive | 50,000 / 100,000 | 2,000,000 | 10,000,000 | Expert | Yes |
| Whale Room | 100,000 / 200,000 | 4,000,000 | 20,000,000 | Expert | Yes |
Sources: components/table-selection.tsx:36-150
Game Rules Configuration
The fundamental rules of poker, including game variants and hand rankings, are statically defined within the RulesPage component. This component serves as an in-game reference for players.
Sources: components/rules-page.tsx
Game Variants
The rules for different poker variants are configured as distinct sections.
- Texas Hold'em: Players receive 2 hole cards and share 5 community cards.
- Omaha: Players receive 4 hole cards and MUST use exactly 2 of them with exactly 3 of the 5 community cards.
Sources: components/rules-page.tsx:25-41, 114-121
Hand Rankings
The universal poker hand rankings are defined in descending order of strength.
| Hand | Description |
|---|---|
| Royal Flush | A-K-Q-J-10 of the same suit. |
| Straight Flush | Five cards in sequence, all of the same suit. |
| Four of a Kind | Four cards of the same rank. |
| Full House | Three of a kind with a pair. |
| Flush | Any five cards of the same suit, not in sequence. |
| Straight | Five cards in sequence, but not of the same suit. |
| Three of a Kind | Three cards of the same rank. |
| Two Pair | Two different pairs. |
| Pair | Two cards of the same rank. |
| High Card | When no other hand is made, the highest card plays. |
Sources: components/rules-page.tsx:55-98
Tournament Formats
The rules also outline different tournament structures.
- Sit and Go (SNG): Starts as soon as the required number of players (typically 6-9) register. The standard prize distribution for a 9-player SNG is 50% for 1st, 30% for 2nd, and 20% for 3rd.
- Multi-Table Tournament (MTT): Accommodates a large number of players across multiple tables, which are consolidated as players are eliminated.