Development and Evaluation of A Real-Time Communication Web Appl
Development and Evaluation of A Real-Time Communication Web Appl
Lamir Shkurti
University for Business and Technology - UBT, [email protected]
Faton Kabashi
University for Business and Technology, [email protected]
Vehbi Sofiu
University for Business and Technology - UBT, [email protected]
Recommended Citation
Hyseni, Albijon; Shkurti, Lamir; Kabashi, Faton; and Sofiu, Vehbi, "Development and Evaluation of a Real-
Time Communication Web Application Using WebSocket’s, React, Node.js, and MongoDB" (2023). UBT
International Conference. 29.
https://knowledgecenter.ubt-uni.net/conference/IC/CS/29
This Event is brought to you for free and open access by the Publication and Journals at UBT Knowledge Center. It
has been accepted for inclusion in UBT International Conference by an authorized administrator of UBT Knowledge
Center. For more information, please contact [email protected].
1
1 Introduction
2 Related Work
There are specific studies for building real-time chat applications in various
techniques with different programming languages in the past, including Noor Sabah
[1], Eric Obadjere Nyerhovwo [2], Nidhi Zala [3], Kuldeep Gupta [4], Diotra
Henriyan [5], Dr. Dileep Kumar Yadav [6].
Noor Sabah, et al. [1] Introduces the escalating role of mobile devices in daily life,
specifically focusing on the burgeoning popularity of chat applications due to their
real-time messaging and versatile features such as text, image, and file exchange
across platforms like Android and iOS. The distinction between client-server and
peer-to-peer network architectures is highlighted, emphasizing the importance of
security and privacy, often underestimated in popular chat applications. The
prevalence of inadequate security measures in existing applications is addressed,
advocating for end-to-end encryption to protect messages from both service providers
and potential attackers.
Eric Obadjere Nyerhovwo [2] CHATTY was conceptualized not merely as another
chat application, but with the intent to elevate the user experience through a clean UI
and a robust app structure within a secure broadcast network. It represents a
contemporary approach to internet security in communication platforms.
3
The UI design was thoughtfully influenced by existing chat applications to provide
users with a fresh yet familiar interface. The implementation leverages a unique
combination of Flutter, Node.js, Hive, and MongoDB, with Flutter for app structure
and UI, Node.js for server setup, Hive for local database in Flutter, and MongoDB for
the central network database. Utilizing an end-to-end connection stream, data transfer
seamlessly occurs between the client and server. In testing, the application exhibited
optimal performance with no lag, garnering an impressive 95% acceptance rate
among potential users.
Nidhi Zala, et al. [3] identified the problem in real-time chat applications lies in their
disparate features and functionalities across different platforms. This project seeks to
consolidate various features like invitation sending, online indicators, typing
notifications, message storage, chatting, audio and video calls, and screen sharing into
a single application. Contrary to the notion that having multiple applications is
unfavorable, studying various existing applications provided invaluable insights into
what to develop and how to choose appropriate technologies and techniques. Notable
applications examined during the research include Flowdock, Gitter, Hangouts,
Discord, Messenger, Rocket.chat, Skype, Slack, Telegram, and Whatsapp, with a
primary focus on Gitter and Slack due to their developer-centric approach and success
over time. These platforms were recognized for their developer-oriented features and
productivity focus, making them ideal subjects for further research. The global
community of developers is continually striving to enhance user experiences and
improve application development workflows. Development stacks, such as MEAN
and MERN, have gained prominence, streamlining the development of web
applications by leveraging current frameworks like JavaScript.
Kuldeep Gupta, et al. [4] This project aims to develop an online chat system enabling
real-time communication through web browsers. The implementation will utilize the
WebRTC approach, which allows seamless real-time communication without
requiring additional browser plugins, provided the browser supports WebRTC, like
Google Chrome. However, for screen sharing functionality, a plugin installation will
be necessary. The motivation behind creating this chat app is to foster a sense of unity
within an organization comprising various departments and locations. The app aims to
facilitate communication, ensuring authentication for user security and offering
diverse styles for user comfort. While providing typical chat functionalities, CZAT
stands out by allowing users to like specific messages and create numerous
communities.
Diotra Henriyan, et al. [5] The proposed chat application encompasses web-based and
mobile platforms, designed to facilitate communication and specifically support the
city of Bandung and the wider Indonesian populace. Leveraging technologies such as
Node.js, Socket.io, MongoDB, and Java, the application aims to offer seamless, real-
time communication. The test results demonstrate that the core functionality of the
chat application, namely sending and receiving messages, is highly efficient. Chat
applications constructed using Node.js, MongoDB, and Socket.io exhibit notably
faster performance, enabling real-time communication. In contrast, those developed
with PHP and MySQL tend to lag in achieving real-time capabilities.
Dr. Dileep Kumar Yadav, et al. [6] The conception of this video chat application
revolves around fostering cohesion within organizations with diverse departments and
locations. The application prioritizes user safety and offers a plethora of user-friendly
styles. It is designed to support users like any other chat app, with the added feature of
message categorization and the ability to create numerous communities. The
application indicates user activity status and provides solutions catering to a diverse
user base to ensure privacy and a conducive environment. Additionally, it
incorporates a user gallery, allowing easy access to all published photos without the
need to navigate through chat histories.
3 System Design
The system design of our chat application is a comprehensive integration of the latest
technologies, each playing a key role in providing functionality, real-time application
performance and capabilities. At its core, the application is structured around a client-
server architecture. Below are listed the technologies along with their explanations:
Explanation of technologies:
3.1 React
ReactJS, often referred to simply as React, stands as a powerful and widely used
library that is open-source, maintained by Facebook, and has a large community of
developers. It is designed to simplify the creation of interactive and dynamic user
interfaces for web applications. React works on the principle of component-based
architecture, where the application is divided into smaller, reusable components, each
managing its own state.
3.2 Redux
Redux is a powerful open-source JavaScript library commonly used to manage
application state in a predictable way. It is often used with frameworks like React for
developing user interfaces, but it can be used with any other framework or library. At
its core, Redux follows a unidirectional data flow architecture, which ensures that data
flows in a single direction through the application.
3.3 Node.js
Node.js is an open-source, cross-platform, server-side JavaScript runtime environment
built on Chrome's V8 JavaScript engine. It was developed by Ryan Dahl in 2009 and
has since become a fundamental tool for developing scalable network applications.
One of the key features of Node.js is its event-driven, non-blocking I/O model. This
allows it to efficiently handle a large number of concurrent connections, making it
ideal for real-time applications. Node.js uses modules, which are reusable pieces of
code, to structure applications. There is an extensive ecosystem of libraries available
through NPM making it easy for developers to find and integrate functionality into
their applications. Node.js is commonly used to develop server-side applications, such
as web servers and APIs. It excels in handling I/O-related operations, such as reading
or writing to a database, making it suitable for data-intensive applications.
3.4 MongoDB
MongoDB is an open-source and widely used NoSQL database management system
that stores data in a flexible, JSON-like format. It was developed by MongoDB Inc.
and was first released in 2009. MongoDB has gained considerable attention in recent
years due to its scalability, performance, and ease of use. MongoDB stores data in a
flexible, schema-free format called BSON, a JSON-like binary representation of
documents.
3.5 Socket.IO
Socket.IO is an open-source JavaScript library that enables bidirectional real-time
communication between clients and servers. This library was created in 2010 and has
since become a fundamental tool for developing interactive real-time applications.
Socket.IO facilitates real-time communication by establishing a persistent connection
between client and server. This allows for immediate data exchange and without the
need to send successive client requests. Socket.IO uses WebSocket, a modern
protocol that provides a full-duplex communication channel over a single TCP
connection. When available, WebSocket is the primary transport mechanism, enabling
efficient real-time communication.
The combination of the above technologies allows our users to send and receive
messages in real time. With the help of Socket.IO, users can communicate effectively,
and the server assists in filtering and adding an additional level of message validation
to ensure proper message exchange. Additionally, the database allows for storing and
retrieving messages whenever needed.
5
4 Proposed Architecture
Our application offers users the flexibility to modify their personal information and
update their profiles as needed. This feature empowers users to maintain accurate and
up-to-date details, reflecting their evolving preferences and circumstances. Whether
it's updating their username, email, profile picture, or any other relevant information,
our platform ensures a smooth and user-friendly experience for making these
modifications. The ability to change personal information and tailor their profiles
enable users to present themselves authentically within the app, fostering a sense of
customization and control over their digital presence.
5 Results
Table 1. Testing CPU performance data from both applications: Node.JS, Socket.IO and
MongoDB with PHP and MYSQL
No Chat with Node.js Mongodb and Chat with PHP and MySQL based
Socket.io based (in seconds) (in seconds)
1 0.11 1.53
2 0.13 1.42
3 0.16 2.01
4 0.11 1.42
5 0.11 1.32
6 0.14 1.53
7 0.15 1.51
8 0.20 1.37
9 0.16 1.97
10 0.17 1.32
The research demonstrate that the chat app created with React and MongoDB, Node.js
outperforms the application built with PHP and MySQL in real-time.
6 Conclusions