I have implemented GroupChat Application using MEAN Stack and for real time communication like sending messages ,joining and leaving rooms ,I have used Socket.IO which is a library for Real Time Web Applications.The purpose of the project is to become capable of using socket.io for RTC(Real Time Communication).
- Node.js(server side)
- Express.js(server side)
- Angular(client side)
- MongoDB(for storing of data)
- Angular Material Design (Front end)
- Socket.IO ( for RTC)
- Socket.IO is a powerful library for real time web applications.It enables real time,bidirectional and event based communication between the browser and the server
- It is built on top of Websockets API and Node.js.
- It is mostly dependent on NPM.
- It is fast and reliable.Whenever any event occurs the server will get that event and emit the event to particular connected client.
- There is Login and Signup options for the user.I have used JWT Authentication for the user authentication.If you are not familiar with JWT then please check out this first [https://github.com/mohitsood5934/Implementing-JWT-using-Node.js]
- Now firstly we have to signup ,so that we can login in to our application
- Now we can see,user"s record is successfully stored in the database.
- Now we can login in to our application
- Routes
- localhost:4200/chat GroupChat
- localhost:4200/privatechat Private Chat
- From here onwards most of the things will be done by the use of sockets.
- We can see total users online displayed is null because ,user did not join any room till now.It will be shown once the user joined room.
- Users can join the room by pressing Join Room button
- Users can leave the room by pressing Leave Room button
- Private Chat will be implemented soon
Thanks and Regards Mohit Sood