Skip to content

ovitrac/chessy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Olivier Vitrac, PhD, HDR - olivier.vitrac@gmail.com MIT License (see LICENSE)

AIchessy — Chess Openings & Endgames Trainer

A fully static web application for learning, replaying, and studying chess openings, endgame techniques, and famous games. No server required, no build step, no external dependencies — works offline on any device.

Live demo: aichessy.pages.dev

Highlights

  • Standalone — opens directly from index.html, works offline, no installation
  • Responsive — adapts to desktop, tablet, and smartphone screens
  • Educational — historical context, per-move comments, and teaching points for every entry
  • Interactive — drag-and-drop pieces, legal move validation, smooth animations
  • Auto-play — animate through any game at configurable speed (0.5s–3s), Space key shortcut
  • Record — record your own games move-by-move, then save, share, or annotate them
  • Save & Import — download games as .chessy.json files, import them back anytime
  • Shareable URLs — one-click copy of a playable link encoding the full game and your notes
  • Personal notes — annotate any move with your own comments, persisted across sessions
  • Dark mode — toggle between light and dark themes (persists across sessions)
  • 3D perspective — optional CSS 3D board tilt with piece drop-shadows
  • Curated library — 23 entries covering openings, endgames, and famous masterpieces

Included Library

Openings (12)

ECO Opening Moves
C78 Ruy Lopez — Morphy Defense 16
C54 Italian Game — Giuoco Piano 12
B90 Sicilian Defense — Najdorf Variation 10
B80 Sicilian Defense — Scheveningen Variation 10
C15 French Defense — Winawer Variation 6
B18 Caro-Kann Defense — Classical Variation 8
D37 Queen's Gambit Declined — Orthodox Defense 12
D11 Slav Defense 8
E62 King's Indian Defense 12
E20 Nimzo-Indian Defense 6
A20 English Opening — Reversed Sicilian 10
A09 Reti Opening 9

Endgames (8)

Study Goal
King & Pawn — Opposition Win
Lucena Position — Building the Bridge Win
Philidor Position — Defensive Rook Endgame Draw
Rook Activity — Cutting Off the King Win
King + Rook vs King — Basic Checkmate Checkmate
Drawn Fortress — Rook Pawn + Wrong Bishop Draw
Key Squares — Pawn Promotion Win
Rook vs Passed Pawn — King Support Win

Famous Games (3)

Game Year Moves
The Immortal Game — Anderssen vs Kieseritzky 1851 45
The Opera Game — Morphy vs Duke of Brunswick & Count Isouard 1858 33
Kasparov's Immortal — Kasparov vs Topalov 1999 87

Every entry includes historical context (origin, era, significance), per-move comments, teaching points at key positions, and quiz questions.

Quick Start

Open index.html in any modern browser. No build step, no server needed.

  1. Browse the Library tab — click any opening, endgame, or game to load it
  2. Step through moves using the controls or click individual plies in the move list
  3. Press ▶ Play (or Space) to auto-play the game at your chosen speed
  4. Read the Notes tab for history, per-move commentary, and teaching points
  5. Add your own annotations in the Your Notes textarea (saved automatically)
  6. Click ⏺ Record to play a new game from scratch (both sides)
  7. Save your game to a .chessy.json file, or Share it as a playable URL
  8. Import a previously saved .chessy.json file to reload it
  9. Paste your own PGN, SAN, or FEN in the Paste tab

Keyboard shortcuts: Arrow Left/Right (prev/next move), Home/End (first/last move), Space (play/pause).

Responsive Design

The app adapts to any screen size:

  • Desktop (> 900px): two-column layout — board left, sidebar right
  • Tablet (600–900px): single-column, board scales to viewport width
  • Phone (< 600px): compact layout, full-width board, stacked controls
  • Small phone (< 380px): ultra-compact, byline hidden, minimal padding

No pinch-to-zoom needed — the board and all UI elements scale automatically.

Stack

Component Version Role License
chess.js 0.10.3 Rules engine, PGN/FEN parsing, move validation BSD-2-Clause
chessground 9.1.1 Interactive board UI (lichess) GPL-3.0
cburnett SVGs Piece set from lichess GPL-3.0

Both libraries are vendored under vendor/ for full offline use.

Repository Structure

/
├── index.html              Main application page
├── css/style.css           Themed styles (light + dark, responsive)
├── js/app.js               Application logic (single IIFE, ~977 lines)
├── data/
│   ├── library.openings.json   12 openings with history & comments
│   └── library.endgames.json   8 endgames + 3 famous games
├── assets/
│   ├── favicon.svg         App icon (chess knight)
│   └── pieces/             12 cburnett SVG pieces
├── vendor/
│   ├── chess.js/            Chess rules engine (UMD)
│   └── chessground/         Board UI + CSS themes
├── CHANGELOG.md            Version history
├── LICENSE                 MIT License
└── README.md               This file

Data Format

Games are stored as JSON arrays. Each entry has:

  • type: "opening", "endgame", or "game"
  • id, name, tags: identification and search
  • moves_san or solution_san: move sequence in Standard Algebraic Notation
  • start_fen: starting position (default: "startpos")
  • history: { origin, era, significance, famous_games }
  • comments: per-move commentary keyed by ply number
  • teaching_points: [{ ply, text }] for instructional highlights
  • quiz: [{ ply, prompt, answers, explain }] for self-testing

Saved games (.chessy.json)

The Save button exports a JSON file compatible with the library format:

  • format: "chessy", version: 1
  • moves_san: array of SAN moves
  • start_fen: starting position
  • comments: personal notes keyed by ply number
  • teaching_points, history: preserved from source if loaded from library

Shareable URLs

The Share button encodes the game in the URL hash as #g=<base64url>. The payload uses compact keys: n (name), m (moves), f (FEN, omitted if standard start), c (comments). Opening such a URL loads the game automatically.

License

MIT License — Copyright (c) 2025 Olivier Vitrac

About

AIchessy — Static chess openings & endgames trainer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors