WebChess is an online chess platform that allows users to play chess with friends or opponents from around the world. This project combines various technologies, including TypeScript, React, Mobx, Golang, Rest-API, Websockets, JWT authentication, and PostgreSQL, to create a seamless and enjoyable chess-playing experience. Additionally, WebChess integrates a custom-built chess engine for accurate gameplay.
WebChess offers a range of features for chess enthusiasts, including:
- Real-time Gameplay: Play chess games in real-time with other users.
- Custom Chess Engine: A custom-built chess engine for accurate and challenging gameplay.
- User Accounts: Register, login, and manage your user account.
- Ranking System: Keep track of your performance with a ranking system.
- Chat (in dev): Communicate with your opponent during the game.
WebChess is built using the following technologies:
-
Frontend:
- TypeScript
- React
- Mobx for state management
- Websockets for real-time communication
-
Backend:
- Golang for server-side logic
- Rest-API for user authentication and game management
- Websockets for real-time game updates
- JWT authentication for secure user login
- PostgreSQL for database storage
To run WebChess locally, follow these steps:
-
Clone the repository:
git clone https://github.com/torderonex/webchess.git
-
Navigate to the project directory:
cd webchess
-
Install the frontend dependencies:
cd client npm install npm start
-
Install the backend dependencies:
cd ../server go mod tidy
-
Set up the config file in ./server/config/config.yaml.
postgres: HOST: PORT: USERNAME: DBNAME: SSLMODE: EMAIL: SMTP_PORT: USERNAME: SERVER: CLIENT_DOMAIN: localhost CLIENT_PORT: 3000 CLIENT_URL: http://localhost:3000 SERVER_URL: http://localhost:8080
Set up the .env file in ./server/.env
DB_PASSWORD = SIGNING_KEY_REFRESH = SIGNING_KEY_ACCESS = SALT = EMAIL_PASSWORD =
-
Start the frontend and backend servers in separate terminals:
Frontend:
cd client npm start
Backend:
cd server cd /cmd/main go build main.go ./main.exe
-
Access WebChess in your browser at
http://localhost:3000
.
-
Register for an account on the WebChess platform and verify account with email.
-
Login with your credentials.
-
Start a new game or join to a friend's game lobby.
-
Play chess in real-time.
-
Keep track of your ranking and improve your chess skills.
This project is licensed under the MIT License - see the LICENSE file for details.