Crownix is a web-based multiplayer chess application built using Next.js. It offers a real-time, feature-rich online chess experience, complete with timers, game history, spectator mode, and customizable UI options.
- π΄ Real-time Multiplayer β Play with others using WebSockets
- π Room-based Gameplay β Unique room IDs for player matches
- β± Game Timer β Adjustable chess clock
- π Spectator Mode β Watch ongoing games
- π Move History β Display of moves in algebraic notation
- β Pawn Promotion β Interactive promotion UI
- βοΈ In-Game Chat β Live messaging with emoji support
- β Draw Offers & Resignation β Built-in game diplomacy options
- π Analysis Mode β Review previous moves and positions
- π¨ Customization Options β Multiple board and piece styles
- π± Responsive Design β Optimized for both desktop and mobile
- π Sound Effects β In-game audio cues
- β¨ Animations β Smooth UI transitions using Framer Motion
| Tech | Purpose |
|---|---|
| Next.js | React framework for server-side rendering |
| Socket.IO | Real-time communication between clients |
| Chess.js | Chess rules validation and game logic |
| React-chessboard | Rendering the chessboard UI |
| Framer Motion | UI animations |
| Howler.js | Audio effects |
| React-toastify | Toast notifications |
| emoji-picker-react | Emoji support in chat |
-
ChessBoard1.jsx / ChessBoard.jsx β Core component handling:
- Chessboard rendering
- Move validation and game rules
- Socket communication
- Game state and timers
-
Modals & Sidebars β Used for:
- Game settings
- Promotion selection
- Game result messages
-
Custom Hooks β For managing socket connections and timers
- Move Validation: Ensured using chess.js
- Timer Control: Countdown logic for both players
- Endgame Detection: Checkmate, stalemate, draw, resign
- Captured Pieces: Display of opponent and own captures
- Pawn Promotion: UI popup for promoting to Queen, Rook, Bishop, or Knight
Players can personalize their game experience:
- Choose board themes: Classic, Wooden, Marble, Metal
- Select piece styles: Standard, Modern, Fantasy
- Toggle:
- Move highlights
- Coordinates
- Sound effects
- Animations