Breakdown

BeatTheOdds

Subscription web app for online blackjack decision support

BeatTheOdds blackjack strategy app

Overview

A subscription web app for live online blackjack decision support. Users enter the visible table state and get a recommendation for hit, stand, double, split, or surrender. The current architecture is a lean Next.js frontend with Supabase Auth and Supabase Edge Functions.

Frontend

Built with Next.js 16, React 19, and TypeScript. The app includes protected play routes and guest-only login/register flows. The live-play UI supports dealer upcard entry, player hand entry, split-hand tracking, decision display, an EV drawer, and table controls like new round, end round, and shuffle. The play screen requests a browser wake lock for live use. The app also includes marketing, pricing, FAQ, support, refund, cancellation, privacy, and terms pages.

Backend / API

There is no standalone custom app server in the current runtime. Supabase Edge Functions handle backend responsibilities. A play-access function gates free plays, subscription checks, and owner resets. Stripe checkout, checkout-status, and portal functions handle subscription flows. A typed frontend API client normalizes billing and auth errors.

Database / Storage

Persistent app state is lightweight and centered on Supabase Auth metadata, storing fields like free plays used, Stripe customer id, and subscription status. In local and non-production mode, free-play gating can fall back to localStorage keyed per user. There is no separate game-state database.

Strategy Engine

The blackjack recommendation engine runs locally in the browser. It computes expected values for stand, hit, double, split, and optional surrender, then chooses the max-EV action. It removes visible cards from a fresh shoe before calculating odds, so decisions reflect the entered table state. Session logic supports split-hand flows and split-ace edge cases.

Testing / Reliability

The repo runs test, lint, typecheck, and build checks. Tests cover blackjack strategy and session behavior, shoe depletion, split handling, blackjack resolution, free-play gating, billing flows, auth helpers, safe return-path handling, subscription status logic, and public marketing and compliance copy.

Important

Built for decision support where users manually enter visible cards. It does not place bets, does not connect to casinos, and makes no claims about guaranteed winnings.

Outcome

A deployable, productized blackjack companion with a live decision UI, account-based free-to-paid access, Stripe subscription flows, and a smaller runtime surface than the earlier backend-heavy version.