Back

ToxBets

Casino Platform

$

The Problem

Wanted to build a technically challenging real-time multiplayer system as a learning project. Casino games require complex state machines, real-time sync, and AI opponents — a perfect stress test for full-stack skills.

$

The Solution

Built a complete casino with 10 games, each with its own state machine. Poker has full Texas Hold'em rules, AI bots with different play styles, tournaments, and an Elo-based ranking system. All real-time sync uses SSE instead of WebSockets for simpler server architecture.

$

Technical Decisions

> SSE over WebSockets — server-to-client streaming is sufficient for game state updates, avoids bidirectional connection complexity

> Redis for game state — in-memory state machine with pub/sub for multi-player sync, no database writes during gameplay

> Elo rating system — well-understood algorithm that naturally creates skill-based matchmaking

$

Stack Breakdown

Frontend

Next.jsTailwind CSS

Game UIs with canvas animations

Backend

Next.js API RoutesSSE

60+ routes, real-time game state streaming

Database

PostgreSQLRedis

Redis for live state, Postgres for persistence

$

Numbers

60+

routes

30+

migrations

Visual coming soon