Ludo
- Date
- Author
NINikki Sophie 🌸- Stack
- Next.js, TypeScript, Tailwind CSS, shadcn/ui, Bun, WebSockets
- Tags
- Front-EndBack-EndFull-StackWebsiteSelf-Hosted
Pictures
The classic board game in the browser: open a room, share the link, and play with friends or bots, with no account and nothing to install. Even before you click anything, a game is already running: the home page's demo board has four bots playing each other, by exactly the rules a real game uses. So let's play one ourselves.

Opening a room
You create a room and get a six-character code and a link to send your friends. Two to four people can play. If someone can't make it, the host fills the free seat with a bot, so even a game on your own works. Rooms can also be public, which lists them on the discovery page for anyone to join.
While people arrive, the host picks the rules:
- Move time: 15, 30, 45 or 60 seconds per move.
- House rules, each optional: must spawn on six, extra turn on capture, safe start squares, three tries and must capture.
- Fair dice, which makes every number turn up regularly, so nobody waits forever for a six.

Rolling
You press the dice and they roll on screen, but your browser didn't decide the number. Browsers only ever send actions like "join room" or "move this piece". The server rolls the dice, checks every move is legal, resolves captures and sends the new state to everyone in the room. Nothing a browser does can change how a game turns out.
Moving
If only one piece can move, it moves on its own. Otherwise you pick one before the timer runs out. The piece walks around the board square by square, and if it lands on an opponent, the captured piece waits until the attacker has arrived, then flies back to its yard. The server holds the next turn until a move has finished playing, so nobody rolls while a piece is still walking.
The sound effects for all of this are synthesized in the browser, so there isn't a single audio file.

Someone's Wi-Fi drops
It happens in every game. A player who reloads or loses their connection can take their seat back for up to five minutes. If the host is the one who's gone for 30 seconds, another player becomes host and the game carries on. And if someone has simply gone quiet, the host can remove them, even mid-game.
People watching
A public game that's full or already running can still be watched. Anyone can open it from the discovery page, and the players see how many people are watching.

The last piece home
Once someone has every piece in the home column, they've won and the game is over. Anyone can then vote for a rematch, and the first vote gives everyone else 30 seconds to join in. Bots don't vote; they go along with whoever wants to play again.
Small things that made the game
- One package for the rules. The server and the website share the typed event protocol, the game model and the bot strategy, so they can't drift apart, and the demo on the home page plays exactly like a real game.
- English and German, light, dark and system themes, and a layout that works on phones.
- No tracking. No accounts, ads or analytics, and games live only in the server's memory.





