CASE STUDY · WEB PRODUCT

Chuhe Xiangqi
Online Chinese Chess

A browser game that grew into a cross-device product with room state, APIs, database persistence and multiple play modes.

Live Demo ↗GitHub ↗

01 / Verified metrics

6digit room codes
2main rule modes: standard / Jieqi
2main APIs: rooms / change-side
2DB backends: Neon Postgres / Cloudflare D1

The repository also documents AI play, undo confirmation, replay, sandbox mode, heartbeat throttling and cleanup for rooms inactive over seven days.

02 / Architecture

Browser UIboard, rules, replay and variants
HTTP APIrooms and change-side
Revision Syncpolling, player token, heartbeat
PersistenceNeon Postgres or Cloudflare D1

03 / Engineering

ConcurrencyRevision checks prevent stale clients from overwriting newer game state.
ReconnectA player token in LocalStorage lets a browser reclaim its seat.
VariantsThe same UI supports standard Xiangqi, Jieqi, sandbox and custom positions.
PersistenceRoom state includes game JSON, revision, heartbeat, undo request and timestamps.

04 / Product

Chuhe Xiangqi product interface