Skip to content

gitboytushar/Socket.io-Mini-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Learning Socket.io

This mini local chat web-app showcases the implementation of socket.io via simple chat user-interface where multiple users(sockets) can chat either with particular user(socketId) or they all can join a common room to chat.

Technologies Used

  • Frontend: ReactJs, Material UI
  • Backend: NodeJs, ExpressJs, Socket.io, cors

UI Screenshot

App Screenshot

Working Demonstration of the App

Click to watch โ†’

Installation and Local Preview

  1. Download Code-Zip folder or Git Clone the repo.

  2. Open the Folder in your VS code.

  3. Open its built-in Terminal.

  4. Use 2 terminal windows to run frontend and backend server separately.

  5. Start the backend first, steps for (terminal 01)

  cd server/
  npm install
  npm run dev
  1. Now, Start the frontend (terminal 02)
  cd client/
  npm install
  npm run dev
  1. In terminal 02, a localhost-url will appear.

  2. Open that url in your browser.

  3. Open Multiple browser windows to chat between them.

  • Note: Use Incognito windows
  • Each window will work as an individual user.
  1. Send messages to particular user with the socket id mentioned at the top:
  • COPY the socket ID of the user you want to send message to. (id mentioned at the top)
  • Then PASTE that Id in the Private Room Id field.
  • Write your message for that user.
  • Press Enter or Click Send.
  • The user will get message(s) in its recieved section. ๐ŸŽ‰
  1. Join and Chat in custom Room:
  • Enter custom_room_name from first user to create the room, then Click Join.
  • Then Join same named room from other user(s).
  • Now, mention the room_name for one time in joined-room-field, Now just send your messages.
  • And voila ๐ŸŽ‰ you messages are now shown in the received section for other users.
  • Note: atleast one other user should be joined the same-room to see the chats appear.
  1. That's it!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published