Chat room report

Embed Size (px)

DESCRIPTION

Chat room java project report

Citation preview

  • ACKOWLEDGEMENT

    If words are considered as a symbol of approval and token of appreciation then let the words

    play the heralding role expressing my gratitude. The satisfaction that accompanies that the

    successful completion of any task would be incomplete without the mention of

    people whose ceaseless cooperation made it possible, whose constant guidance and

    encouragement crown all efforts with success. We are grateful to our project guide Prof. Hiteshri

    N. Modi for the guidance, inspiration and constructive suggestions that helpful us in the

    preparation of this project. We also thank our colleagues who have helped in successful

    completion of the project.

    Solanki Abhishek Umesh

    Prabhat Kumar

  • INDEX

    No. Chapter Page no

    1 Introduction 1

    2 Project Requirement 3

    3 Project Planning 4

    4 UML Diagrams 5

    5 Implementation Details 10

    6 Future Enhancement 18

    7 Conclusion 19

    8 References 20

  • LIST OF FIGURES

    No. Diagrams Page no

    1 UseCase Diagram 5

    2 Class Diagram 6

    3 Activity Diagram 7

    4 Sequence Diagram 8

    5 Statechart Diagram 9

    6 Sign In 14

    7 Join us 15

    8 Home page after login 15

    9 Chat Room 16

    10 Admin 16

    11 Account 17

    12 Error 404 17

    13 Session Error 18

    14 Error 500 18

    15 Error 405 19

  • LIST OF TABLE

    No. Chapter Page no

    1 Main Table 10

    2 User Table 11

  • P a g e 1 | 26

    1. INTRODUCTION

    1.1 Overview

    Teleconferencing or Chatting, is a method of using technology to bring people and ideas

    together despite of the geographical barriers. The technology has been existing for years but

    the acceptance it was quit recent. Our project is an example of a chat server. It is made up of 2

    applications the client application, which runs on the users web browser and server

    endpoint , which runs on any PC on the network. To start chatting client should get connected

    to server where they can practice two kinds of services, broadcasting of messages (chat room)

    and file transfers and during the last one security measures were taken

    The main problem concerning messaging system is the arrival of message right on the receiver

    sidewithout refreshing the page or reloading after some interval. In this project the problem is

    solved with the help of HTTP Pushing concepts instead of HTTP pooling

    1.2 PURPOSE

    We can use such type of application in private firms and Organization.

    The purpose of Messaging System is to communicate inside any organization with certain

    amount of peoples.

    Web based services makes it easier to access and communicate rather than using

    windows based applications.

    File transfer is easier between groups of people in same environment

    Messaging system also allows users to view profiles of all the registered users.

    1.3 SCOPE

    Web based messaging systems are increasing exponentially as its easier to use and client

    side dependencies is not required.

    Messaging system makes it easier to communicate outside the organization and at any

    given time

  • P a g e 2 | 26

    Online messaging is more used than windows application now a days, hence the demand

    is increasing on web services

    It includes bright future for development of web based messaging and communication

    system which can also be profited by providing secured messaging services.

  • P a g e 3 | 26

    2. REQUIREMENT ANALYSIS

    2.1 DEVELOPMENT ENVIORNMENT:

    2.1.1 Hardware specification:

    1. Server Processing: Intel i3

    2. HDD: 250 GB

    3. 4 GB RAM or above for better performance

    2.1.2 Software specification:

    1. Platform support:

    Windows 8

    2. Application Development tool used:

    Netbeans 7.3.1

    2.2 SUPPORTED ENVIORNMENT:

    2.2.1 Hardware specification:

    1. 180 GB Minimum Requirement

    2. 2 GB RAM minimum required for Good Performance.

    3. Any dual core or above processor.

    4. Any modern browsers that support JS and JSON

    2.2.2 Software specification:

    1. Platform support:

    Multiplatform supported and can be run on any latest web browsers which

    provides support for JS and JSON. e.g Mozilla Firefox, Google Chrome

  • P a g e 4 | 26

    3. PROJECT PLANNING

    3.1 MODULE OF PROJECT

    1. Registration Module: These module is for the guest users to get register for accessing the

    services

    2. Login Module: From, these module the only registered user can get login into and

    communicate within organization

    3. Chat Room Module: here all the online users can chat together simultaneously.

    4. Account Module: User can change personal information and profile

    5. Admin Module: Manages the Database and File sharing, can view the statistics of the system.

    Add and remove users

    6. History Module: The user can view its previous history like last accessed time, IP etc.

    3.2 SCHEDULE OF PROJECT

    Schedule of these project requires:

    Total effort: It requires daily 2-3 hours effort for completing the whole project in one semester.

    Project member: It requires the effort of two people together working in a team.

  • P a g e 5 | 26

    4. UML DIAGRAMS

    4.1 USECASE DIAGRAM:

    Usecase diagram shows the functionality of the system.

    Figure:1 Usecase Diagram

  • P a g e 6 | 26

    4.2 CLASS DIAGRAM:

    It shows the particular attaribute and operation of the actor.

    Figure:2 Class Diagram

  • P a g e 7 | 26

    4.3 ACTIVITY DIAGRAM

    The activity diagram describes the different activities taking place on some events

    Figure:3 Activity Diagram

  • P a g e 8 | 26

    4.4 SEQUENCE DIAGRAM

    The sequence diagram describes the sequence of the events.

    Figure:4 Sequence Diagram

  • P a g e 9 | 26

    4.5 STATECHART DIAGRAM

    The sequence diagram describes the sequence of the events.

    Figure:5 Statechart Diagram

  • P a g e 10 | 26

    4.6 Data Dictionary

    4.6.1 main Table:

    Column Name Data Type Description

    ID INT(11) Unique user identification no.

    userName Varchar(15) Unique user name

    email Varchar(45) Emaid id of users

    Password BLOB Encrypted user password

    lastAccessed Varchar(45) Shows the time when the user

    has accessed the services

    IP Varchar(20) Last IP address from where thw

    user has logged in

    name Varchar(20) Full name of the user

    bDate Varchar(20) Birth date of user

    gender Varchar(1) Gender of user

    bio Varchar(300) Short bio description of user

    mobile Varchar(10) Contact no. of users

    securityKey Varchar(10) Key to retrieve password

    avatar Varchar(300) Image location of profile

    picture

    Table 1:main

  • P a g e 11 | 26

    4.6.2 user Table:

    Column Name Data Type Description

    ID Int(11) Unique user ID

    messageType Varchar(1) M for message and F for file

    receiveSend Varchar(1) S for sending message/File

    and R for receiving

    message/File

    user Varchar(20) Indicates the ID or userName

    of the second user

    time Varchar(50) Shows the message

    transaction time

    data Varchar(500) Shows the actual data that was

    transferred

    Img Varchar(200) Shows image of cake.

    Table:2 users

    For every single users a new User Table will be created which will store the users data, the

    reason behind this is its difficult to maintain and fire quire on large and heavy set of table, when

    user is removed its table is also removed which doesnt create lack of consistencies in main

    table.

  • P a g e 12 | 26

    5. IMPLEMENTATION DETAILS WITH SNAPSHOT

    5.1 TOOLS USED:

    5.1.1 Java:

    This Messaging System has been programmed in Java. Java is a programming language and

    computing platform first released by Sun Microsystems in 1995. It is the underlying technology

    that powers state-of-the-art programs including utilities, games, and business applications. Java

    runs on more than 850 million personal computers worldwide, and on billions of devices

    worldwide, including mobile and TV devices.The version which has been chosen for this project

    is JRE System 1.7. This version contains important enhancements to improve performance,

    stability and security of the Java applications.

    Java is known for his large number of libraries. Indeed, Sun provides a large number of

    frameworks and API in order to allow a lot of diversified uses. This is why Java was probably

    the best choice, at least the most suitable language, for the implementation of this project.

    5.1.2 Database(MySQL):

    The backend of the Messaging System is handled by MySQL, the world's second most widely

    used open-source relational database management system (RDBMS) .The SQL phrase stands for

    Structured Query Language. The MySQL development project has made its source code

    available under the terms of the GNU General Public License, as well as under a variety of

    proprietary agreements. MySQL was owned and sponsored by a single for-profit firm, the

    Swedish company MySQL AB, now owned by Oracle Corporation.

    5.1.3 WebSockets:

    The messages ared handled by WebSocket, a protocol providing full-duplex communications

    channels over a single TCP connection. The WebSocket protocol was standardized by the IETF

    as RFC 6455 in 2011, and the WebSocket API in Web IDL is being standardized by the

    W3C.WebSocket is designed to be implemented in web browsers and web servers, but it can be

    used by any client or server application.

    The WebSocket Protocol is an independent TCP-based protocol. Its only relationship to HTTP is

    that its handshake is interpreted by HTTP servers as an Upgrade request. The WebSocket

    protocol makes possible more interaction between a browser and a web site, facilitating live

    content and the creation of real-time games. This is made possible by providing a standardized

  • P a g e 13 | 26

    way for the server to send content to the browser without being solicited by the client, and

    allowing for messages to be passed back and forth while keeping the connection open. In this

    way a two-way (bi-directional) ongoing conversation can take place between a browser and the

    server.

    5.1.4 JSON:

    The messages are formatted in JSON or JavaScript Object Notation, is an open standard format

    that uses human-readable text to transmit data objects consisting of attributevalue pairs. It is

    used primarily to transmit data between a server and web application, as an alternative to

    XML.Although originally derived from the JavaScript scripting language, JSON is a language-

    independent data format, and code for parsing and generating JSON data is readily available in a

    large variety of programming languages.

    JSON object is easier to read and is supported by all modern browsers.

  • P a g e 14 | 26

    5.2 PROJECT DETAIL WITH SNAPSHOT:

    The snapshots in this section describes the system overview and how it works

    5.2.1 Sigin In

    First, step includes visiting the site and then visiting the sign in page which also includes link for

    registration , sign-in troubles and About page links.

    Figure:6 Messaging System Sign In

    5.2.2 Hiding the technology

    All the jsp pages are mapped to equivalent URLs and users are unaware about the underlying

    technology. This configuration also enhances security

    Figure:5 URL Mapping

  • P a g e 15 | 26

    5.2.3 Join us

    The registration or Join US page, requires users to fill up basic form for using messaging

    services.

    Figure:7 Join Us page

    5.2.4

    After getting login, user get to home page where different functions can be accessed like chat

    Room, File transfer and Account settings.

    Figure:8 Home page after login

  • P a g e 16 | 26

    5.2.5 ChatRoom

    This is the main function module where the user can chat with other members, the page also

    dynamically shows the online users and messages without refreshing or reloading the page.

    Figure:9 chatRoom

    5.2.6 Admin

    The administrator can manages database, file sharing, can view statistics and also manage users

    by removing or disabling their access.

    Figure:10 Admin

  • P a g e 17 | 26

    5.2.7 Account

    If the users at some point want to modify his/her personal and contact details than the Account

    modules helps to change or add some new details overwriting the old ones.

    Figure:11 Account

    5.2.8 Error Handling

    Its difficult for users to understand the exceptions error generated by server, hence in Messaging

    System all the basic and well known web errors are handled by the system itself and gives some

    user friendly error messages.

    Each error is handled by defined error code hence the server can easily identifies where the

    problem occurred.

  • P a g e 18 | 26

    Figure:12 error 404

    When someone tries to access the previous session after the user has logged out, it prohibits the

    users to access the last session

    Figure:13 Session Error

    There are situation when user tries invalid queries and the server fails to server the request than it

    generates error 500 which is also handled by Messaging System.

  • P a g e 19 | 26

    Figure:14 error 500

    All the servlets in the Messaging System are using POST method, hence user cannot directly

    interact with servlet, if it happens that user tries to access the Servlet than sever will throw error

    405 which is also handled by this project.

    Figure:15 error 405

  • P a g e 20 | 26

    6. FUTURE ENHANCEMENT

    As, discussed above, project includes the basic web chat features. Users can here chat in groups,

    transfer files and view profiles, but there are many more aspects of Messaging System which can

    be enhanced further , which includes.

    Private communication

    Storing and retrieving previous session messages

    Messages can be forwarded

    Enhanced searching

    More personalization features like theme, welcome message, status etc.

  • P a g e 21 | 26

    7. CONCLUSION

    As discussed above, the development of any project or website is never completely possible.

    There are so many remaining features in these site improve the modules, that I dont consider

    this project as being totally finished. One of the biggest parts of the project is also to deal with

    errors without any crash or bug which we tried to handle. From our experience, I think that this

    project is a very interesting way to improve its Object- oriented programming knowledge, and

    more precisely its Java development skills also it had help us to gain our knowledge of database

    in terms of practical life.

    During this project we learn some new concepts of HTTP pooling and pushing, with some

    exciting technologies like Web Sockets and JSON Therefore, idea of Messaging System is a

    different experience and we learned to make online messaging more creative over the internet as

    different demands of messaging techniques are increases !

    We have also used GIT Subversion Repository for this project :

    github.com/AbhishekSolanki/websocchatroom

    Technical Aspect :

    Using webSocket we can achieve HTTP pushing which can give optimum performance

    on server instead or HTTP pooling which refreshes the page to get the data

    When some data is available the whole page is not retrieved again and again, but only

    some text string are fetched which creates less overhead

    Server can server to some other application also when clients are ideal.

    The text is delivered using JSON object which can be easily parsed on client side

    Hence, when there are large numbers of users , the HTTP pushing method is

    recommended to use and this can be achieved by WebSockets.

  • P a g e 22 | 26

    8. REFERENCES

    1. Java WebSocket Programming Danny Coward

    2. http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm

    3. http://java.dzone.com/articles/websocket-and-java

    4. https://www.openshift.com/blogs/how-to-build-java-websocket-applications-using-the-

    jsr-356-api

    5. http://java.dzone.com/articles/creating-websocket-chat

    6. www.sanwebe.com/2013/05/chat-using-websocket-php-socket