A modern, real-time multiplayer chess application built with React, TypeScript, and WebSocket technology.
- Real-time multiplayer chess gameplay
- User authentication with Auth0 and Google OAuth
- Interactive chess board with legal move highlighting
- Game state persistence
- Responsive design with Tailwind CSS
- WebSocket-based real-time communication
- Secure JWT-based authentication
- MongoDB database integration
- React 18
- TypeScript
- Vite
- Tailwind CSS
- React Router DOM
- Chess.js for chess logic
- Auth0 & Google OAuth for authentication
- Node.js
- Express.js
- WebSocket (ws)
- MongoDB with Mongoose
- JWT for authentication
- TypeScript
- Node.js (v16 or higher)
- MongoDB
- Auth0 account (for authentication)
- Google Cloud Console account (for OAuth)
- Clone the repository
git clone <repository-url>
cd chess- Install frontend dependencies
cd client
npm install- Install backend dependencies
cd ../server
npm install- Environment Setup
Create a .env file in the server directory with the following variables:
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
AUTH0_DOMAIN=your_auth0_domain
AUTH0_CLIENT_ID=your_auth0_client_id
AUTH0_CLIENT_SECRET=your_auth0_client_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretCreate a .env file in the client directory:
VITE_AUTH0_DOMAIN=your_auth0_domain
VITE_AUTH0_CLIENT_ID=your_auth0_client_id
VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_API_URL=http://localhost:3000- Start the backend server
cd server
npm run dev- Start the frontend development server
cd client
npm run devThe application should now be running at http://localhost:5173
- Standard chess rules apply
- Players take turns making moves
- Illegal moves are prevented
- Game state is synchronized in real-time between players
- Games are saved and can be resumed
- JWT-based authentication
- Secure WebSocket connections
- Protected API endpoints
- OAuth 2.0 integration
- Environment variable protection


