Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Express.js & Build a Basic Chat App with Socket.io

Introduction to Express.js & Build a Basic Chat App with Socket.io

An Introduction to Express.js & Building a Basic Chat App using Socket.io by Mishal Shah (Google Summer of Code Student, Google Code-In & Google Summer of Code Mentor @ ns-3) as part of the MEAN Stack Summer Mentorship Programme

Complete video: https://www.youtube.com/watch?v=7sKtiW0iYQ0

Code built during the session is available here: https://github.com/IE-NITK/MEAN-SMP-2...

Mishal Shah: https://mishal23.github.io

Mishal Shah

July 21, 2020
Tweet

More Decks by Mishal Shah

Other Decks in Programming

Transcript

  1. Agenda • Understand about express.js • Create simple REST APIs

    with express.js (Hands-on) • About socket.io library • Build a minimal chat app (Hands-on)
  2. What is Express? Fast, unopinionated, minimalist web framework for node.

    Note: It is a backend or server-side framework!
  3. Why use Express? • Makes building web applications with Node.js

    easier & faster • Very light & extremely fast • Provides robust routing • Dynamically render HTML pages (templating engines -- 14+)
  4. Middleware Middleware functions are those pieces of code that have

    access to the user’s request, application response and next middleware to be used. • Gives developers access to add, remove/modify various features in the application Picture credits: https://developer.okta.com/blog/2018/09/13/build-and-understand-express-middleware-through-examples
  5. WebSockets • Provides bi-directional, full-duplex communications over one single TCP

    connection • Communications done over TCP port 80 or 443
  6. Socket.IO • Enables real-time bi-directional event-based communication • Works on

    every platform, browser and device focusing equally on reliability and speed. Used for: • Real-time analytics • Streaming • Instant messaging & chat • Documents Collaboration
  7. Assignment • User typing functionality • Number of users in

    the room functionality • User left functionality Many more...
  8. Source code • All source code will be made available

    on IE-NITK GitHub Page https://github.com/IE-NITK/ • Will be updated in the video’s description