--- title: "Checkmoss: an online chess site with live, rated games" author: "@chris" author_url: https://elements.dev/users/chris published: 2026-09-30T19:41:28.490Z url: https://elements.dev/demos/s4b86atk/checkmoss-an-online-chess-site-with-live-rated-games kind: post format: article --- # Checkmoss: an online chess site with live, rated games by [@chris](https://elements.dev/users/chris) ยท 2026-09-30 ## Description Open challenges at 3+2, 5+0 and 10+0, live games with clocks and legal moves, spectators, ratings and replays. Checkmoss needed accounts, a lobby that shows who is online, moves and clocks pushed to players and spectators, and scheduled flag checks. Each of those is a part of Elements, so the agent spent its 17 minutes on chess itself. **What Elements gave the app** - **Live games.** Every move, draw offer and resignation publishes the game's full state on a channel. Both players and every spectator listen for that game, so the board, clocks and move list stay in step on every screen. - **Who is online.** A page's live connection marks its player online and offline, and the lobby's channel pushes that list along with open challenges and games in progress. - **Moves as function calls.** The board calls `@rpc` functions to move, offer a draw or resign. The server checks the move is legal, runs the clock and records it in one locked transaction, and a checkmate moves both players' ratings in that same transaction. - **Flag falls on a schedule.** A one-line cron schedule runs a job every minute that ends games whose clock ran out with nobody watching. Open pages report a flag fall themselves, and the server decides. - **Sessions.** Players sign up with a username and sign in with either the username or the email. - **Data from SQL files.** Migrations define the schema and seed four rated players, twelve finished games, one game in progress and an open challenge. The project server applied each one as soon as it was saved. **What the project server gave the agent** The project server runs alongside the agent and answers as soon as a file is saved: it type-checks the templates, TypeScript and SQL, applies migrations and reruns the tests, so every question came back right away and the agent kept building. **What shipped** The app type-checks with zero errors and all 29 tests pass. Every page works on desktop and phone, and live updates arrive across sessions, such as moves and clocks reaching both players and a spectator as a game plays to checkmate.