Overview
MiniWorld is a Web3 game where players claim tiles on a 10x10 grid and place items on them. The game rules and state live in a Solidity contract running on a local Hardhat chain, and a Node.js backend indexes the contract's events into PostgreSQL.
What it does
- On-chain game state: tiles and items are stored in the smart contract.
- TypeScript SDK: wraps the contract calls and bundles the contract ABI, so the frontends never talk to the chain directly.
- Two frontends: a Canvas game client for players and a creator dashboard with analytics. Both use the same SDK.
- Socket.IO sync between clients: when a tile changes, the backend pushes the update to every connected client.
- Docker: one script brings up the database, chain, contract, backend and both frontends.
Technical notes
The SDK was the part that paid off. Both frontends call plain async functions, and the ABI is copied into the SDK at build time, so there is no runtime fetch for it. The harder problem was reconciling chain finality with a UI that should respond right away, since the contract is the source of truth and the clients learn about changes through the indexer.