Skip to content
Case studies

Chess went live 46 hours after its first commit on Clubedge Starter, and grew from 161 tests to 1,517 in a week

How a real-time chess app with a bot, game review, puzzles and lessons started from Clubedge Starter on React + Vite and Hono, reached production in two days, and kept the Starter's structure as it grew.

Chess on a Mac and an iPhone: one live blitz game, with White in Safari on the Mac and Black on the iPhone. The Mac shows the board, both clocks, the moves under the Italian Game's name and the chat; the iPhone shows the board from Black's side, with White's message over it.
One live game on two devices: White in Safari on a Mac, Black on an iPhone, where White's message has just arrived over the board.
Chess logo
About

Chess is online chess as an installable web app, with rated live games, a bot with eight levels, Stockfish game review, puzzles, lessons and an openings explorer.

https://chess.clubedge.live
Started with create-clubedge-app 0.46.1, Starter v0.30.1
Stack React + Vite, Hono API, Supabase Auth, Redis
Hosting Cloudflare Workers, Render and Supabase
Tests 1,517 in each run, from the Starter's 161
In production 46 hours after the first commit

Ready to get started?

Chess is online chess as an installable web app. Players are rated with Glicko-2 and matched in real time, invite a friend with a link, or play a bot with eight levels. After a game, Stockfish 19 reviews it in the browser. Around the games are 40,778 puzzles, lessons and drills, arenas, clubs, an openings explorer with 3,865 named openings, and fifty classic games to replay.

See Chess in action #

The challenge#

Online chess needs much more than a board. Players expect accounts and ratings, live games with fair clocks, a bot, game review and puzzles, on their phones as much as on their computers. The time had to go into the chess: the rules and the bot, the live games, and the content. Sign-in, the database, the API, the tests and the deployment had to be there from the first day.

Chess on three iPhones: the Play tab with a six-day streak, a 1662 blitz rating up 162 in a week and the Play button; the puzzle path in its eleventh world, Royal Garden; and the bot's eight levels, each with its own face
Installed from the browser on an iPhone: the day streak and the week's rating on the Play tab, the path through the puzzles, and the bot's eight levels.

Starting from Clubedge Starter#

The project began with one command:

pnpm dlx @clubedge/create-clubedge-app chess \  --framework vite --api hono --auth supabase \  --storage none --cache redis --email none \  --payments none --jobs none --observability none \  --infra supabase --deploy docker

create-clubedge-app 0.46.1 wrote Starter v0.30.1 with a React + Vite website, a Hono API with its typed OpenAPI contract, Supabase Auth, a Redis cache, Supabase’s local services, and a Docker image for the API. Before any chess code, the project could sign users up and in, migrate its database and serve a signed-in dashboard, with the Starter’s 151 unit tests and 10 browser tests.

Building on the Starter#

The chess lives where the Starter puts a project’s own code, in packages next to the Starter’s:

  • Rules, ratings and the bot: a package on chess.js, with a search engine for the bot’s eight levels and Glicko-2 for the ratings.
  • Live games and clocks: a WebSocket service on the Starter’s Hono API, which keeps the clocks, with Redis behind it.
  • Game review: Stockfish 19 in the player’s browser.
  • Puzzles, lessons and openings: lichess’s open puzzle and opening data, served through the API’s contract.
  • Clubs and team battles: clubs with members and invitations, on the accounts and the database the Starter set up.
A game review in Safari on a Mac: Stockfish 19 lite has marked each move as best, mistake or blunder, the coach explains the best move on the board, and the evaluation graph shows where the game turned
After the game, Stockfish 19 reviews every move in the player's browser: it finds the turning point and the best move, and the coach explains it.

In the first week, 13 packages joined the Starter’s 8, and the database went from the Starter’s 2 migrations to 41. The website’s routes, the API’s contract and the tests kept the Starter’s layout throughout.

Clubs and lessons on three iPhones: the club list, the Sunday Blitz Club's page with its ten members, their average blitz rating and a pinned note about Friday's team battle, and the Learn tab with the lessons in progress
Clubs with members, invitations and team battles, and the lessons, on the accounts and the database the Starter set up.

On the fourth day the app needed email. pnpm clubedge add email smtp added the Starter’s SMTP module to the running project, with its settings, code and tests, in place of a hand-written integration.

Going to production#

The website runs on Cloudflare Workers, and the API in the Starter’s Docker image on Render, with Supabase for auth and Postgres and a managed Redis. The first production build came 46 hours after the first commit.

Free hosting plans shaped the last mile more than the code did:

  • Render puts a free service to sleep after 15 minutes without requests, so a Cloudflare cron job keeps the API awake.
  • Render blocks the usual SMTP ports, so email goes out on port 2525, with 10-second timeouts.

A few of the Starter’s defaults changed on the way. The API’s CORS rules allowed fewer request methods than the app used, which the local development proxy had hidden, and a single website origin, where the move to a new domain needed more than one. The API also checks sessions itself now, rather than asking Supabase on every request.

Results#

  • 46 hours from the first commit to production, and 173 commits in the first week.
  • 21 packages and 41 migrations, on the Starter’s structure.
  • 1,517 tests in each run: 1,235 unit tests, and 94 browser tests that run in Chromium, Firefox and WebKit (an iPhone 13). The Starter came with 161: 151 unit tests and 10 browser tests in Chromium.

What goes back into the Starter#

The changes Chess made to the Starter’s own code are the next candidates for the Starter, so new projects start with them: CORS rules with every request method and more than one origin, session checks on the API, timeouts for email, a Cloudflare target for the website, and browser tests in three browsers.

Start where they started, with Clubedge Starter