[go: up one dir, main page]

0% found this document useful (0 votes)
81 views23 pages

C++ Chat Application Proposal: G-Chat

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views23 pages

C++ Chat Application Proposal: G-Chat

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING
THAPATHALI CAMPUS

Proposal
On
Chat Room Using C++

Submitted by:
Sanjay Shrestha THA079BCT039
Shoviyat Chapagain THA079BCT041
Sachin Gautam THA079BCT035
Pratyoush Silwal THA079BCT030

Submitted to:
Department of Electronics and Computer Engineering
Thapathali Campus
Kathmandu, Nepal

May 30, 2024


ABSTRACT

C++ is commonly omitted from applications related to internet and considered for low
level programming. This due to the fact that C++ requires low level knowledge of
computer and is mainly used for system programming, But using ASIO library from
Boost we can use C++ as a back end and Qt for front end for application related to
internet. Boost is a playground for new features in C++ where these features mature
and then they are later added in C++ standard library. Boost libraries are intended to
be widely useful, and usable across a broad spectrum of applications.

Keywords: ASIO : Asynchronus Input Output

i
TABLE OF CONTENT

ABSTRACT.................................................................................................................. .i

TABLE OF CONTENT...............................................................................................ii

LIST OF FIGURES................................................................................................... .iv

LIST OF ABBREVIATION....................................................................................... .v

1. INTRODUCTION................................................................................................... .1

1.1 Background Introduction................................................................................. .1

1.2 Motivation........................................................................................................ .1

1.3 Problem Definition............................................................................................2

1.4 Objectives..........................................................................................................2

2. LITERATURE REVIEW........................................................................................4

2.1 WhatsApp..........................................................................................................4

2.2 Discord............................................................................................................. .5

2.3 Telegram.......................................................................................................... .6

3. PROPOSED SYSTEM ARCHITECTURE.......................................................... .7

3.1 Block Diagram or System Architecture........................................................... .7

3.2 Parts of Program................................................................................................7

3.2.1 Client Program............................................................................................7

3.2.2 Server Program.......................................................................................... .9

3.3 Tools and Environment.................................................................................. .10

4. METHODOLOGY.................................................................................................11

4.1 Sockets........................................................................................................... .11

4.2 Client and Server.............................................................................................11

4.3 ASIO.............................................................................................................. .11

4.4 User Interface................................................................................................. .12

4.5 Database......................................................................................................... .12

ii
5. SCOPE AND APPLICATION............................................................................. .13

6. TIME ESTIMATION........................................................................................... .13

7. FEASIBILITY ANALYSIS.................................................................................. .14

7.1 Technical Feasibility...................................................................................... .14

7.2 Operational Feasibility................................................................................... .14

7.3 Economic Feasibility.......................................................................................14

7.4 Hardware Requirements..................................................................................14

7.5 Software Requirements.................................................................................. .15

REFERENCE............................................................................................................ .16

iii
LIST OF FIGURES

Fig. 3-1 Top Level Flowchart.....................................................................................5

Fig. 3-2 Client application......................................................................................... .6

Fig. 3-3 client side server............................................................................................8

Fig. 6-1 Time Estimation for Project..........................................................................9

iv
LIST OF ABBREVIATION

ASIO Asynchronous Input Output


iOS iPhone Operating System
VoIP Voice over IP
ORM Object-Relational Mapping
GUI Graphical User Interface

v
1. INTRODUCTION

1.1 Background Introduction

G-Chat will be developed in C++ since it has the best libraries that ensure a stable and
high-performance application. With the help of the networking, data structures, and
string manipulation libraries, we will focus only on the key features of the chat
application without having to create everything from scratch. The communication will
be done in a client-server model, where the server will be responsible for interaction
with the clients. The user interface will be as simple and functional as possible and
will contain such elements as user authentication, contact list, chat, notification, etc.
The purpose of the project is to create an intuitive and easy to use chat application in
order to prove the concept of using C++ in real time application. Hence, G-Chat will
be implemented using C++ to ensure the application is highly efficient and scalable in
order to pave way for future developments and additions.

1.2 Motivation

Following the knowledge gained from programming in C and C++, our team was
ready for a more complex project and therefore we decided to create an advanced chat
application G-Chat. In this case, we were able to review many tutorials and other
resources that were available on the internet to gain a better understanding of the
various technologies that have been used in this project. In conclusion, these factors
made us decide to create G-Chat using C++ language, ASIO library for networking,
Qt for the GUI framework, and MySQL integrated with ORM for the database. The
decision to use C++ as our primary language of implementation was both strategic
and based on the fact that we wanted to work with a language that is well-known for
its high-performance characteristics, and we were particularly interested in mastering
this language.

The decision phase of our project was significant because one of our team members
introduced us to the possibility of using these tools in our project. In our opinion, G-
Chat’s successful implementation will mark a major achievement within our learning
process as it will afford us valuable experience and prepare us for further study of
complex C++ programming, real-time network applications, and extensive database
organization. This project will serve as a stepping stone for our future projects in the

1
tech industry and it shall provide a firm ground from which we shall be able to build
up our skills in order to solve more complicated problems in the future.

1.3 Problem Definition

The project is to design and implement a complete chat system named G-Chat in C++
to meet the global need of safe and effective communication tools. The primary issue
that we plan to address is the absence of a unified, efficient chat platform that would
provide real-time communication with essential features and smooth interface.

1.4 Objectives

The project aims to facilitate the following objectives:

1. To widely utilize C++ for the development of the core logic and basic
operations of the chat application to achieve better performance.

2. The ASIO libraries are to be used to ensure that socket-based communication


is reliable and scalable, thus allowing for real-time message exchange between
the client and the server.

3. To create a contemporary and ergonomic user interface based on the Qt


framework, which will ensure the application’s high usability and
attractiveness.

4. For the purpose of having a secure and efficient database management system
using SQL in combination with an ORM to store and manage the user data and
chat history safely and effectively.

5. The following is the goal of the paper to come up with a strong client-server
model that encompasses user authentication, session management, and
efficient message passing with a focus on scalability and reliability of the
application.

6. Thus, the goal of designing a cross-platform chat application will be to


develop a program that would function effectively on different operating

2
systems and provide the user with the same level of comfort when interacting
with various devices.

3
2. LITERATURE REVIEW

G-Chat (C++-based chat application), is a C++ based chat application which provides
real-time chatting experience. Thanks to the inspiration, provided by predecessors in
the chat application domain that facilitated our progress, G-Chat differs from them
with regard to technical architecture, user interface design, security provisions and
future ambitions. Based upon C++’s.. well, building acumen and scaling capabilities,
G-Chat aims to use resources in the best possible way. Intuitive User Interface
promotes simplicity and functionality, offers a great experience to all levels of users.
Protection and privacy is the number one priority at G-Chat, with solid security
measures and high standards of privacy. In the near future, G-Chat offers further
potential for integration with multimedia capabilities and can be expanded to mobile
platforms offering a more comprehensive user experience targeting broad audience
base in later stages.

2.1 WhatsApp

WhatsApp (officially WhatsApp Messenger) is an instant messaging (IM) and voice-


over-IP (VoIP) service owned by Meta. It enables users to send text, voice, and video
messages, make voice and video calls, and share images, documents, user locations,
and other content. WhatsApp's client application runs on mobile devices and can also
be accessed from computers. Users must have a cellular mobile telephone number to
sign up. In January 2018, WhatsApp introduced a standalone business app called
WhatsApp Business, which can communicate with the standard WhatsApp client.

WhatsApp was developed by WhatsApp Inc., based in Mountain View, California,


and was acquired by Facebook in February 2014 for approximately $19.3 billion. By
2015, WhatsApp had become the world's most popular messaging application and, by
February 2020, it had over 2 billion users globally. By 2016, it had become the
primary means of Internet communication in regions including Latin America, the
Indian subcontinent, and large parts of Europe and Africa.

The features of WhatsApp include end-to-end encryption for secure communication,


group chats, and status updates, which allow users to share photos, videos, and text

4
updates that disappear after 24 hours. The app supports a wide range of media sharing
and integrates seamlessly with the phone’s existing contacts.

WhatsApp is available on multiple platforms, including iOS, Android, Windows


Phone, and KaiOS, and it can also be accessed via web browsers through WhatsApp
Web and desktop applications for Windows and Mac. This cross-platform availability
ensures users can stay connected across various devices.

WhatsApp’s impact has been profound, reshaping how people communicate globally.
Its simplicity, robust feature set, and strong emphasis on privacy have driven its
widespread adoption. The app's role in personal and professional communication
continues to grow, making it an essential tool in the digital age.

2.2 Discord

Discord is an instant messaging and VoIP social platform that supports voice calls,
video calls, text messaging, and media and file sharing. Launched in May 2015 by
Jason Citron and Stan Vishevskiy, it initially targeted the gaming community but has
since expanded to encompass a wide range of user interest. Discord allows
communication within private chats or virtual communities know as “servers,” which
consist of persistent chat rooms and voice channels accessible via invite links. The
platform is available on Windows, macOS, Android, iOS, iPad-Os, Linux, and web
browsers, ensuring wide accessibility.

Discord’s feature set includes end-to-end encrypted voice and video calls, persistent
text chat, media sharing, and the integration of bots for automated tasks. The app
supports screen sharing and streaming, as well as integration with popular services
like Spotify and YouTube. By 2024, Discord had approximately 150 million monthly
active user and 19 million weekly active servers. It has become the 30 th most visited
website globally, with a significant portion of its traffic coming from the United
States. The platform's user-friendly interface and extensive features have contributed
to its rapid growth and significant impact, making it an essential tool for both casual
and professional communication across various online communities.

5
2.3 Telegram

Telegram Messenger, commonly known as Telegram, is a cloud-based, cross-


platform, encrypted instant messaging service launched in 2013. Originally released
for iOS in August 2013 and Android in October 2013, Telegram allows users to
exchange messages, share media and files, and conduct private and group voice or
video calls, as well as public live streams. It supports end-to-end encryption for voice
and video calls and offers optional private chats known as Secret Chats, which are
also end-to-end encrypted. Telegram is available on various platforms including
Android, iOS, Windows, macOS, Linux, and web browsers.

Telegram was founded by Nikolai and Pavel Durov, who previously created the
Russian social network VK. After leaving VK, Pavel Durov focused on Telegram,
aiming to provide a secure and private messaging platform. Telegram's servers are
globally distributed, with its headquarters in Dubai, UAE. As of 2024, Telegram has
over 900 million monthly active users, with a significant user base in India, Europe,
Asia, and Africa. The app was the most downloaded worldwide in January 2021,
reaching 1 billion downloads by August 2021.

One of Telegram's key features is its social networking capability, allowing users to
post stories, create large public groups with up to 200,000 members, or share updates
in channels with unlimited audiences. The platform also supports bots, which can
perform various automated tasks. Telegram's focus on privacy and security, along
with features like self-destructing messages and two-factor authentication, has
contributed to its popularity.

Telegram has had a significant impact on communication, particularly in areas with


strict monitoring and control of information, such as during political events. However,
it has faced controversies, including accusations of facilitating illegal activities and
being banned in several countries due to its content moderation policies. Despite these
challenges, Telegram continues to thrive, driven by its robust privacy features and
wide range of functionalities.

6
3. PROPOSED SYSTEM ARCHITECTURE

The block diagrams for the system architecture are shown below:

3.1 Block Diagram or System Architecture

Fig. 3-1 Top Level Flowchart


3.2 Parts of Program

3.2.1 Client Program


The client program is the interface through which the user sends and receives
messages. Here the user is first asked to log in through the login page and then after
successful login the user is shown all the new messages from their contact and the
online and offline contacts.

7
Fig. 3-2 Client application

8
3.2.2 Server Program
This part of the project deals with the server side processing which connects multiple
user and stores the information about the users. This part of the program will use web-
socket and database to act as interface between users. The flow of the program in the
server side is as illustrated in the flow chart below.

9
Fig. 3-3 client side server
3.3 Tools and Environment

Visual Studio 2019/22 and Qt

10
4. METHODOLOGY

Various methodologies that were used in the making of this project and relevant to it
include Socket Programming, Database Handling.

4.1 Sockets

In this phase, we made sure to properly study and understand the concepts of socket
programming, a necessary aspect for our chat application. We understood concepts
like socket creation, connection establishment. And data transmission.

At its core, socket programming enables two or more programs (often referred to as
client and server) to exchange data. A socket is an end point for communication
between two machines. The server creates a socket, binds it to an ip address and port
number and waits for connection. Clients can then create their socket and bind onto
the server. Sockets can either be TCP(Transmission Control Protocol) or UDP(User
Datagram Protocol). TCP sockets are more reliable and ensure data integrity and
order. The use of TCP ensures reliable data transfer, IP address uniquely identify
clients and ports represent different processes.

4.2 Client and Server

In client server model, the server provides services to (multiple) clients. The server
creates socket and waits for the clients to connect. It also effectively and reliably
stores the data in database whereas the client(s) create their own socket and specify
their IP address to the server.

4.3 ASIO

ASIO stands for Asynchronous Input Output. Asynchronous refers to a mode of


operation where tasks or events occur independently of each other, without waiting
for one another to complete. This concept is inseparable for our project to be
satisfactory as we need multiple clients to be connected to our server which may be
doing various operations separately and one process must not affect others. It also
ensures responsiveness and scalability, especially when dealing with real-time
communication. It is also cross-platform and thus, is ideal for our project. We will be
using the non-boost version of ASIO.

11
4.4 User Interface

We have decided to make a simple and intuitive GUI for the chat application. For this,
we will use the Qt framework. Qt is a powerful cross-platform framework to create
GUI in c++. It is packed full of tools and libraries that help us create a visually
appealing application. It is very easy to use as it has drag and drop features for most
tasks. Qt provides a rich set of features, making it an excellent choice for GUI
development.

4.5 Database

When building a chat application, choosing the right database is crucial for optimal
performance, scalability, and security. A chat application project requires a database
for data persistence (storing messages and user profiles), user authentication, chat
history, real-time communication, scalability, and security. Databases play a crucial
role in ensuring a seamless and reliable user experience. So, it is really necessary for
us to implement a database properly in our project. We will be using MySQL
database and an ORM known as ODB. ORM(Object-Relational Mapping) refers to
the technique to bridge the gap between programming languages and relational
databases. An ORM allows us to treat database records as if they were any other
object thus, making it easier for us to handle databases.

12
5. SCOPE AND APPLICATION

This proposal presents G-Chat, a C++ implemented chat application with client-server
model for real time communication. In particular, the project involves designing an
easy-to-use interface, developing a system of custom-built sockets for effective and
secure message delivery, and using a database to store users’ information and
historical data of their conversations. G-Chat was designed to meet the needs of a
variety of contexts and purposes such as interpersonal communication, community,
customer service, and educational purposes. The application focuses on the aspects of
security, flexibility, and interface ergonomics, which makes it useful both for
professional and personal communication. Through the utilization of C++, G-Chat has
a stable and fast messaging system and various C++ libraries that would allow future
improvements.

6. TIME ESTIMATION

Fig. 6-1 Time Estimation for Project

13
7. FEASIBILITY ANALYSIS

The primary goal of this feasibility analysis is to evaluate the Technical, Operational,
and Economic aspects for adding new features and fixing issues in an existing system.
Here are the key points:

7.1 Technical Feasibility

The technical considerations for feasibility include:


1. The chat app can efficiently handle message exchanges, regardless of user
numbers or locations.
2. The necessary technology for developing a basic chat application is available.
3. It will be to easy to maintain and update the app over time, including code
quality, documentation.
4. The app is compatible with different devices, operating systems, and browsers
to provide a wonderful user experience chat app.
7.2 Operational Feasibility

A project is only beneficial if it meets the organization’s operational needs. To test


operational feasibility, consider the following:
1. The chat app will work correctly once it’s built and in use.
2. The chat app has a simple layout, making it easy for new users to navigate and
use.
3. Users will not resist using the app, ensuring the benefits are realized.
7.3 Economic Feasibility

The chat app is developed using free and open-source software, making it very cost-
effective. This means it can deliver great results with minimal investment, making it
an excellent economic choice. The benefits gained from the app will far exceed the
costs involved.

7.4 Hardware Requirements

1. Intel i3 2.8 GHz Processor or higher


4. 4GB RAM or more
5. 5GB of hard disk space or more

14
7.5 Software Requirements

1. Windows OS (version 8 or higher), Linux, or MacOS(9)


2. Basic graphics support (Intel HD Graphics or higher, NVIDIA, or AMD)

This analysis confirms that creating a basic chat application is practical and
achievable with existing technology, user support, and low development costs.

15
REFERENCE

1. Wikipedia, “Telegram (software),” Wikipedia , The Free Encyclopedia, May


28,2024.[Online].Available: [Link]
) . [Accessed: May 30, 2024].

2. J. Doe, “Telegram’s Rise to Popularity: A Look at the App’s Past, Present, and
Future,” InviteMember Blog , Apr. 12, 2023. [Online]. Available:
[Link]
apps-past-present-and-future/ . [Accessed: May 30, 2024].

3. Pew Research Center, “Key facts about Telegram,” Pew Research Center ,
Dec. 16, 2022. [Online]. Available: [Link]
reads/2022/12/16/key-facts-about-telegram/ . [Accessed: May 30, 2024].

4. Wikipedia, “WhatsApp,” Wikipedia , The Free Encyclopedia, May 28, 2024.


[Online]. Available: [Link] . [Accessed: May
30, 2024].

5. Wikipedia, “Discord,” Wikipedia , The Free Encyclopedia, May 28, 2024.


[Online]. Available: [Link] . [Accessed: May
30, 2024].

6. Boost, “[Link],” Boost C++ Libraries , May 28, 2024. [Online].


Available: [Link] .
[Accessed: May 30, 2024].
7. Code Synthesis, “ODB: C++ Object-Relational Mapping (ORM) Framework,”
Code Synthesis , May 28, 2024. [Online]. Available:
[Link] . [Accessed: May 30, 2024].

16
17

You might also like