Online Chinese chess · play with friends

Chuhe Xiangqi
Online Chinese Chess

I built a Chinese chess website where friends can play together from different devices. There's standard Xiangqi, Jieqi, undo requests, replay and custom board positions. Players can join a game by sharing a room code.

Try It Now ↗GitHub ↗
Role
Full-stack web product development
Scope
Server rules · multiplayer rooms · WebSocket · D1
Status
Live
Stack
JavaScript · Cloudflare Workers · Durable Objects · D1
Year
2026

What works and how it's tested

This is a live multiplayer chess site, not just a board UI.

Playable onlineSupports standard Xiangqi and Jieqi, room joining, reconnects and game replay.
Server-authoritative stateA Worker validates moves, D1 persists state, and Durable Objects/WebSocket notify connected players.
Public test evidenceThe CI runs unit tests, multiplayer E2E and browser smoke tests; code and workflows are available.
No verified load metricsConcurrent player capacity, sync latency distribution and production load-test results have not been published.

Keeping the board in sync

Browser UIboard, rules, replay and variants
Worker rulesvalidates moves and game state
Durable Object + WebSocketlive updates, polling fallback
Cloudflare D1authoritative rooms, history, revisions

Problems I had to handle

Keeping moves in orderWebSocket announces updates while polling remains a fallback. Revision checks stop older state from overwriting newer moves.
Coming back after a disconnectThe browser saves a player token so someone can rejoin their original seat.
Different game modesThe same board supports regular Xiangqi, Jieqi, sandbox mode and custom setups.
Saving a gameRoom data includes the board state, version, connection status and undo requests.

The game itself

Chuhe Xiangqi · current version

Here's the current game screen.

The board, rooms and controls live in the same website. I spent time on the behind-the-scenes work of keeping two players' views in sync, too.

chuhe xiangqi · web product
Chuhe Xiangqi product interface
This is the current Chuhe Xiangqi interface. The details above cover syncing moves, reconnecting and saving games.

The server now checks move legality, backed by unit and end-to-end tests. I don't have published measurements for production latency or peak concurrent player capacity yet.

How I verify it

Rules, multiplayer state and reconnection are tested.

The CI runs npm test, multiplayer E2E tests and browser smoke tests. Coverage includes server-side rules, authorization, WebSocket behavior, clocks and reconnection. These are functional and regression checks, not measurements of live traffic or network latency.

View the CI workflow ↗ · View test files ↗