Online multiplayer with no game server: WebRTC invite links and a browser as referee
PlayTrova is a free games site I run as a fully static Next.js site, with no backend at all. I still wanted the board games to have the one feature families actually ask for: send a link, play together . No accounts, no lobby, and no server to pay for or keep alive. Today 12 of the turn-based games, including Checkers , Four in a Row, Reversi and Sea Battle , can be played online that way. Here's…
PlayTrova is a free, static Next.js website that offers turn-based board games without any backend, servers, or accounts. The site enables online multiplayer gaming via WebRTC invite links, eliminating the need for a game server or hosting. Twelve turn-based games, such as Checkers, Four in a Row, Reversi, and Sea Battle, can be played this way.
The core functionality involves two browsers communicating over a WebRTC data channel, with PeerJS providing the necessary signalling through a free hosted server. The host's peer ID, in the form of a room code, serves as the identifier for the game. The invite link, such as /games/checkers/?join=K7QX2M, is created using this code and can be shared with friends.
The games are deterministic, relying on pure logic and a seed stored in the game state for any randomness. This makes the networking process straightforward, as the host sends the seed and who moves first once, after which each side only sends its own moves as short strings. For instance, in Four in a Row, a move might be represented as "3".
The data channel's messages are parsed strictly to prevent malicious input. Each move is validated against the game's rules, ensuring both players receive and validate each other's moves. Additionally, a six-emoji reaction system serves as the chat function, with no support for arbitrary text input to maintain a family-friendly environment.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.