code.pablomurad.com

emchess

Browser chess with emoji pieces against Stockfish, no server needed

README.md raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
EMCHESS
=======

A small chess game that runs in the browser. The pieces are emoji.
No accounts, no ads, no tracking, no server required. Open it and play.


DESCRIPTION
-----------

Emchess is a static web app. All the chess rules run locally with
chess.js. The opponent is Stockfish, compiled to WebAssembly and run in
a Web Worker so the board never freezes. The engine is made to pause
before it moves, so it looks like it is thinking.

Six opponents, from a careless beginner to a strong master. Four piece
sets, including a plain Unicode set for maximum clarity. Two themes:
plain paper, or phosphor-green CRT with scanlines. An evaluation bar
and a captured-pieces row track the battle. Positions load from the
URL (?fen=...). Games export to PGN. Everything is stored in the
browser, and it works offline after the first load.


REQUIREMENTS
------------

  Node 18 or newer, and npm.


BUILD
-----

  npm install
  npm run build

The result is written to ./dist as plain static files. Copy it to any
web server; there is nothing else to configure.


DEVELOP
-------

  npm run dev

Starts Vite on http://localhost:5173 with hot reload.


DEPLOY
------

With PM2 and the included ecosystem file:

  npm run build
  pm2 start ecosystem.config.cjs

This serves ./dist on port 17393. Or serve ./dist with anything else you
already have (nginx, Apache, a static host). No special headers needed.


USAGE
-----

  - Click or drag a piece to move it.
  - Pick your side and opponent on the New Game screen.
  - Change the piece set in Settings.
  - Copy PGN from the panel to save or share a game.
  - Share a position by putting a FEN in the URL: /?fen=<fen>


ENGINE
------

The computer opponent is Stockfish (https://stockfishchess.org),
licensed under the GNU GPL v3. Its files live in public/stockfish.


LICENSE
-------

GPL-3.0-or-later. See LICENSE.

Copyright (c) 2026 Pablo Murad <pablomurad@pm.me>