Full-Stack Development Real-Time Systems Product Engineering Multiplayer Architecture Game Design Social Mechanics AI-Native Development

Social Craps

A real-time, browser-based multiplayer crapless craps platform engineering social layer mechanics, including crowd-wisdom heatmaps, peer-to-peer ride-along betting, and tiered spectator permissions, to monetize online gambling audience engagement.

Social Craps Clean Table UI
SECTION 01

Abstract

Traditional online casino platforms treat gambling as an isolated, single-player transaction, severing the essential social energy that drives live table games like craps. Social Craps re-architects online table gaming around real-time multiplayer dynamics, spectator involvement, and viral sharing loops. Built with Next.js 14, Supabase Realtime, and LiveKit WebRTC audio, the application introduces novel mechanics including real-time crowd heatmaps, direct ride-along wager mirroring ("Ride with Me"), and algorithmic social recap cards ("Close Out").

Developed as a product engineering initiative, the platform was demonstrated in a live technical walkthrough and resulted in a follow-up backend architecture meeting to explore production casino integration.

SECTION 02

Motivation & Background

Why Craps? Craps is fundamentally the most energetic, community-driven game on a casino floor. When a shooter goes on a hot streak, the entire rail celebrates together. However, traditional digital craps translates poorly to web apps: it becomes a dry sequence of random number generation calls without shared stakes.

Why Crapless Craps? Crapless craps eliminates the instant loss on 2, 3, and 12 during the come-out roll. Every roll except 7 sets a point. This increases shooter roll duration, driving higher average roll counts per session and maximizing opportunities for spectator participation.

The Drake / Stake Thesis: Modern gaming streamers draw tens of thousands of live viewers on platforms like Stake and Kick. Yet, 99.9% of viewers only watch passively because they lack high-tier bankrolls or jurisdictional access. Our thesis: We don't just monetize the active gambler, we monetize everyone who cares about the gambler.

Bets Placed on Craps Table
Figure 2.1: Active shooter table with Pass Line and Place bets active across numbers 5, 6, 8, and 9. PNG • 1280x800
SECTION 03

Technical Architecture

The application is architected around low-latency state synchronization across concurrent WebSocket connections and WebRTC mesh audio.

Tech Stack Overview

Layer Technology Technical Purpose
Frontend Framework Next.js 14 (App Router) Server Components, client-side state hydration, strict TypeScript typing
Styling & Design System TailwindCSS + Custom CSS Dark-mode casino layout, glassmorphic overlays, responsive canvas grid
Database & Realtime Supabase (PostgreSQL) Row-Level Security, real-time Postgres CDC broadcast channels
Voice & Audio Mesh LiveKit WebRTC SDK Sub-50ms proximity voice chat, spatial mute control, participant tile UI
Viral Card Rendering html2canvas DOM snapshot generation for camera roll export and social sharing
Hosting & Edge Deployment Vercel Edge Platform Global CDN routing, zero-cold-start API serverless functions

Database Schema (7 Core Tables)

Table Name Primary Key Core Responsibilities
craps_tables code (TEXT) Room code, host ID, current shooter, game phase (`come-out` / `point`), point value, last roll outcome
craps_players table_code, player_id User display name, avatar emoji, border color, assigned tier (1=CloseFriend, 2=Friend, 3=Public), balance
craps_bets id (UUID) Active bets on table, bet type (`pass-line`, `place-6`, `come`), stake amount, associated player
craps_heatmap id (UUID) Spectator suggestion signals (`bet` / `pull`), voting participant ID, target table zone
ride_links id (UUID) Active Ride with Me relationships, rider ID, target shooter ID, initial stake, current value, ride ratio
craps_messages id (UUID) Chat messages, system events, player speech bubble triggers, timestamp ordering
craps_session_stats id (UUID) Aggregated roll counts, peak riding volume, longest streaks, biggest wins for Close Out card calculation
SECTION 04

The Heatmap Mechanic

Crowd Wisdom Overlay: Rail players and spectators cannot place direct table wagers if they lack Tier 1 permissions, but they actively participate by voting on betting zones. When rail players suggest bets (or suggest pulling bets), real-time percentages dynamically compute across all active eligible spectators.

Green overlays represent positive bet consensus, while red animated pulsing overlays signal warning ("pull bet"). All heatmap overlays instantly reset when the shooter executes a dice roll, maintaining real-time game pacing.

Heatmap Overlay UI
Figure 4.1: Live Heatmap showing percentage overlay on shooter's screen. PNG
Heatmap Real-time Animation GIF
Figure 4.2: Real-time Heatmap updates as spectators cast suggestions. GIF
SECTION 05

Ride with Me Mechanic

Automated Wager Mirroring: "Ride with Me" allows rail spectators to attach their capital directly to a shooter's performance without managing individual table bets themselves.

When a rider initiates a ride with an initial stake (e.g., $10.00), the platform calculates a Ride Ratio relative to the shooter's active table wagers:

$$\text{Ride Ratio} = \frac{\text{Rider Stake}}{\text{Shooter Total Active Wager}}$$

When the shooter wins $50.00 on a 7-out or point hit, the rider's credit balance automatically increases proportionally by $(\text{Shooter Win} \times \text{Ride Ratio})$. If the shooter loses wagers, the rider's stake reduces accordingly. Riders can click "Pullback" at any moment to lock in their accrued gains.

Ride with Me Modal
Figure 5.1: Ride with Me configuration modal showing shooter wager & ratio. PNG
Active Ride Top Bar UI
Figure 5.2: Active ride indicator displayed in top bar (🎿 $10.00 riding). PNG
Ride with Me Real-time Progression
Figure 5.3: Real-time ride progression: Rider stake increases simultaneously as shooter hits winning numbers. GIF
SECTION 06

Voice, Chat & Tiered Access

To maintain table control while enabling viral sharing, Social Craps implements a 3-tier URL permission structure:

Tier Level Access Link Parameter Permissions Granted
Tier 1: Close Friend /table/[code]?access=closefriend Full table betting, voice chat publishing, text chat, heatmap suggestions
Tier 2: Friend /table/[code]?access=friend Ride with Me, text chat, voice audio listening, heatmap suggestions
Tier 3: Public / Rail /table/[code] Spectate live rolls, Ride with Me, heatmap suggestions, view text chat
Chat Sidebar & Speech Bubble UI
Figure 6.1: Chat sidebar open with live text feed and dynamic player speech bubble popup over avatar. PNG
SECTION 07

The Close Out Card

Viral Social Recap: When a shooter or rider leaves the table, the platform generates a custom, capture-ready session performance card. Built dynamically with html2canvas, the card highlights the single most impressive metric (such as "$4,250.00 RODE ON YOUR TABLE TONIGHT" for shooters or net win percentage for riders).

Players can click "📸 Save to Camera Roll" or instantly share to Twitter/X, Instagram, and WhatsApp, transforming session conclusions into organic player acquisition loops.

Close Out Card Modal
Figure 7.1: Algorithmic Close Out card featuring session stats, streak count, and high-contrast sharing UI. PNG
SECTION 08

In-App Documentation & Onboarding

The embedded "How to Play" modal ensures friction-free player onboarding, presenting game rules, social mechanics, and product roadmap features in a tabbed interface.

How to Play Rules
How to Play Social Features
How to Play Coming Soon Roadmap
SECTION 09

Real-Time Multiplayer Demo

Below is the side-by-side synchronized recording demonstrating dual-browser room synchronization. When the shooter rolls on screen 1, the dice 3D tumble animation and total state synchronize instantaneously across screen 2.

Dice Sync Dual Screen GIF
Figure 9.1: Simultaneous dual-client state synchronization during dice roll execution. GIF • 15 Seconds
SECTION 10

Results & Reception

Live Demo Showcase: The prototype was presented during an engineering product showcase with executive leadership. The live playthrough demonstrated sub-100ms state propagation across multiple connected clients.

Follow-up Outcome: Key stakeholders highlighted the "Ride with Me" mechanic as a major differentiator for streamer-led marketing campaigns, leading to an immediate follow-up technical architecture session focusing on backend server authoritative roll validation and casino wallet integrations.

SECTION 11

Future Roadmap

Upcoming enhancements planned for the Social Craps platform ecosystem:

SECTION 12

Conclusion

Social Craps demonstrates that in a commoditized online gambling industry where game math is standardized, the social layer is the ultimate competitive differentiator.

By lowering the barrier of entry for spectators through heatmaps and ride-along mechanics, platforms can unlock significant high-margin revenue from audiences who would otherwise remain passive observers.