Boardgame.io is a framework for developing turn-based, multiplayer games for the web. It functions as a game engine and orchestrator that manages the complexities of state synchronization, player turn order, and rule enforcement across a distributed network of clients.
The framework utilizes pure functions to handle state transitions, ensuring that game logic remains predictable and consistent for all participants. By structuring game flow into hierarchical phases and turn-based segments, it automates transitions and enforces rules, preventing illegal moves while maintaining a synchronized view of the game state across all connected clients.
The system supports responsive user interfaces through optimistic updates, allowing clients to predict and display move outcomes locally before receiving server confirmation. It provides a comprehensive set of tools for managing game flow, including the ability to subdivide turns into stages and trigger automated events to advance gameplay.