Skip to content

DetrojaRadhey/chess_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Chess Game

A modern, real-time multiplayer chess application built with React, TypeScript, and WebSocket technology.

🎮 Features

  • 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

🪟 Images

Screenshot 2025-06-11 162652 Screenshot 2025-06-11 162819 Screenshot 2025-06-11 162922

🛠️ Tech Stack

Frontend

  • React 18
  • TypeScript
  • Vite
  • Tailwind CSS
  • React Router DOM
  • Chess.js for chess logic
  • Auth0 & Google OAuth for authentication

Backend

  • Node.js
  • Express.js
  • WebSocket (ws)
  • MongoDB with Mongoose
  • JWT for authentication
  • TypeScript

🚀 Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB
  • Auth0 account (for authentication)
  • Google Cloud Console account (for OAuth)

Installation

  1. Clone the repository
git clone <repository-url>
cd chess
  1. Install frontend dependencies
cd client
npm install
  1. Install backend dependencies
cd ../server
npm install
  1. 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_secret

Create 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

Running the Application

  1. Start the backend server
cd server
npm run dev
  1. Start the frontend development server
cd client
npm run dev

The application should now be running at http://localhost:5173

🎯 Game Rules

  • 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

🔒 Security Features

  • JWT-based authentication
  • Secure WebSocket connections
  • Protected API endpoints
  • OAuth 2.0 integration
  • Environment variable protection

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages