How One Dev Built a Cheat-Resistant Browser Game Leaderboard with Cloudflare D1
A developer built a browser game called 195-0 Game using Astro, Preact, and Cloudflare Workers, where players draft five people for cabinet roles and run a fictional campaign against 195 nations. A key engineering challenge was making the public leaderboard trustworthy without relying solely on client-reported scores. The solution uses signed draft tokens and server-side move replay: the server reconstructs the game from a seed and action log, then issues a signed result token before any leaderboard submission is accepted. Most content pages are prerendered, keeping the site fast, while the server handles draft issuance, score verification, and shareable PNG result card generation. The developer acknowledges the system validates legal move sequences but cannot confirm human participation, meaning a bot could still submit high scores through valid gameplay paths.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in