ChessHub is a web application for chess enthusiasts that allows players to compete against each other.
- Play chess with your friends
- Play with computer with customizable ELO
- View your game history
- Make friends
- Analyze your games
You can contribute to this repository by checking out existing issues or creating your own in the issue section (if you experience any bugs in the application or you want to propose a new feature).
- Make sure to star the repository before going ahead.
- Fork the repo. (Click on the fork button in the top right corner).
- Clone the forked repo to your local machine.
git clone https://github.com/moonpatel/ChessHub.git
- Change the present working directory.
cd ChessHub
- Create a new branch.
git checkout -b new-branch
- Create a .env file in both frontend and backend directory according to the .env.example files with the required environment variables. The stockfish chess engine binary in the repo is for Linux systems only. If you are not using Linux then download the required stockfish chess engine binary from stockfish website and place it in backend/engine directory. Also add the path of the engine to the CHESS_ENGINE_PATH variable in .env file in backend directory.
- Install the dependencies for frontend.
cd frontend
npm install
- Install the dependencies in the backend.
cd backend
npm install
- Start the frontend
cd frontend
npm run dev
- Start the backend
cd backend
npm run dev
- Visit http://localhost:5173 in your browser to view the application.
There is an alternative option to set up the project using docker. Make sure you have docker and docker-compose installed on your system.
- Fork the repo. (Click on the fork button in the top right corner).
- Clone the forked repo to your local machine.
git clone https://github.com/moonpatel/ChessHub.git
- Change the present working directory.
cd ChessHub
- Add .env files to both your frontend and backend directories based on their respective .env.example templates (can be found inside the directories itself).
- Build the docker images for frontend and backend.
docker-compose build
- Run the docker containers.
docker-compose up
- Visit the website from your browser -> http://localhost:5173