All projects

Stack Society HUD

A complete analytics and study platform for a poker community.

Product screenshot. Displayed figures reflect the captured dataset.

Overview

Overview

I built StackHUD to connect a poker community’s game history: the sessions people played, the money that changed hands, and the decisions worth revisiting. It brings PokerNow exports into one product for exploring results, understanding player tendencies, and reviewing individual hands.

The result is a deployed platform spanning data collection, a normalized database, player profiles, financial reporting, an interactive replayer, and private study tools. I developed the product from the underlying poker semantics through the web experience, keeping the original records connected to the insights people see.

Context

Project context and goals

Context

Poker and building software are two interests that came together in this project. Within a Discord poker community, each PokerNow session produced useful history: hands, wagers, player names, and a closing ledger. Much of that information remained separated by game, even when the same people played together repeatedly.

I wanted a place where players could move naturally between the big picture and the details. The dashboard introduces activity, results, and notable hands; the rest of the product helps answer what happened, how a player tends to play, and what deserves another look.

The Problem

Inconsistent identities, actions, and financial records

The Problem

Combining exports meant resolving differences that could otherwise distort every chart. A person could appear under multiple identities, an action’s meaning depended on the preceding bets, and financial amounts needed consistent units. Even a familiar percentage could mislead if it counted the wrong opportunities.

I treated these as product requirements. Users needed a consistent history, statistics with understandable sample sizes, and a way to inspect the hands behind a result. Administrators needed review tools for ambiguity that could not safely be resolved automatically.

01

Preserve the evidence

Keep raw exports alongside the records and summaries derived from them.

02

Resolve player identities

Review aliases and PokerNow identities before combining a player’s history.

03

Report sample sizes

Pair statistics with their opportunities, reporting scope, and supporting hands.

Data foundation

Data ingestion and storage

Data foundation

The collection workflow begins with game links tracked in Discord and an acquisition queue. A TypeScript parser transforms hand-history JSON into games, hands, players, actions, cards, and pot awards. PostgreSQL stores these relationships through Prisma, while validation checks the imported records against their source files.

Two sources retain distinct responsibilities: hand histories describe the poker, and ledger exports describe session finances. Reviewed canonical identities connect both to the same player. Derived profiles and action-state snapshots then support a Fastify API and a Next.js interface, giving several product features a common foundation.

Data processing pipeline

  1. 01Collect

    Game logs and settlement ledgers retain their source.

  2. 02Reconstruct

    Parse hands, actions, seats, and street transitions.

  3. 03Reconcile

    Resolve player identity and verify amount units.

  4. 04Explore

    Serve profiles, statistics, replay, and study tools.

Raw evidence → normalized PostgreSQL records → API → Next.js interface

Raw exports remain the evidence; normalized records connect them to profiles, financial results, and replay.
Codebase architecture

Applications, shared packages, and storage

Codebase architecture

The codebase separates collection, domain processing, API services, and the web application. The Discord bot records game links; the downloader retrieves source files; parsing and import scripts write structured records through shared database packages.

The Next.js interface requests poker data through a gateway to the Fastify API. Shared modules provide consistent statistics and player-analysis definitions. Private study notes follow a separate route to a user-specific store, so they remain separate from poker-data imports.

StackHUD codebase and data connections

How a game becomes structured data

apps/discord-bot1. Register a game

The bot records a shared PokerNow game URL. A download queue tracks the source game so the same session can be collected and processed consistently.

Game URL → acquisition queue
workers/downloader2. Preserve the original exports

Retrieve hand-history JSON and ledger CSV. Keep the original files so a parsed hand or financial result can be checked against its source.

Two sources with different responsibilities
packages/pokernow-parser3a. Reconstruct the poker

Turn the log into seats, cards, streets, ordered actions, and pot awards. Interpret each action in the context of the preceding wagers.

packages/ledger-units3b. Reconcile the money

Read buy-ins and cash-outs, normalize amount units, and preserve source rows. These records define session finances independently of the hand log.

Import scripts + reviewed player identities
packages/db · Prisma4. Store connected records

Prisma writes the normalized records to PostgreSQL. Games connect to hands and actions; reviewed canonical players connect aliases, statistics, and financial results.

How a page retrieves its information

apps/web · Next.js5. Request a view

A profile, comparison, ranking, or replay requests the data needed for the selected player, hand, or reporting filters. Shared client hooks manage loading and cached responses.

Requests follow separate data and study routes
/api/data6a. Forward poker-data requests

The Next.js gateway forwards allowed requests to the API service. Filters travel with the request.

Query and filter parameters
apps/api7. Query and calculate

Read normalized records and return statistics, sample counts, player summaries, or the actions required to reconstruct a hand.

Prisma queries → structured response
packages/dbShared poker records

The same PostgreSQL records power several views. A statistic and its supporting hands remain connected to the same source history.

/api/study6b. Load private study work

Resolve the signed-in user before reading or saving their review material.

Session user ID → private storage key
packages/study-store.tsUser study store

A separate per-user JSON store keeps saved hands, notes, and review status out of the shared poker-data import path.

The collection path writes the poker database; the application path reads it. Study notes have a separate storage path tied to the signed-in user.

Module connections from the implemented repository. The ingestion and application paths share the normalized poker database.
Player analysis

Player profiles and statistics

Player analysis

A player profile combines results, volume, playing tendencies, and identity history. General statistics provide an entry point, while detailed preflop and postflop views expose specific situations. The goal is to make a pattern explorable without requiring users to reconstruct it across separate game files.

Play-style analysis adds cumulative winnings, showdown and non-showdown results, rolling win rates, sizing patterns, and comparisons with the player pool. Opportunity counts give conditional statistics context. Changing a rolling window changes the recent-performance view while preserving the underlying cumulative totals.

StackHUD player profile: OverviewView full size

A player’s activity and key statistics in one view.

Explore actual profile views: overview, profit and loss, detailed statistics, play style, opponent context, and history.
Player comparisons

Compare player statistics and sample sizes

Player comparisons

The comparison panel supports selecting two to four players using names, aliases, or PokerNow identities. It places financial results, preflop tendencies, postflop tendencies, and playing volume side by side.

Conditional statistics include their numerators and opportunity counts. Sample-quality labels help distinguish supported patterns from limited evidence. Observed-pattern summaries and profile links provide a starting point for deeper analysis; comparisons should use matching games, stakes, and table sizes.

Actual StackHUD comparison of sb, tiger, and Jh, showing hand counts, financial results, preflop statistics, continuation bets, and opportunitiesView full size ↗
Screenshots of StackHUD’s implemented comparison interface, populated with public player statistics. Switch views to see player selection and the resulting side-by-side comparison.
Leaderboards

Rank players using explicit reporting criteria

Leaderboards

Leaderboards combine financial outcomes, volume, and playing statistics in a sortable table. Users can rank by net profit, BB per 100 hands, average profit per game, hands, games, or supported betting statistics.

Search, reporting-period, stake, minimum-hand, and confidence filters narrow the population before interpreting a ranking. Opportunity counts remain visible for conditional rates so a high percentage can be assessed alongside its underlying sample.

StackHUD leaderboard with player search, ranking metrics, stakes, minimum-hand filters, and sample confidenceView full size
The actual leaderboard interface includes ranking controls, sample filters, and player-level statistics.
Hand replay

Step through a real nine-player hand

Hand replay

Hand search connects broad questions to concrete examples. Players can look for situations and action sequences, then open the relevant hand rather than interpreting an aggregate in isolation. Evidence links can jump to the action that matters, including hands that would be missed by a biggest-pot view.

The replayer reconstructs the board, wagers, stacks, and action timeline as the hand unfolds. That presentation depends on the same contextual action semantics used by the statistics. Keeping those interpretations aligned makes the replay a useful way to inspect the analysis.

Try the actual replayer below with a recorded single-board hand. Nine players are seated, five put money in voluntarily before the flop, and two continue to a showdown worth $8,083. Pocket jacks make four of a kind against a full house made with pocket aces.

9 players · Single board · $8,083 final potOpen larger replay ↗

Drag the timeline and select an action. Arrows step through the hand; double arrows jump to the start or showdown.

The working StackHUD replayer uses its real public demo hand. Table state, wagers, stacks, and pot change as you navigate the recorded actions.
StackHUD action-history table with street, player, action, wager, pot, and stack informationView full size
A separate hand’s detailed action table exposes the wagers, pot sizes, and stack changes behind the replay.
Financial accounting

Ledger reconciliation and financial reporting

Financial accounting

Financial reporting starts with ledger buy-ins and cash-outs. The import path normalizes amounts, retains source rows, and produces player results for each game. Those results feed the ledger, financial leaderboards, and longer-term player summaries.

Identity reconciliation matters here as much as it does for playing statistics: an alias should not split someone’s history, and a shared name should not combine different people. Reviewable mappings and accounting checks make those relationships explicit before they become lifetime totals.

Financial normalization and reconciliation

  1. 01Source amounts

    Read each game's chip and currency context.

  2. 02Normalize units

    Apply verified scale consistently to financial amounts.

  3. 03Reconcile

    Check buy-ins, cash-outs, balances, and ledger totals.

  4. 04Review outcomes

    Present session results with traceable evidence.

Ledger rows become normalized amounts, reconciled session results, and canonical-player financial summaries.
StackHUD ledger review showing financial totals, player results, buy-ins, and cash-outsView full size
The ledger interface groups buy-ins, cash-outs, and net results by player, with filters and financial summaries.
Study workflow

Saved hands, practice, and equity analysis

Study workflow

My Study supports saving and reviewing decisions found during analysis. Players can save hands, write private notes, organize tags and filters, track review status, and export review packets. Practice asks users to record their reasoning before revealing the outcome, preserving the distinction between a good result and a good decision.

The equity workbench supports another kind of investigation: comparing weighted ranges with board cards, blockers, and dead cards. It reports exact or reproducibly sampled results where supported. Together, these tools turn an interesting hand into something the player can investigate and revisit.

StackHUD poker study tools and hand analysis workspaceView full size
The equity workbench complements saved hands and private review notes with scenario exploration.
Outcome

Product scope and results

Outcome

StackHUD is live, with a public dashboard and previews leading into member features. An inspected local corpus snapshot contained 339,635 hands; local validation recorded more than 5.7 million actions and 994 ledger imports. These describe the inspected dataset, not current live usage or a count of registered users.

The central achievement is the connection across the product: a session leads to a player, a statistic leads to supporting hands, and a replay leads to a saved review. Building that chain taught me to design data definitions and user interactions together. The interface is most useful when its explanations remain connected to evidence.

Next projectPrompt Compression