feat: ShellMate - SSH Chess TUI

Play chess in your terminal over SSH. No installs, no accounts.

Features:
- Beautiful terminal-filling chess board with ANSI colors
- Play against Stockfish AI (multiple difficulty levels)
- Two-step move interaction with visual feedback
- Leaderboard with PostgreSQL persistence
- SSH key persistence across restarts

Infrastructure:
- Docker containerized deployment
- CI/CD pipeline for dev/staging/production
- Health checks with auto-rollback
- Landing page at shellmate.sh

Tech: Python 3.12+, asyncssh, python-chess, Stockfish
This commit is contained in:
2026-02-01 20:05:58 +00:00
commit 590fbe045c
33 changed files with 3925 additions and 0 deletions

52
docker-compose.yml Normal file
View File

@@ -0,0 +1,52 @@
services:
shellmate:
build: .
ports:
- "22:22"
environment:
- SHELLMATE_SSH_PORT=22
- SHELLMATE_REDIS_URL=redis://redis:6379
- SHELLMATE_DATABASE_URL=postgresql://shellmate:shellmate@postgres:5432/shellmate
- STOCKFISH_PATH=/usr/games/stockfish
volumes:
- ssh_keys:/etc/shellmate
depends_on:
- redis
- postgres
restart: unless-stopped
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "22"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:16-alpine
environment:
- POSTGRES_USER=shellmate
- POSTGRES_PASSWORD=shellmate
- POSTGRES_DB=shellmate
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U shellmate"]
interval: 10s
timeout: 5s
retries: 5
volumes:
redis_data:
postgres_data:
ssh_keys: