A production-ready, responsive chess interface built with React, TypeScript, and modern web technologies. This is a UI-only implementation with clean integration points for connecting your AI backend.
- Modern Chess Interface: Smooth drag-and-drop gameplay with visual feedback
- AI-Ready Architecture: Clean adapter interfaces for engine integration
- Accessibility First: WCAG AA compliant with keyboard navigation
- Theme Support: Beautiful light/dark themes
- Sound System: Contextual audio feedback for moves
- Time Controls: Configurable time limits with increment support
- Move History: Full game notation with navigation
- Responsive Design: Works seamlessly on desktop and mobile
- React 18 + TypeScript - Type-safe UI components
- Vite - Lightning-fast development
- Tailwind CSS - Utility-first styling with custom design system
- shadcn/ui - Accessible component library
- Zustand - Lightweight state management
- chess.js - Move validation (client-side only)
- Framer Motion - Smooth animations
- Lucide React - Beautiful icons
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run buildThe UI provides clean integration points in src/lib/engineAdapters/:
Connect your chess engine to provide moves:
// src/lib/engineAdapters/types.ts
interface EngineAPI {
getBestMove(fen: string, moveHistory: string[], targetElo?: number): Promise<AIMoveResponse>;
newGame(opts: GameOptions): Promise<void>;
abort(): Promise<void>;
}Record games and positions for training:
interface LearningAPI {
recordGame(pgn: string, result: GameResult, meta?: Record<string, unknown>): Promise<void>;
recordPosition(fen: string, outcome?: GameResult): Promise<void>;
}- Replace
MockEngineAdapterinsrc/lib/engineAdapters/mockEngine.tswith your AI backend - Replace
MockLearningAdapterinsrc/lib/engineAdapters/mockLearning.tswith your telemetry system - Update the store at
src/store/gameStore.tsto use your adapters
Example:
// Replace mock with your implementation
import { myRealEngine } from './myEngineAdapter';
// Use in store instead of mockEngineThe project uses a semantic design system defined in:
src/index.css- CSS custom propertiestailwind.config.ts- Tailwind configuration
Key design tokens:
- Primary: Deep blue (#2563eb) - Chess sophistication
- Secondary: Purple (#7c3aed) - Premium feel
- Accent: Amber (#f59e0b) - Active elements
- Board colors, highlights, and semantic states
Sound files are located in public/sounds/. Replace placeholder comments with actual audio files:
move.mp3- Regular movecapture.mp3- Piece capturedcheck.mp3- King in checkcheckmate.mp3- Game-ending checkmateillegal.mp3- Invalid move attemptgame-start.mp3- New gamegame-end.mp3- Game conclusionnotify.mp3- General notification
- Tab/Shift+Tab: Navigate between squares
- Enter/Space: Select piece or make move
- Arrow Keys: Navigate squares
- Escape: Deselect piece
The UI includes a slider for "Target Elo" (1000-3000). This is currently UI-only and will be passed to your engine adapter when you connect your backend.
Game state is managed with Zustand in src/store/gameStore.ts:
const { chess, makeMove, newGame, resign } = useGameStore();Modify design tokens in src/index.css to match your brand
Extend PieceTheme type in src/store/gameStore.ts and implement rendering in ChessPiece.tsx
Add themes in store and apply via CSS custom properties
npm run build
# Deploy the 'dist' folder to your hosting serviceMIT License - See LICENSE file for details
Contributions welcome! This is a UI-only implementation, so focus on:
- Accessibility improvements
- Visual enhancements
- Animation refinements
- Additional themes
- Bug fixes
For issues or questions, please open a GitHub issue.
Note: This is a UI-only implementation. Connect your chess engine and learning backend to enable full functionality.