36c9f709930224435028e6788c2480e539b8c2f690780cffeacfaad07f31fe25
Go Chess API |
Chess
Go backend server providing a RESTful API for chess gameplay. Integrates Stockfish engine for move validation and computer opponents.
Features
- RESTful API for chess operations
- Stockfish engine integration for validation
- Human vs human, human vs computer, computer vs computer modes
- Custom FEN position support
- Asynchronous engine move calculation
- Configurable engine strength and thinking time
- Optional SQLite persistence with async writes
- PID file management for singleton enforcement
- Database CLI for storage administration
Requirements
- Go 1.24+
- Stockfish chess engine (
stockfishin PATH) - SQLite3 (for persistence features)
Installation
# Arch Linux
yay -S stockfish
# FreeBSD
pkg install stockfish
Quick Start
git clone https://git.lixen.com/lixen/chess
cd chess
go build ./cmd/chessd
# Standard mode with persistence
./chessd -storage-path chess.db
# Development mode with PID lock on localhost custom port
./chessd -dev -pid /tmp/chessd.pid -pid-lock -port 9090
# Database initialization (doesn't run server)
./chessd db init -path chess.db
# Query stored games (doesn't run server)
./chessd db query -path chess.db -gameId "*"
Server listens on http://localhost:8080. See API Reference for endpoints.
Documentation
- API Reference - Endpoint specifications
- Architecture - System design
- Development - Build and test instructions
- Stockfish Integration - Engine communication
License
BSD 3-Clause
Description
Languages
Go
56.3%
Shell
19.4%
JavaScript
15.1%
CSS
5.6%
Makefile
2%
Other
1.6%