Skip to content

sagnik-p/multiplayer_tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 ⭐

About

a multiplayer tic tac toe built with socket.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published