A real-time chess game with simultaneous move mechanics, built with Next.js, React, Node.js, and WebSockets. UI/UX inspired by Lichess.
In this chess variant, players can move multiple times in a row! Each player has a timer (1s, 3s, or 5s) that resets after each move. If time expires, an auto-move is played automatically.
- Real-time multiplayer gameplay using WebSockets
- Simultaneous move mechanics - players can move multiple times
- Timer variants: 1 second, 3 seconds, or 5 seconds per move
- Auto-move when time expires
- Lichess-inspired UI/UX with modern design
- Responsive design for desktop and mobile
- TypeScript for type safety
- Tailwind CSS for styling
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
- Backend: Node.js, WebSocket (ws library)
- Chess Logic: chess.js library
- Real-time: WebSocket connections
- Node.js 24+ (recommended)
- npm or yarn package manager
- Clone the repository:
git clone <repository-url>
cd simultaneous-chess- Install dependencies:
npm installYou need to run both the WebSocket server and the Next.js development server.
npm run dev:full- Start the WebSocket server (in one terminal):
npm run server- Start the Next.js development server (in another terminal):
npm run dev- Open your browser and navigate to:
http://localhost:3000
The WebSocket server runs on port 8080, and the Next.js app runs on port 3000.
- Select Timer Variant: Choose between 1s, 3s, or 5s timers
- Find Game: Click "Find Game" to match with another player
- Make Moves: Click on your piece, then click on the destination square
- Timer Management: Make your move before time runs out
- Simultaneous Play: Both players have independent timers and can move multiple times
- Each player has a timer (1s, 3s, or 5s) per move
- Timer resets after each valid move
- If time expires, a random legal move is automatically played
- Players can move multiple times in a row
- Standard chess rules apply for all moves
- Game ends when checkmate, stalemate, or draw occurs
simultaneous-chess/
src/
components/
ChessBoard.tsx # Chess board component with Lichess-inspired design
Game.tsx # Main game logic and WebSocket handling
app/
page.tsx # Main application page
server.js # WebSocket server for real-time gameplay
npm run dev- Start Next.js development servernpm run server- Start WebSocket servernpm run dev:full- Run both servers simultaneouslynpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
The server uses WebSocket connections for real-time gameplay. Message types include:
find-game- Find an opponentmove- Make a chess movetimer- Timer updatesgame-over- Game endedopponent-disconnected- Opponent left the game
- Player authentication and profiles
- Game history and replay
- Tournament mode
- Chat functionality
- Different board themes
- Sound effects
- Mobile app version
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.