Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
RTC using Socket.IO 4.x and React JS 17.x with React Hooks
Rating: 3.7 out of 5(12 ratings)
179 students

RTC using Socket.IO 4.x and React JS 17.x with React Hooks

Learn how to build RTC applications using Socket.IO 4.x, MongoDB and React JS 17.x using function components with hooks
Last updated 4/2021
English

What you'll learn

  • Basics of Socket IO library
  • Understand Socket IO Server and Client APIs
  • Understand the problems which you will face while building RTC applications and solutions for each problem
  • Database communication using Socket IO
  • How to broadcast messages when data is updated out of Socket IO applications
  • Learning Server and Client side Socket IO APIs by build number of applications using Express JS framework and React JS library
  • Use RxJS Observable in React JS
  • How to display KPI chart
  • Migration to Socket IO 4.x
  • Functional Components using React hooks

Course content

4 sections62 lectures8h 23m total length
  • Introduction4:46

    Learn real-time communication with Socket.IO 4.x in React using hooks through hands-on projects, from live data updates to multi-application sharing, including livestock updates, tweets, and a pizza order app.

  • Who should take this course?2:09

    Identify who should take this course: developers and students eager to learn socket.io for real-time communication, and understand client and server APIs, prerequisites, and common challenges.

  • Tools and Software required for this course1:40

    Prepare prerequisites for rtc using socket.io and react: install an ide, a node.js lts, optional create react app via npm, and mongodb community server.

  • Introduction to Socket.IO11:00

    Explore socket.io, a real-time bidirectional communication library for browser and server, not a WebSocket implementation, offering reliability, auto reconnect, disconnection detection, binary data, multiplexing, namespaces, and rooms.

  • Introduction to Socket.IO API10:38

    Explore the socket.io api by building a server and client, handling connections, emitting and listening to events, and using namespaces and rooms to route messages.

  • Simple example of Socket.IO - Theory5:01

    Build a simple socket.io real-time stock update app with an Express server. Generate fake Apple, Google, and Microsoft stocks and emit updates to clients on connect and every five seconds.

  • Demo - Simple example of Socket.IO13:39

    Build a simple socket.io server with express, generate fake stock values for Apple, Google, and Microsoft, and emit updated stock events to connected clients every five seconds.

  • Introduction to React JS boiler template - Part-I8:09

    Explore the React application template as a boilerplate for building socket-based client apps, install dependencies, run the dev server, and inspect the project structure and root component.

  • Introduction to React JS boiler template - Part-II6:54

    Explore the Valpak configuration for development and production environments and how common configuration is merged into environment-specific settings. Note the dev server on port 3000 and production build output.

  • Introduction to RxJS Observable11:08

    Explore rxjs observable, a push-based producer delivering multiple values to an observer. Compare it with promises and learn its four core parts.

  • Demo - Installing Socket.IO-Client and RxJS library4:03

    Install the socket.io client and RxJS in a React JS 17.x app, then organize the project with components and a stocks service to fetch stock values from the socket.

  • Demo - Writing service logic9:00

    Implement a stocks service in a React app using socket.io client and observables to fetch Apple, Google, and Microsoft stock values via socket events.

  • Demo - Writing component logic10:55

    Create a Stocks class component using a code snippet, fetch Apple, Google, and Microsoft stock values in componentDidMount, update state, and render them in a table.

  • Do you see a problem?5:20

    Identify why multiple clients see different stock values due to blocking and non blocking operations in Norges runtime, and show how the event loop handles requests.

  • Introduction to Namespace and Room4:44

    Introduce a namespace and a stocks room to broadcast stock updates to all connected clients, enabling join and broadcast of messages within a dedicated namespace and room.

  • Modify Socket.IO server application6:57

    Modify the socket.io server by creating a namespace and a stocks room, allowing clients to join the stocks group and receive broadcast stock values every two seconds.

  • Modify Socket.IO client application8:57

    Modify the socket.io client to join the stocks room with the join stocks room event and display Apple, Google, and Microsoft values from the livestock's event.

  • What's new in Socket.IO 3.x? - Part - I9:26

    Explore the changes from socket.io 3.x to 4.x, including cors configuration, origin and methods, and the removal of implicit default-namespace connections, to plan a minimal upgrade.

  • Implicit connection to default namespace6:25

    Explore how implicit connections to the default namespace work in Socket.IO 2.x, with a default namespace middleware and next, even when clients target the live namespace.

  • What's new in Socket.IO 3.x? - Part - II2:41

    Explore what's new in socket.io 3.x, including no implicit default namespace connections, synchronous join and leave methods. Redis adapter is no longer required and onAny replaces the use method.

  • What's new in Socket.IO 4.x?8:44

    Explore breaking changes in socket.io 4.x, including allowEIO compatibility, immutable broadcast operators, the except method for room exclusion, and utilities like join, leave, and fetch sockets.

  • Migration - Simple Stock Example12:12

    Migrate socket.io 4.x and react 17.x by enabling cors with origin and methods, upgrade the client to a create-react-app project, and demonstrate stock updates for Apple, Google, and Microsoft.

  • Introduction to React hooks12:29

    Explore why react hooks arrived in react sixteen point eight and how use state and use effect power function components. Compare with class components and review data fetching and subscriptions.

  • Simple stock function component with hooks14:07

    Learn to build a simple stock component as a functional React component with useState and useEffect, managing Apple, Google, and Microsoft stocks and rendering them from a stock service.

  • Migration - Namespace Stock Example5:23

    Migrate a socket.io namespace example to socket.io 4.x in a react 17.x app, configuring CORS for localhost:3000 and updating the client to use IO named export.

  • Namespace stock function component with hooks7:28

    Build a stocks functional component with React hooks, using useState and useEffect to fetch three stock values from a stocks service and display Apple, Google, and Microsoft.

  • No more implicit connection to default namespace5:12

    Demonstrate how Socket.IO 4.x uses multiple namespaces by connecting to the live namespace explicitly, avoiding the default namespace, with middleware and client verification.

Requirements

  • Good knowledge of React JS and should have experience of building REST APIs using Express framework
  • Basic understanding of Bootstrap framework [Optional]

Description

Have you ever thought of building real-time communication applications for your clients or in your organization? Are you tired of writing the same old long polling logic to get the updates from your databases? Do you want to share live updates of the data across two or more than two applications? Do you work with live stocks or tweets kind of applications?

As you know our clients or customers would like to get quick and live updates of the information like stocks, currencies, the sales data, tweets etc. Or they want to build live collaborative applications for the customers/in-house projects. This is where we can think of Real-time Communication and we can achieve that using one of the most popular library Socket.IO. Easy to learn and easy to implement.

This course is a complete hands-on course where we will take few real-time scenarios and develop several applications step-by-step. At the end of this course, you will have better understanding of Socket.IO library and you will be able use this library to build RTC applications. We will build several client application using React JS library along with RxJS Observable.

Important Note - This course now is updated from Socket.IO 2.x to 4.x along with React JS 17.x. Also, we are using React function components with hooks.

Who this course is for:

  • Students who want to learn Real-time communication using Socket IO library to enable various scenarios in their applications
  • Students who want to understand why, where and how to use Socket IO library using various examples
  • Learn what's new in Socket IO 3.x and 4.x
  • Students will learn migration from Socket IO 2.x to 4.x