Wizard Card Game

Alex Mazzoni  •  Nicola Graziotin  •  Francesco Marcatelli
abstract

This project details the evolution of a local, single-player "Wizard" card game into a distributed, real-time multiplayer web application designed for 3 to 6 players. The system transitions the game into a modern distributed application utilizing a Next.js web frontend and a reactive, event-driven Scala 3 backend built on Eclipse Vert.x. Built around Hexagonal Architecture and CQRS principles, the backend completely isolates core game rules from external transport mechanisms and infrastructural concerns. To support distributed gameplay across geographically dispersed users, Redis serves as the Single Source of Truth. It provides fast key-value state persistence, Pub/Sub channels for real-time event broadcasting, and Redis Streams with Consumer Groups to distribute AI bot tasks across dedicated worker instances. Real-time client interactions combine HTTP REST APIs for upstream commands with WebSockets for bidirectional event streaming and in-game chat.