CRISTIAN RENOSTO← All projects

Project

chess-server

A multiplayer chess server with a rules engine written from scratch — no chess library.

What it does

Run it locally

Build (JDK 11+, no dependencies to download)

./build.sh

Server (port 6700)

./start-server.sh

Swing GUI client

./start-gui.sh

Documentation

A multiplayer chess server and clients written in Java. The core is a rules engine written from scratch — no chess library — plus a terminal client and a Swing desktop client. Two players per game over a plain-text line protocol.

Requirements

Component Version
JDK 11 or newer (String.isBlank, List.of, String.repeat)
Build tool None — plain javac
Database Optional: PostgreSQL only for accounts, guest games need none

The jars in lib/ are vendored in the repository. There is no download step.

Build

./build.sh

The classpath is not optional: src/client/ClientGUI.java imports com.formdev.flatlaf.FlatDarkLaf, so compiling without lib/flatlaf.jar fails. lib/postgresql.jar is only needed at runtime by the server, but including it at compile time keeps the build one command. build.sh does not compile tests/ — that is run-tests.sh.

Run

./start-server.sh        # port 6700, from the repository root
./start-gui.sh           # Swing client, needs a display
./start-client.sh HOST PORT

The terminal client accepts --compact, --no-color, --no-unicode, --no-emoji, --no-animations and --timeout-ms=<1000..120000>.

What the engine covers

Move generation for every piece, castling on both sides, en passant, promotion, checkmate and stalemate detection, FEN parsing and serialization, and perft node counts — the standard way to verify that a rules engine agrees with everyone else's rules engine.

Accounts use PBKDF2 hashing on PostgreSQL. Guest games need no database at all.

Known limits

  • The terminal client cannot currently render the board: the server sends the compact single-line BOARD: frame, but ClientMain still routes it to the legacy multi-line parser, so every frame raises Invalid board payload. The Swing client is unaffected. See docs.md §11.
  • The Ratchet WebSocket server exists but cannot run; real-time is HTTP polling.
  • A browser cannot reach this server: it speaks plain TCP. There is no web client in the repository.

Full detail in docs.md.