Skip to content
← Back

The Cap Room

An NBA front-office console for cap sheets, explainable two-team trade checks, and player evaluation.

Live Next.jsTypeScriptReactVitest
The Cap Room: An NBA front-office console for cap sheets, explainable two-team trade checks, and player evaluation.

Live on Vercel with public code. Current roster snapshot is dated 2026-08-04.

The idea

The Cap Room turns a dense CBA rulebook into a focused front-office console. It combines cap sheets, player context, and two-team trade validation so a user can see both the verdict and the reasoning behind it.

What I built

The core is a pure TypeScript engine for cap-sheet math, salary matching, apron restrictions, hard-cap triggers, roster limits, cash, and pick rules. It imports nothing from the interface and has 44 unit tests, so the same rules power the API and the user experience.

The Trade Machine produces a Rule Ledger instead of a bare legal or illegal label. Each check carries its status and calculation in plain language, while the full proposal lives in the URL as a reproducible link. Seed data is schema-validated and every roster is re-summed through the engine against its published total before build.

The hard parts

01

Prose rules as composable checks

The CBA describes interacting conditions, not a ready-made decision tree. The engine models those conditions as small checks that can report a pass, failure, warning, and supporting numbers.

02

Evidence with every verdict

A trade tool needs to explain what changed the result. The Rule Ledger makes salary limits, apron restrictions, pick ownership, and hard-cap consequences visible to the person evaluating the deal.

03

Snapshot data with explicit limits

Roster data changes quickly in the offseason. The app uses a dated, source-linked snapshot and surfaces unknown values instead of filling gaps with estimates.

What’s next

Refresh the roster snapshot and expand pick and trade coverage.