AcmeToCasino Dev Platform
A production-grade modular monolith for iGambling, built with FastAPI and domain-driven design. Server-side RNG, event-sourced wallet, KYC/AML compliance, and responsible gaming controls.
System Architecture
Domain Modules
Registration, JWT authentication (access + refresh tokens), player profiles with KYC status and VIP tier tracking.
Append-only event log: BET, WIN, DEPOSIT, WITHDRAWAL, BONUS_CREDIT, BONUS_DEBIT. Balance computed from events, never updated directly.
Game sessions, server-side CSPRNG bet resolution, RNG seed hash audit trail. Integrates with wallet for atomic bet/win.
KYC document submission and operator verification, AML velocity-based alerts with risk scoring (low/medium/high/critical).
Player deposit limits (daily/weekly/monthly), self-exclusion with enforced cooling-off, reality checks with net position tracking.
Server-side RTP configuration (80-99%) per game, aggregate statistics, actual vs target RTP deviation tracking.
How This Platform Works
A modular monolith architecture with six bounded contexts, each responsible for a distinct domain of iGambling operations. Every module communicates through well-defined internal APIs.
Request Flow: Player to Database
Every request passes through the API gateway, gets routed to the correct domain module, and interacts with shared data stores.
Module Deep Dives
Click any module to expand its details, see available endpoints, and find the corresponding book chapters.
Handles player registration, JWT-based authentication (access + refresh tokens), KYC document verification, player profile management, and VIP tier tracking. Every player interaction starts here.
Manages deposits, withdrawals, bet/win transactions, and real-time balance computation. Uses an append-only event log -- balances are derived from the event stream, never updated directly. Supports BET, WIN, DEPOSIT, WITHDRAWAL, BONUS_CREDIT, and BONUS_DEBIT event types.
Provides a unified game API that abstracts multiple providers behind a single interface. Manages game sessions, server-side CSPRNG-based bet resolution, RNG seed hash audit trails, and atomic bet/win transactions with the wallet module.
Manages KYC document submission and operator-side verification, AML velocity-based alerts with risk scoring (low/medium/high/critical), regulatory reporting pipelines, and jurisdiction-specific compliance rules. Integrates with national exclusion databases.
Enforces deposit limits (daily/weekly/monthly), session time limits, self-exclusion with mandatory cooldown periods, and behavioral alerts. Monitors real-time player activity to detect harmful patterns and trigger graduated interventions.
Server-side RTP management (configurable 80-99% per game), aggregate game statistics, actual vs target RTP deviation tracking, and operator-level controls for game performance tuning. The operator's lever for managing the house edge.
Built from The Backend of Luck
This platform is a working demonstration of the architecture described in the book "The Backend of Luck: Inside the Systems That Power Real Money Gaming". Every module, endpoint, and data flow you see here maps directly to a book chapter.
Live Data Right Now
Real-time statistics fetched directly from the platform API.
Frequently Asked Questions
Python 3.12 and FastAPI for the backend, PostgreSQL for persistent storage, Redis for caching and pub/sub, and Docker Compose for orchestration. The frontend uses vanilla HTML/CSS/JavaScript with no framework dependencies. API documentation is auto-generated via Swagger/OpenAPI.