Deckhaus — Community Blackjack for Reddit
Inspiration
Reddit already has the ingredients for a great casino floor: usernames people are attached to, karma and flair as social currency, and threads that are really just people gathering around something together. What it doesn't have is a table. Devvit made it possible to turn the post itself — the thing everyone already scrolls past a hundred times a day — into that table. We wanted the simplest possible pitch: you open a Reddit post, and you're sitting down to play blackjack, no link-out, no app install, no separate account.
The "dealer lobby" idea specifically came from thinking about what Reddit has that other platforms don't: moderators who already run their communities like hosts. Letting the OP be the dealer — drawing real cards, standing on 17, watching their community win or lose against them — turned a single-player casino demo into something with an actual host and actual stakes for a subreddit.
What it does
Every Deckhaus post is a live blackjack table, in one of two modes:
- Solo table — play anytime against an automated house dealer that hits to 16 and stands on 17, casino rules.
- Dealer lobby — a moderator creates the table and becomes the dealer; up to 6 community members join the same post, the dealer deals every round, and draws or stands live against the whole group.
Around that core loop: a chip wallet that persists across every table you touch (no re-buying in per post), casino-accurate payouts (2× on a win, 3:2 on a natural blackjack, push returns your stake), double-down, win streak bonuses, daily login rewards, one-off challenges, and a weekly leaderboard. A share of every stake feeds a community prize pool tracked on the post itself. The whole thing renders as a real 3D felt table via Three.js — cards deal, flip face-up, and bust with actual physical motion, not static images.
How we built it
Built entirely on Devvit 0.13.x (Reddit's developer platform), with a React 19 + Vite client and a Hono server running on Devvit's serverless runtime, Redis-backed via @devvit/web/server. The 3D table is a from-scratch Three.js scene — no game engine — with hand-rolled card meshes, deal/flip animation curves, and win particles, textured with real playing-card art and a canvas-drawn felt surface. Styling is Tailwind v4. Game logic (deck building, hand totals, dealer AI, turn order, payout resolution) lives in a pure, framework-free module so it could be unit-tested and rigged with forced decks independent of the UI.
Because there's no way to attach a debugger to a live Devvit webview mid-round, we built our own local test rig: a mock of @devvit/web/server (in-memory Redis, fake Reddit identity via a cookie) that lets the real server routes run standalone, driven by Playwright with two separate browser contexts standing in for two different Reddit users — a mod and a player — so a full multiplayer round can be scripted and watched end-to-end without ever touching a live subreddit.
Challenges we ran into
Multiplayer turn-based state on a serverless, Redis-backed post turned out to have sharp edges we didn't expect:
- A natural blackjack could freeze an entire lobby round. The initial deal never checked for a 21 on the first two cards, so a player dealt blackjack kept
isCurrentTurnstuck true forever — no Hit/Stand button ever showed for them (both require a total under 21), and because turn order only skips players who've already acted, every player behind them was blocked too. Only reproducible by rigging the deck and asserting on the deal output directly, since it depends on a ~4.8%-per-hand shuffle outcome. - Any player could reset the table, not just the dealer. The "start next round" action wasn't gated by dealer identity server-side, so a regular player calling the same endpoint the UI used could wipe a dealer's in-progress hand mid-turn — the hole was on the server, not just a missing button.
- Devvit's serverless runtime kills unawaited promises. Chip awards fired-and-forgot on the response path silently vanished; every Redis/Reddit side effect now has to be awaited before the handler returns.
- Three.js's
Object3D.positionis read-only, and a strayObject.assignon it threw and took down the whole scene with a black canvas — no error visible to a player, just a table that never rendered. - Card animations could get stuck mid-flight.
requestAnimationFramethrottles hard when a post scrolls off-screen or the tab backgrounds, so a card dealt right before that happens can sit frozen at the deck when the player scrolls back.
Accomplishments that we're proud of
Getting a genuinely 3D, animated card table to run smoothly inside a Reddit post webview — not a screenshot of one. Building a dealer-lobby mode where a real person, not a bot, deals and makes decisions live for a group, with the turn-order and payout logic holding up under actual concurrent multiplayer use. And catching multiplayer bugs that would have been invisible from reading the code alone — the stuck-blackjack bug and the round-reset exploit only surfaced once we started actually driving two simulated players through full rounds end-to-end.
What we learned
That a Devvit webview is closer to "trusted client talking to a serverless API" than "game engine with a save file" — every gotcha we hit (silently dropped promises, throttled animation frames, no debugger access) came from treating it like the latter before we'd internalized it's the former. And that turn-based multiplayer state needs the same server-side authorization scrutiny as anything with real stakes attached, even when the stakes are just chips: the client hiding a button is not the same as the server refusing the request.
What's next for Deckhaus
- More table games on the same dealer-lobby model — the "community members join, one person deals" pattern isn't blackjack-specific.
- Tournament / scheduled table events, so a lobby has a start time and a subreddit can rally around it.
- Cosmetic customization for tables and dealers (felt colors, card backs) tied to reputation level, since the Bronze→Legend dealer progression already exists but currently has no visible payoff beyond a badge.
- Sound design for the felt table — deals, flips, and busts currently animate silently.
- A real-time layer (Devvit's realtime channels) to replace the current 2.5s poll, so a lobby table feels instant instead of laggy when someone else is mid-turn.
Log in or sign up for Devpost to join the conversation.