The idea behind this project is to create a chess game that can be played by two players. The game will be implemented using Laravel and React.js, along with Inertia.js. if unfamiliar with inertia.js is, you can find more information about it here.
I am creating this project, first of all, because I love playing chess. Second, I want to learn more about Laravel and explore Websockets. I'll be using Laravel broadcasting to implement the game's real-time functionality, and I will use react.js just because I am used to it.
The first move ♟️ is to create a conceptual plan for the project. The conception can be found in the diagrams folder.
What is inertia.js?
Inertia.js lets you quickly build modern single-page React, Vue, and Svelte apps using classic server-side routing and controllers. It provides the best of both worlds by combining the simplicity of classic server-driven apps with the performance of single-page apps.
If you are reading this and you want to test the project, you can clone the project and run the following commands:
git clone https://github.com/yassine20011/chess-app.gitThen you need to install the dependencies:
composer install
npm installThen you need to create a .env file and add the following content:
cp .env.example .envYou will find a docker-compose file in the project, you can use it to run postgresql database, you can run the following command to start the database:
docker compose up -dThen you need to run the migrations:
php artisan migrateThen you can run the project using the following command:
php artisan serve
You are not done yet, you need to run the following commands to start the websockets server and the queue listener:
php artisan reverb:start
# and open a new terminal and run the following command
php artisan queue:listen
# finally open a new terminal and run the following command
npm run devContributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
git checkout -b feature/your-feature- Make your changes and commit them.
git commit -m 'Add some feature'- Push to the branch.
git push origin feature/your-feature- Open a pull request 🎉
