You are on page 1of 29

ACKNOWLEDGEMENT

We would like to express our deepest appreciation to all those who provided us the
possibility to complete this project. A special gratitude to our project supervisor, Dr.
Roshan Chitrakar, whose contribution in stimulating suggestions and encouragement,
helped us to coordinate our project. We express our profound gratitude to the principal
Er.(principle) and the vice principal(vice principal) for inspiring and supporting us
during the entire project. Special thanks goes to our friend Mr. Surya Man Shrestha for
helping us to giving valuable suggestions for our project. Last but not least, many
thanks goes our friend Mr. Mithun Adhikari, HOD sir Er. Birendra Bista, Department
of Research and Development, for his continuous encouragement and support
throughout the project. We have to appreciate the guidance given by other supervisors
in our project that have helped to improve our skills, thanks to their comment and
advices.

Furthermore, we wish to express our heartfelt gratitude to our families, parents and
friends, who have always served as the strongest source of inspiration in all our ventures
we have undertaken.

Rajan Lamichane

Sandesh Pokherel

Nepal College of Information Technology

Balkumari, Lalitpur, Nepal

i
ABSTRACT

The proposed of making project is to create chat portal application that make people
chat in same network and they feel secured while chatting. One can connect with
another with client server architecture. This software will be really help to chat with
same network like LAN people feel conformable using this in small talk. This will be
java based application which really solved the user need in small task. This application
is developed which java technology. Chat concept of client server architecture is shown.

We have tried to design the project in such way that user may not have any difficulty
in using this application without much effort. This software can be really used by end
user who have desktop running devices with them.

Keywords: Chat, java, network, sockets, client, server.

ii
TABLE OF CONTENTS

Acknowledgement .......................................................................................................... i

ABSTRACT ...................................................................................................................ii

List of figure .................................................................................................................. v

List of Table .................................................................................................................. vi

CHAPTER 1 Introduction.............................................................................................. 1

1.1 Problem Statement ............................................................................................... 1

1.2 Objectives ............................................................................................................ 1

1.3 Significance of Study ........................................................................................... 2

CHAPTER 2 Literature Study ....................................................................................... 3

CHAPTER 3 Methodology ............................................................................................ 5

3.1 Software development lifecycle ........................................................................... 5

3.2 Analysis................................................................................................................ 6

3.2.1 Use case Diagram ......................................................................................... 6

3.2.2 Fully dressed use case ................................................................................... 7

3.2.3 System Sequence Diagram(SSD) ................................................................. 9

3.3 Design ................................................................................................................ 11

3.3.1 Block diagram ............................................................................................. 11

3.3.2 Sequence Diagram ...................................................................................... 12

3.3.3 Design Class Diagram(DCD) ..................................................................... 13

CHAPTER 4 Testing ................................................................................................... 14

4.1 OBJECTIVE OF TESTING .............................................................................. 14

4.2 Test cases ........................................................................................................... 14

CHAPTER 5 Conclusion ............................................................................................. 16

CHAPTER 6 Further Work ......................................................................................... 17

iii
CHAPTER 7 Bibliography .......................................................................................... 19

CHAPTER 8 Appendix................................................................................................ 20

iv
LIST OF FIGURE

Figure 1: Incremental Model ..................................................................................... 5

Figure 2:use case diagram for the Chat Portal ........................................................ 6

Figure 3:SSD for start server ................................................................................... 10

Figure 4:SSD for login system ................................................................................. 10

Figure 5: Block Diagram........................................................................................... 11

Figure 6:SD for the Chat Portal ............................................................................... 12

Figure 7:Design Class Diagram for Chat Portal .................................................... 13

Figure 8:Server GUI before started ........................................................................ 20

Figure 9:Server GUI after started ........................................................................... 21

Figure 10:Client GUI before connection ................................................................ 22

Figure 11:Client GUI after connection .................................................................... 23

v
LIST OF TABLE

Table 1: Comparison Table ........................................................................................ 4

Table 2:Table of Test Cases ...................................................................................... 15

vi
CHAPTER 1
INTRODUCTION

This system provides a suitable platform for both the clients and by providing all the
information’s required in the real-time texture message Chat may refer to any kind of
communication that offers a real-time transmission of text messages from sender to
receiver. Chat message are generally short in order to enable other participants to
respond quickly. Thereby, a feeling similar to a spoken conversation is created, which
distinguishes chatting from other text-based communication. Online chat may address
point-to-point communications as well as multicast communications from one sender
to many receivers. Sender send message and receiver receive message. Chat
application solve the real problem in real time. The receiver receive message in real
time.

1.1 Problem Statement

To build java based chat application there should be knowledge of networking in java.
The manipulation of graphics user interface(GUI) should be handled properly. In some
cases, there is needed to communicate in LAN networks between sender and receiver,
it is more applicable in that situation. We do have group chat between members so the
outside world should not distract in that manner. It is more handy because its graphical
user interface is simple and its manageable setting.

1.2 Objectives

The aim and objective of this project is to make chat portal using client server
architecture. Followings are the benefits that comes with this application.

 Immediate and easy communication between members.


 Recent communication is shown between members.
 To make GUI as simple as possible.
 Secured and undistracted communication between members.
 Help in immediate decision making.

1
1.3 Significance of Study

The purpose shows the importance of chat in daily life. For those who use this app they
should chat with respective they want as their condition. They can able to choose
according to their need for the purpose they are using it. No other disturbance from
outside parts. As client and server itself two bodies there is not any disturbance of
outside. The outside user should not bother while in portal.

The application is synchronous at same instance of time in members that involve in


group chatting.

2
CHAPTER 2
LITERATURE STUDY

Whenever a program is under execution, then definitely it would be loaded into a


specific location in the RAM. Now, the local operating system, maintains a tables which
has two entries i) Port number ii) Address of the location in the RAM in which the
program under execution when the sender sends the data, be maintains the IP address
of the machine along with the port no. Local OS maps the port number to the one present
in the table it maintains. When it finds one, there will be a corresponding address of the
local of the RAM in which the program is present. The program which is supposed to
receive the data should be executed first before executing the program which is
supposed to send the data. The transferring the data is that every system will have a
buffer memory. The data which is supposed to enter into the system or leave the system
will pass through the buffers only. For convenience, let us assume we have two
machines M-1 and M-2 between which data is to be transferred. Let B-1 be the buffer
memory of M-1 and B-2 be the buffer memory of M-2. For better understanding, let us
assume only pro1.class file is in M-1 and only pro2.class file is present in M-2. M-1
and M-2 are connected through the network. Since pro2.class file is supposed to receive
the data it should be executed first. Now, we create an object of a class in B-2 of M-2
let us call the object as obj-2. The reference of obj-2 should be present in pro2.class
file. Let this reference be ref-2. Now, in pro2.class file, we call the accept() method on
the reference ie ref-2.accept(). Coming to the transmitting side, we need to create an
object of some class in the buffer B-1 of M-1 let us call the object as obj-1. The
reference of obj-1 should be present in pro1.class file. Let this reference be ref-1.
Another important point is, obj-2 should contain ref-1 and obj-1 should contain ref-2.
Once this process is finished, now the data transmission can be achieved.

In order to complete our task, we used Java platform to build a portable, handy product
that can run in any desktop platform. We used Java Language to build our application.
We used SQLite to implement database. On comparing our project with other similar
applications, we came to conclude with the following:

3
Application

Features
Chat Portal Messenger Viber

Ease of use high medium medium

Voice call No Yes Yes

Group chat Yes Yes Yes

Private chat No Yes Yes

Tedious Less More Medium

Global network Not supported Supported Supported

Table 1: Comparison Table

4
CHAPTER 3
METHODOLOGY
3.1 Software development lifecycle

The framework we followed in developing this project is incremental model, which is


a use of linear sequential model in an iterative manner. New functionalities were added
as each increment was developed. Linear sequential model was applied to develop each
increment. The phases of the linear sequential model are: Analysis, Design, Coding and
Testing. The software repeatedly passes through these phases in iteration and an
increment is delivered with progressive changes.

Figure 1: Incremental Model

Analysis Phase: In this phase, analysis was done in order to find out the requirements
of the system. The outcome of this phase is a SRS which is an acronym for “System
Requirement Specifications”.

Design Phase: In this phase the SRS was translated into the system’s design. Context
Diagram, DFD, ER – Diagram, Use Case Diagram and Class Diagram were developed.

5
Coding Phase: In this phase coding was done according to the design and a working
system was developed by the end of this process.

Testing Phase: In this phase, the system was tested. With each testing a list of changes
to the system developed, was suggested and the changes were applied to the software
and the software was delivered as a successive increment until a satisfying system was
achieved.

3.2 Analysis

3.2.1 Use case Diagram

Figure 2:use case diagram for the Chat Portal

From the above use case diagram at first, the admin must start the server. Then the user
login to the system and send and receive message with in the same network and
communication start. Thus, the use case diagram is the set of user, system and relation
between them in the popular environment and each use case in the system boundary
fulfill the particular goal.

6
3.2.2 Fully dressed use case

Use Case UC1: Start Server

Primary Actor: Admin

Secondary Actor:

Stakeholders:

Admin: start the server.

System: active state

Preconditions:

Post conditions: It must verify user login & allow communicate with each other.

Basic flow:

- The admin must start the server.

Alternate flow:

- Must show login details according to username.


- When user press the disconnect button, show the disconnected message.

Use Case UC2: make login

Primary Actor: User

Secondary Actor: Server

Stakeholders:

User: user want to collaborate with each other in the group.

Server: allow to communicate between the user.

Preconditions: The user must login.

7
Post conditions: The user most communicate with each other.

Basic flow:

- User login to the system using username and password fields.

Alternate flow:

- At any time, if user enter username or password the system notify

Use Case UC3: Send Message

Primary Actor: user

Secondary Actor: server

Stakeholders:

user: want to send the message.

server: allow to communicate between the user.

Preconditions: users must be in active state.

Post conditions: sending & receiving the message between users should be done
without any error.

Basic flow:

- The user should write the message in a test field only.

Alternate flow:

- Receiver couldn’t receive message in case the sender didn’t press send
button or enter button.

Use Case UC4: Receive Message


8
Primary Actor: user

Secondary Actor: server

Stakeholders:

user: want to receive message.

server: allow to communicate between the user.

Preconditions: users must be in active state.

Post conditions: receiving & sending the message between users should be done
without any error.

Basic flow:

- The user should read the message in a panel field only.

Alternate flow:

- Receiver couldn’t receive message in case the sender didn’t press send
button or enter button.

3.2.3 System Sequence Diagram(SSD)

9
Figure 3:SSD for start server

When the admin start the server then it display the server started message ready for
connection then users activated.

Figure 4:SSD for login system

User logins and the system validates to checks for the right user. After login process is
completed users can communicate with each other in same network. which is validate
by server. The same process applies for next user.

10
3.3 Design

3.3.1 Block diagram

Figure 5: Block Diagram

When the use login to the system, the server verifies the right user according to
username and password field. Server can add user and update data also according to the
requirement.

11
3.3.2 Sequence Diagram

Figure 6:SD for the Chat Portal

At first the admin start the server then the server GUI display the server started message
and it also this message is recorded to the server at that instance. Now user login to the
system, authenticate and verify the user by the server. The user1 send and user 2 receive
the message and vice-versa through the server stream.

12
3.3.3 Design Class Diagram(DCD)

Figure 7:Design Class Diagram for Chat Portal

The different component shown in the figure interact with each other. The admin
interacts with the GUI and start the server. User1 interact with GUI and by inputting
username and password and same applies to user2 and they interact with each other.

13
CHAPTER 4
TESTING

Software testing is a critical element of software quality assurance and represents the
ultimate review of specification, design and code generation.

4.1 OBJECTIVE OF TESTING

 Testing is a process of executing a program with the intent of finding an error.


 A good test case is one that has a high probability of finding an as yet
undiscovered error.
 A successful test is one that uncovers an as-yet-discovered error.

4.2 Test cases

Test Test Case Purpose Result


Case ID

TC1 The server must be in active Allow to Users


state. communicate communicate with
between users. each other

TC2 The username and Authentication Username and


password must be provided password can’t be
by server. created by the user
themselves.

TC3 The validate with the Authentication Username


minimum character given acceptable.
by the server.

14
TC4 Username and password Authentication Username and
left blank. password must be
provided.

Table 2:Table of Test Cases

15
CHAPTER 5
CONCLUSION

From this project, we are able to send and receive the message between users in groups
only within the same network. We can implement this technique in the group of user or
an organization. If we need to extend the number of user in the group, consult with the
admin to add and delete users. While making this project, we gained a lot of experience
of working as a team. We discovered various predicted and unpredicted problems and
we enjoyed a lot solving them as a team. We adopted things like video tutorials, text
tutorials, internet and learning materials to make our project complete. Furthermore,
now we know much more about the java language and the networking in java.

16
CHAPTER 6
FURTHER WORK

In this application, we can able to make a group chat between limited user in an
organization with in a same network.

We can further extend our project by making centralized database and we can
implement this by using java JDBC and ODBC and we can add further Usecase like
sign up and logout private chat option and the user may login to the system make private
chat as they need. We can further make to support for global network. We can further
save our conversation in either file or in database using centralized database technology
the user can retrieve their conversation from database directly without any problem.

17
18
CHAPTER 7 BIBLIOGRAPHY

[1] Kathy Sierra & Bern Bates, Head first java, 2nd.: O’Reilly Media, Inc., 2005.

[2] “A Networking explanation,” Oct. 3, 2003. [Online]. Available:


https://www.tutorialspoint.com/java/java_networking.htm. [Accessed: Nov. 15, 2016].

[3] . Network programming in java, [Online] Available: Tutorialspoint.com.

[4] Java™ Platform, Standard Edition 7 Course Technology, 2016.

[5] Jaspersoft Community, 'Documentation', 2015. [Online]. Available:


https://community.jaspersoft.com/documentation?version=13758. [Accessed: 09- Jan-
2017].

[6] G. Kotwal, 'Launch4j - Cross-platform Java executable wrapper',


Launch4j.sourceforge.net, 2015. [Online]. Available: http://launch4j.sourceforge.net/.
[Accessed: 19- Jan- 2017].

[7] Stackoverflow.com, 'Newest Questions', 2015. [Online]. Available:


http://stackoverflow.com/questions/7175990/java-chatserver-with-gui. [Accessed: 19-
Apr- 2017].

[8] Stackoverflow.com, 'Newest Questions', 2015. [Online]. Available:


http://stackoverflow.com/questions/21247781/java-chat-application-using-swing-
conceptual. [Accessed: 20- Jan- 2017].

[9] visualstudio.com, Available: https://www.visualstudio.com/vs/ [Accessed: 21- Jan-


2017].

19
CHAPTER 8
APPENDIX

SERVER USER INTERFACE

Figure 8: Server GUI before started

20
Figure 9: Server GUI after started

21
CLIENT USER INTERFACE

Figure 10: Client GUI before connection

22
Figure 11: Client GUI after connection

23

You might also like