A fully functional chess game built with React Native that works on both Android and iOS platforms.
- Complete Chess Gameplay: All standard chess rules implemented
- Interactive Board: Touch-based piece selection and movement
- Move Validation: Powered by chess.js library for accurate game logic
- Visual Feedback: Highlights selected pieces and valid moves
- Game States: Detects check, checkmate, and draw conditions
- Cross-Platform: Works seamlessly on Android and iOS
- TypeScript: Full TypeScript support for better development experience
- React Native - Cross-platform mobile development
- TypeScript - Type-safe JavaScript
- chess.js - Chess game logic and move validation
- React Native Vector Icons - Icon library
- React Native SVG - SVG graphics support
The app features a beautiful, responsive chess board with Unicode chess pieces that automatically adjusts to different screen sizes.
Note: Make sure you have completed the Set Up Your Environment guide before proceeding.
From the root of your React Native project, install the dependencies:
npm installFirst, you will need to run Metro, the JavaScript build tool for React Native.
To start the Metro dev server, run the following command from the root of your React Native project:
# Using npm
npm start
# OR using Yarn
yarn startWith Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
# Using npm
npm run android
# OR using Yarn
yarn androidFor iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
bundle installThen, and every time you update your native dependencies, run:
bundle exec pod installFor more information, please visit CocoaPods Getting Started guide.
# Using npm
npm run ios
# OR using Yarn
yarn iosIf everything is set up correctly, you should see your chess app running in the Android Emulator, iOS Simulator, or your connected device.
- Select a Piece: Tap on any chess piece to select it (only pieces of the current player's turn can be selected)
- View Valid Moves: Valid destination squares will be highlighted in gold
- Make a Move: Tap on a highlighted square to move the selected piece
- Game States: The app will automatically detect and announce check, checkmate, or draw conditions
- New Game: Tap the "New Game" button to start over
src/
components/
ChessBoard.tsx # Main chess board component with game logic
App.tsx # Main app entry point
.github/
copilot-instructions.md # GitHub Copilot custom instructions
The app supports Fast Refresh. When you save changes to your code, the app will automatically update:
- Android: Press the R key twice or select "Reload" from the Dev Menu, accessed via Ctrl + M (Windows/Linux) or Cmd ⌘ + M (macOS).
- iOS: Press R in iOS Simulator.
Use React Native Debugger or Chrome DevTools for debugging. Enable debug mode through the dev menu on your device/simulator.
chess.js: Chess game logic and move validationreact-native-svg: SVG graphics supportreact-native-vector-icons: Icon library@types/chess.js: TypeScript definitions for chess.js
- ✅ Complete chess board (8x8 grid)
- ✅ All chess pieces with proper Unicode symbols
- ✅ Legal move validation
- ✅ Turn-based gameplay (White starts first)
- ✅ Check detection and notification
- ✅ Checkmate detection
- ✅ Draw/stalemate detection
- ✅ Piece selection and move highlighting
- ✅ Game reset functionality
- ✅ Responsive design for different screen sizes
- 🔄 Move history and undo functionality
- ⏱️ Chess clock/timer
- 🎨 Multiple board themes
- 👥 Multiplayer support
- 📊 Game statistics and analysis
- 💾 Save/load game functionality
- 🔊 Sound effects
- 📱 Tablet optimization
Feel free to submit issues and enhancement requests!
This project is licensed under the MIT License.
Built with ❤️ using React Native and TypeScript