
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.
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.
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.
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.
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.
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.
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.
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.
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.
Explore rxjs observable, a push-based producer delivering multiple values to an observer. Compare it with promises and learn its four core parts.
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.
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.
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.
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.
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 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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Develop a real-time online pizza order app using socket.io with a MongoDB database, linking pizzas and orders, and delivering live order status updates to connected clients.
Discover MongoDB, a document database with scalability and flexibility, offering enterprise, community, and cloud deployments with collections and documents mapping to code, plus real-time aggregation in a distributed system.
Learn to write MongoDB queries using the terminal by creating a pizza order database, defining collections, inserting multiple documents, and retrieving data with find, pretty, and findOne.
Create a socket.io application with express js, wire up an http server, and use a busia namespace to fetch documents from mongodb and emit them to clients.
Continue building a Socket.IO app with Express, performing an aggregate group-by on the pizza orders collection, then create an orders room in the pizza namespace to broadcast new order updates.
Develop a pizza order application in React with Socket.IO client integration, enabling users to place orders and view real-time pizza order counts from other customers.
Develop and connect a socket.io client service that uses observables to stream a pizza list and order count, and emit new order events, exporting a singleton service instance.
Create a React class component that loads pizza list via socket service, stores it in state, and renders a table with image, name, ingredients, Indian rupees price and order button.
Advance component logic with an on click order submission that inserts a new order into the pizza orders collection, then render live per-name order counts using socket.io and React hooks.
Explore the challenge of keeping the pizza order count in sync in real time across web and mobile apps, as orders placed externally may not update until a refresh.
learn how to migrate a pizza order application from socket.io 2.x to 4.x in react 17, including step-by-step code migration, client-server setup, and live count updates across two browser instances.
Develop a pizza order functional component with hooks that uses a socket service to fetch pizza lists, track order counts, and place new orders, rendering in a table.
Learn how MongoDB change streams provide real-time updates between a socket-based in-house dashboard and a customer-facing app, via a replica set, watch, and rest api.
Set up a MongoDB replica set, initiate it, and create a technology database with two collections, then insert five documents and run a find query with pretty formatting.
Develop a node.js and Express REST API to fetch energy questions from MongoDB and store results in Angular Rules, using Mongoose, body-parser, CORS, and Morgan.
Write data access logic for a rest api using an ECMAScript 6 class that connects to a Mongo dissembler via mortgages, with methods to fetch energy questions and insert data.
Configure a two-route rest api with express to fetch energy questions via get and submit votes via post, using a data access layer and middleware integration.
Create a single-page React JS voting app that fetches Angular questions from Engy questions collection via an Express REST API and submits votes to the database.
Write world service logic using axios to perform get and post requests against a rest API, handling responses and errors, exporting a default service instance for React-based applications.
Build a React class component that fetches questions from a rest API in componentDidMount, renders five radio-question rows, submits the answers to the API, and redirects to a thank-you page.
Configure routes and navigation links to lazy-load the angular voting component and the thank you component. Test the vote submission flow end-to-end.
Create a Socket.IO app with Express to stream real-time vote aggregates from a MongoDB replica set and display them with Highcharts, using change streams for live updates.
Build a real-time dashboard with Express and Socket.IO, performing a MongoDB aggregate query and emitting results to clients, with change streams notifying on data updates.
Create an in-house dashboard using React JS, extending a copied single-page app, installing dependencies, and building a dashboard with navigation and a dashboard menu, ready to connect with socket.io client.
Connect a dashboard service to the socket.IO server with an observable and the IO namespace. Emit a get angular volts event and stream the resulting data, handling errors as needed.
Install and integrate the high charts library with the application. Create a reusable dashboard chart component that displays the average rewards of different technologies using highcharts react with props options.
Define and export a global chart options object for high chart in a shared module, configuring type, title, x axis categories, y axis title, and sample cities data for reuse.
Build a React class component that renders a Highcharts chart using a chart options object to visualize angular votes, fetching data from a dashboard service and subscribing to an observable.
Visualize technology votes with a Highcharts dashboard chart, wiring an observable error flow, handling subscriptions in componentDidMount and cleanup on unmount for a robust voting dashboard.
Configure the route and navigation link to lazy-load and render the Angular voting dashboard component, wiring it into a Socket.IO powered React app with port and configuration adjustments.
Configure a KPI chart by using line plot zones to color-code values red, orange, and green. Switch between line and bar charts on the dashboard to visualize KPI data.
Migrate Socket.IO 2.x apps to 4.x and React 17.x with hooks by building voting and dashboard UIs, installing latest client libraries, and rendering vote analytics with Highcharts.
Recap the course covers socket.io basics, server and client APIs, namespaces and rooms, stock and pizza order demos, and implementing change streams with MongoDB to broadcast updates to multiple clients.
Conclude the migration by reviewing completed applications such as fake stock updates and a pizza order app, presented in two sections, with migration documents guiding socket.io related steps.
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.