Skip to content

Latest commit

 

History

History
105 lines (78 loc) · 2.01 KB

readme.md

File metadata and controls

105 lines (78 loc) · 2.01 KB

Multiplayer TicTacToe

built with socket.io

A simple and easy to Use TictacToe game WebApp ! Check the code for the explanation

Simple steps to get started:

  1. Clone repo
  2. setup server side
  3. Setup client side
  4. 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:

  1. First go inside the 'Server' directory
cd .\Server\
  1. Next, install all the modules required
npm install

If you get some errror, try this command

npm install --force
  1. 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:

image

This confirms that your server side is setup

#3. SETUP CLIENT SIDE

This is similar as setting up the server. Steps:

  1. navigate to the "Client" folder
cd ..\Client\
  1. install the required packages
npm install

If you get some errror, try this command

npm install --force
  1. 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.

PS:

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 ⭐