explaingit

hurapanda/chees

21HTMLAudience · generalComplexity · 2/5Setup · easy

TLDR

A two-player chess game that runs in a browser on a shared laptop, with animated piece movement, board auto-flip after each move, and full check and checkmate detection.

Mindmap

mindmap
  root((chees))
    What it does
      Two-player chess
      Board auto-flips
      Animated moves
    Tech Stack
      TypeScript
      Express server
      HTML frontend
      pnpm
    Features
      Legal move hints
      Check detection
      Checkmate overlay
      Swagger API docs
    Not yet done
      Castling
      En passant
      Promotion choice
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Play chess against a friend on a shared laptop without any account or internet connection.

USE CASE 2

Learn how to build a browser-based board game with a TypeScript backend and a REST API.

USE CASE 3

Use the built-in Swagger docs page to explore and test the chess game API endpoints interactively.

Tech stack

TypeScriptExpressHTMLpnpmOpenAPI 3.0

Getting it running

Difficulty · easy Time to first run · 5min

Requires pnpm, one install and one start command to run locally in the browser.

In plain English

Local Chess is a two-player chess game for two people sharing one laptop. You open it in a browser, play a game, and the board flips automatically after each move so each player sees their own side facing them. All the standard chess rules are covered: legal move highlighting, check detection, checkmate, stalemate, and automatic pawn promotion to queen. Three rules from the official rulebook are not yet implemented: castling, en passant, and choosing a promotion piece other than queen. The project is built with TypeScript and runs a small local web server using the Express framework. The browser communicates with the server through three API endpoints: one to read the current game state, one to handle a board click, and one to reset the board. Game state lives in memory on the server, so restarting the server clears the current match. The visual side is more elaborate than a basic board. Piece movement is animated with smooth travel between squares, captures play a collapse animation, and a victory overlay appears at checkmate with a restart button. The pieces are styled to look three-dimensional rather than flat symbols, and the board sits against a moving background in a red, black, and orange color scheme. Because the API follows the OpenAPI 3.0 standard, the project includes a Swagger documentation page available at a local URL. You can read endpoint descriptions and try out API calls directly from the docs page without writing any extra code. The source is organized into four TypeScript files covering game rules, the server, the API specification, and piece movement logic, plus a single HTML file for the entire frontend. Starting the project requires one install command and one start command using the pnpm package manager.

Copy-paste prompts

Prompt 1
I cloned hurapanda/chees. How do I install dependencies with pnpm and start the local server so I can open the game in my browser?
Prompt 2
The chees repo does not support castling yet. Show me where in the TypeScript source to add castling logic and how to expose it through the existing API endpoint.
Prompt 3
I want to add a move history panel to the chees frontend so both players can see every move made so far. Which HTML file and which API endpoint should I modify?
Prompt 4
How does the chees server keep game state in memory, and what would I need to change to persist the game to a file so it survives a server restart?
Open on GitHub → Explain another repo

← hurapanda on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.