built with socket.io
A simple and easy to Use TictacToe game WebApp ! Check the code for the explanation
Simple steps to get started:
- Clone repo
- setup server side
- Setup client side
- Enjoy
#1. CLONE THIS REPOSITORY Open terminal and use this command to do the job:
git clone https://github.com/sagnik-p/multiplayer_tictactoe
OR Click here
Now unzip the downloaded .zip file
#2. SETUP SERVER SIDE
Its simple Open up a terminal window and follow these steps: Steps:
- First go inside the 'Server' directory
cd .\Server\
- Next, install all the modules required
npm install
If you get some errror, try this command
npm install --force
- Now, in order to start the server, type this
npm start
CONGRATS! you are done with the server side you should see this message in your server side console:
Server Live at port 5000
Another way to confirm:
go to http://localhost:5000/
you should get this:
This confirms that your server side is setup
#3. SETUP CLIENT SIDE
This is similar as setting up the server. Steps:
- navigate to the "Client" folder
cd ..\Client\
- install the required packages
npm install
If you get some errror, try this command
npm install --force
- Run the app
npm start
CONGRATS! Your client side is setup successfully
Open 2 browser tabs or browser windows or even two different browsers You will be promted to enter your name
#4. ENJOY
This is hosted locally.
In order to play with someone on the other side of the worldYou have to do these:
- Host the client website on some hosting service
- Host the server code in the cloud , for example AWS Lambda.
Check the code comments, it is easy to understand the logic.
Thank You for reading this. If you liked it, don't forget to leave a ⭐