Project Report On Lan-Chat Application in Java-MySQL
Project Report On Lan-Chat Application in Java-MySQL
LAN-CHAT APPLICATION
Developed At
Department Of Information Technology Faculty of Technology, Dharmsinh Desai University College Road, Nadiad-387001
Guided By
Asst. Prof. S.J.Joshi Dept. of Information Technology Faculty of Technology Dharmsinh Desai University
Department of Information Technology Faculty of Technology, Dharmsinh Desai University College Road, Nadiad-387001
CANDIDATES DECLARATION
We declare that final semester report entitled LAN -CHAT APPLICATION is our own work conducted under the supervision of the Asst. Prof. S.J.Joshi, Dept. of Information Technology, Faculty of Technology, Dharmsinh Desai University.
We further declare that to the best of our knowledge the report for B.E. final semester does not contain part of the work which has been submitted for the award of B.E. Degree either in this or any other university without proper citation.
Candidates Signature : Candidates Name: Dharmen H. Shah Branch: Information Technology Student ID: 106093
Candidates Signature : Candidates Name: Jimit K. Shah Branch: Information Technology Student ID: 106097
Submitted To: Asst. Prof. S.J.Joshi (Project Guide) Department of Information Technology, Faculty of Technology, Dharmsinh Desai University, Nadiad State: Gujarat
CERTIFICATE
This is to certify that the project carried out in the subject of Software Design Project entitled LAN-CHAT APPLICATION and provided in this report is a bonafied report of the work carried out by Mr. Dharmen H. Shah (ID No: 106093) & Mr. Jimit K. Shah (ID No: 106097) of Department of Information Technology, semester VII, under the guidance and supervision for the award of the Degree of Bachelor of Technology at Dharmsinh Desai University, Nadiad (Gujarat). They were involved in Project training during academic year 2013-2014. Asst. Prof S.J.Joshi (Project Guide) Department of Information Technology, Faculty of Technology, Dharmsinh Desai University, Nadiad Date:
Prof. R.S.Chhajed (Head of Department) Department of Information Technology, Faculty of Technology, Dharmsinh Desai University, Nadiad Date:
ii
Acknowledgement
It is indeed a great pleasure to express our thanks and gratitude to all those who helped us during this project. This project would have been materialized without the help from many who asked us good questions and rescued from various red tape crisis. Theoretical knowledge is of no importance if one doesnt know the way of its implementation. We are thankful to our institute that provided us an opportunity to apply our theoretical knowledge through the project. We feel obliged in submitting this project as part of our curriculum.
We would like to take the opportunity to express our humble gratitude to our guide Mrs.S.J.Joshi, Assistant Professor, Faculty of IT Department, DDU, under whom we undertook our project. Her constant guidance and willingness to share her vast knowledge made us enhance our knowledge and helped us to complete the assigned tasks to perfection. Without her effort and full support & an astonishing testing ability this project may not have succeeded.
Although, there may be still many who are unacknowledged in this humble vote of thanks, there are none who remain unappreciated.
Contents
1.0 Introduction 1.1 Project Details. 1.2 Purpose 1.3 Scope 1.4 Objective 1.5 Technology and Literature Review 1.5.1 Why JAVA? 1.5.2 NetBeans IDE Features 1.5.3 Network Application 2.0 Project Management 2.1 Feasibility Study 2.1.1 Technical feasibility 2.1.2 Time schedule feasibility 2.1.3 Operational feasibility 2.1.4 Implementation feasibility 2.2 Project Planning 2.2.1 Project Development Approach and Justification 2.2.2 Project Plan 2.2.3 Milestones and Deliverables 2.3 Project Scheduling Project Scheduling chart 3.0 System Requirements Study 3.1 Study of Current System 3.2 Problems and Weaknesses of Current System 3.3 User Characteristics 3.4 Hardware and Software Requirements 3.5 Constraints 3.5.1 Hardware Limitations 3.5.2 Interfaces to Other Applications 3.5.3 Higher Order Language Requirements 3.5.4 Reliability Requirements 3.5.5 Safety and Security Considerations 3.5.6 Criticality of Applications 3.6 Assumptions and Dependencies 4.0 System Analysis 4.1 Requirements of New System (SRS) 4.1.1 User Requirements 4.1.2 System Requirements 4.2 Features Of New System 4.3 DFD 4.4 Use-case Diagram 4.5 Activity Diagram DDU(Faculty of Tech., Dept. of IT) 1 1 1 1 2 2 2 3 6 6 6 6 6 6 7 7 8 8 9 9 10 10 10 10 10 11 11 11 11 11 11 11 12 13 13 13 13 17 18 21 22 iv
5.0
System Design 5.1 System Architecture Design 5.2 Class Diagram 5.3 Sequence Diagrams 5.4 Component Diagram 5.5 State Chart 5.6 Database Design/Data Structure Design 5.6.1 Table and Relationship 6 Implementation Planning 6.1 Implementation Environment 6.2 Program/Modules Specification 6.3 Coding Standards 7 Testing 7.1 Testing Plan 7.2 Testing Strategy 7.3 Testing Methods 8 User Manual 9 Limitation and Future Enhancement 10 Conclusion and Discussion 10.1 Conclusions 10.2 Discussion 10.2.1 Self Analysis of Project Viability 10.2.2 Problem Encountered and Possible solutions 10.2.3.Summary of Project Work 10.3 Bibliography
23 23 23 24 29 30 32 32 35 35 35 36 37 37 38 39 42 50 51 51 51 51 51 52 52
List of Figures:
Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig Fig 2.2.1.1 Prototyping model for the project development 2.3.1 Gantt chart 4.3.1 DFD level 0 4.3.2 DFD level 1 4.3.3 DFD level 2 4.4 Use case diagram 4.5 Activity Diagram 5.1.1Class Diagram 5.1.2.1 Sequence of Admin Login 5.1.2.2 Sequence of User Login 5.1.2.3 Sequence of Disconnect User 5.1.2.4 Sequence of Chat History 5.1.2.5 Sequence of Send Document 5.1.2.6 Sequence of Send Message 5.1.2.7 Sequence of Edit Profile 5.1.2.8 Sequence of Disconnect All 5.1.3 Component Diagram 5.1.4 State Chart 5.2.1 ER Diagram 7.1 Test plan 8.1 Welcome 8.2 Login 8.3 User Chatting Window 8.4 User Chatting Window with error 8.5 Edit Profile 8.6 Check Files 8.7 Check Messages 8.8 Add Lab 8.9 Forgot Password 8.10 Forgot Password with mail sent 8.11 Registration 7 9 18 19 20 21 22 23 24 25 25 26 26 27 27 28 29 30 34 37 41 42 43 43 44 45 45 46 47 47 48 8 32 33 33 33 34 34 vi
List of Tables:
Table 2.2.3 Milestones and deliverable Table 5.1.1 student Table 5.1.2 faculty Table 5.1.3 stu_detail Table 5.1.4 sem_faculty Table 5.1.5 message Table 5.1.6 files DDU(Faculty of Tech., Dept. of IT)
Abstract
Nowadays no one has time, Lan-Chat Application is a desktop based project which is provided to improve & enhance the use of the LAN, mostly available in almost of the college.
Teleconferencing or Chatting, is a method of using technology to bring people and ideas together despite of the geographical barriers. The technology has been available for years but the acceptance it was quit recent. Our project is an example of a client-server application. It is made up of 2 applications the client application, which runs on the users Pc and server application, which runs on any Pc on the network. To start chatting client should get connected to server where they can practice two kinds of chatting, public one (message is broadcasted to all connected users) and private one (between any 2 users only) and during the last one security measures were taken.
The idea of creating a lan-chat application was initiated and it has two dimensions, one to have an experience in network programming and the other is to let people conduct meetings with others in different locations. Such that it crosses time zones, can reach many people, and reduce the paper flood.
vii
Introduction
1 INTRODUCTION
1.1 Project Details
The project entitled Lan - Chat Application is a Desktop Application that enables different type of users like Students and Faculties to do interaction with all other user and enables them to documents with this application. Main aim of this application is to provide an easy way to do conversation and announce any event to all or specific user.
1.2 Purpose
In Todays world the important thing which is required is time. Now every universities like DDU has so many resources available for everyone. But to manage them and to manage student-faculty conversation, it takes so much efforts if done manually. This project is developed mainly to reduce that efforts by making it automatically as much as possible. Which reduces the efforts.
1.3 Scope:
This Desktop based application would be used by any well established lan network and server which is created by us, has to be deployed on the local server of the lan network.
1.4 Objective:
Using this application user can do: Can do Chatting Can send file
User cant register or get username by themselves admin has to provide username and password manually in order to provide authorization to user.
Introduction
Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn than other programming languages.
Java is object-oriented.
One of the most significant advantages of Java is its ability to move easily from one computer system to another. The ability to run the same program on many different systems is crucial to World Wide Web software, and Java succeeds at this by being platform- independent at both the source and binary levels. Because of Java's robustness, ease of use, cross-platform capabilities and security features, it has become a language of choice for providing worldwide Internet solutions.
Introduction
1.5.2.2 Fast & Smart Code Editing An IDE is much more than a text editor. The NetBeans Editor indents lines, matches words and brackets, and highlights source code syntactically and semantically. It also provides code templates, coding tips, and refactoring tools.
1.5.2.3 Easy & Efficient Project Management Keeping a clear overview of large applications, with thousands of folders and files, and millions of lines of code, is a daunting task. NetBeans IDE provides different views of your data, from multiple project windows to helpful tools for setting up your applications and managing them efficiently, letting you drill down into your data quickly and easily, while giving you versioning tools via Subversion, Mercurial, and Git integration out of the box. 1.5.2.4 Write Bug Free Code The cost of buggy code increases the longer it remains unfixed. NetBeans provides static analysis tools, especially integration with the widely used FindBugs tool, for identifying and fixing common problems in Java code. In addition, the NetBeans Debugger lets you place breakpoints in your source code, add field watches, step through your code, run into methods, take snapshots and monitor execution as it occurs.
Introduction
1.5.3.1. Protocol Stacks Very Early in the history of computer network development the concept of separating the problem into multiple levels was adapted. With a multilevel architecture each layer can handle a different aspect of networking and provide that functionality to the above layer. TCP/IP is a specific implementation of a multi level network architecture. In both, the first and second chapter, we are always repeating the same sentence, which is TCP/IP protocol. It is now the time to dissect this sentence. 1.5.3.2. TCP TCP (the Transmission Control Protocol ) has the responsibility for breaking up the message into datagrams, reassembling them at the other end, resending anything that gets lost, and putting things back in the right order. It may seem that TCP is doing all the work. And in small network it is true. With TCP, there is no maximum message length. When a message is passed to the TCP protocol, if it is too large to be sent in one peace, the message is broken up into chunks or packets and sent one at a time to the destination address. The TCP packet contains the addressing information. The TCP message also contains a packet number and total number of packets. Because of the nature of the TCP/IP protocol, the packet may travel different paths and may arrive in a different order than sent. TCP reassemble the packets in the proper order and requests the retransmission of any missing or corrupted packets. TCP enables you to create and maintain a connection to a remote computer. By using the connection, both computers can stream data between each other.
Introduction
1.5.3.3. IP As the number of computers networked become larger, a system becomes necessary to give remote computers the capability to recognize other remote computers; thus the IP addressing method was born. Therefore, simply an IP address uniquely identifies any computer connected to a network. This address is made up of 32 bits divided into 4 four bytes. But since the number of connected computers is too large and since it is difficult to remember all their IP addresses, the Domain Name Service (DNS) was designed. It has the job of transforming the unique computer names (host name) into an IP address. Therefore, whenever in our project we run the client application and enter the host name, this means that we are writing the IP address of the remote computer we want to connect to indirectly. In general, TCP/IP is a set of protocols developed to allow cooperating computers to share resources across the network. 1.5.3.4. Service Port Till now, we have seen that TCP/IP forms the backbone for communication between computers, but do you know how these computers speak to each other? The answer is Ports. A port is a special location in the computers memory that exists when two computers are communicating via TCP/IP. Application uses a port number to communicate and the sending and receiving computers use this same port to exchange data. To make the job of communication easier, some port numbers have been standardized, ex, (www Port 80, Ftp Port 20, 21, Etc.). Our application uses a constant named IP-echoport = 7. 1.5.3.4. Sockets The world is defining itself as a largely Intel-processor, windows-based set of desktops communicating with back end servers of various types. Hardware and software technology advances are pushing PCs into the role of every where communications devices. For software applications to take advantage of increasingly sophisticated and feature-rich communications technology, they require an Application Programming Interface (API) which provides a simple and uniform access to this technology.
Project Management
2.1.2 Time Schedule Feasibility: The project has simple working and the basic requirement can be satisfied within the allotted time period so the time development feasibility for this is satisfied
student/faculty can use this type of application. These kinds of systems are becoming more common day by day for evaluation of the software engineers. Hence, this system is operationally feasible. As this system is technically economically and operationally feasible, this system is feasible.
2.1.4 Implementation Feasibility The project checks whether the overall functioning is reliable and feasible and the development of the project is easy going DDU(Faculty of Tech., Dept. of IT) 6
Project Management
Here we are not hosting our own application. We have made this application for our client. Initially if the project is found to be feasible as observed from the initial requirements, design is prepared. Next we build a prototype from the design. Prototype is reviewed and if there are any changes to be done in that case prototype is updated with a new design till we are satisfied. The development commences after the approval phase. The development phase is lead by testing and maintenance phase.
Project Management
2.2.2 Project Plan: 1. Gather the definition. 2. Check whether the definition is feasible or not in given deadline. 3. Requirement gathering. 4. Analysis on gathered requirements. 5. Designing. 6. Coding. 7. Testing. 2.2.3 Milestones and Deliverables Milestones are identified in order to complete the entire project in the time duration. Milestones are identified for every module of Lan-Chat Application.
PHASE
System Requirement and Analysis
DELIVERABLES
Requirement Gathering and analysis. Functional Specifications Non Functional Specifications Use Case diagram Class diagram Sequence diagram Activity diagram State diagram Collaboration diagram The output obtained for the required functionality after implementing and doing various types of testing
PURPOSE
It gives exact understanding of the users requirements.
System Design
Project Management
3.0
3.3User Characteristics
The all functionality is performed by the admin only. 1) Admin : Assign Id & Password to User. 2) User: User should be registered. User can send messages, see old messages, edit profile and download files only one time.
10
3.5 CONSTRAINTS
3.5.1 Hardware Limitations
3.5.2
3.5.3
The application does demand much reliability and it is fully assured that the particular information about the user should be secured and flow is maintained and accessed according to the rights. 3.5.5 Safety and Security Considerations
The system provides a tight security to admins account. Admin account is secure by password mechanism which are encrypted and stored to database. 3.5.6 Criticality of Applications
The application deals with the users personal tasks so the ta sk and respective details should be highly confidential and in proper flow.
11
Dependencies are described as below: This system is dependent upon that the student or faculty must be authorized by the admin. If they are not authorized then they will not be able to register their account with this application. This application depends on the server. So if server works correctly then only this application can run in proper way. Must require latest update regarding all stuff from admin as per work done.
12
System Analysis
13
System Analysis
Functional Requirement:
R1: Login:Precondition: - Student/professor must register; if not then he/she has to register first. Input: - Give Student/Professor ID & Password. Output: - User successfully login simple-user/Admin. Process : - Check Student/professor ID & Password to the database, if one of them is wrong then invalid & prompt again for ID & Password again, else valid user. Post condition: - Student/professor logged in & can change his/her password & able to share what he/she wants.
R2: Registration:Precondition: - No professor/student should be registered first. Input: - Name, Student/Professor ID, Password, E-mail, Branch, contact number etc. Output: - Successfully Creation of Account. Process : - Server store specified data in database and allow Student/professor to log in. Description: - User must have to enter Name, ID, strong Password, E-mail and register it. R3: Creating a group by Batch & Semester wise. R3.1: Select or create group. Precondition: Group can be created by Admin. Input: Select group name Output: Pop up window to that group is created. R3.2: Naming the group. Input: Enter group Name, Branch, Semester and create it. Output: Display message that group is created. Process: Make group and make database for the group. R3.3: Add member to the group. Input: Select student from database by given batch and semester. Output: Students are added. Process: Select the students from main database by given batch and semester and add to Database of group.
14
System Analysis
R4: Post or Upload document. R4.1: Select option for upload. Input: Select file or document to be uploaded. Output: Prompt user to select a document. R4.2: Select a document. Input: The document which we want to post. Output: Prompt message: Your document is successfully uploaded /posted. Process: Upload to server.
R5: Account suspend by an Admin. Precondition: Student must pass out. Input: Student Id. Output: Account is suspended. Process: Inactivate the data from database. R6: Conversation. R6.1: Select faculty/student. Input: Select faculty/student. Output: Show chatting messages. R6.2: Send a message. Input: Write a message Output: Display message is sent. Process: Send a message to receiver through network and store in database. R7: Change password. R7.1: Select account setting. Input: Select account setting. Output: Display general account setting list. R7.2: Select password change. Input: Select password change link. Output: Prompt user to enter new, confirm and old password. R7.3: Change password. Input: Old password, new password and confirming password Output: Your password is successfully changed/ Try again password doesnt match. Process: Matching an old password from database and match confirming password with new password.
15
System Analysis
R8: Profile picture changes. R8.1: Select new profile picture. Input: New profile picture and click on upload. Output: Your profile picture is changed. Process: Replacing old Profile picture by new one. R8.2: Select profile picture change. Input: Select profile picture change link. Output: Suggest user to select another picture which he/she want to change Profile picture. R9: Profile visibility. Input: Enter Name or ID to see profile. Output: Profile must be shown according to its privacy. R10:E-mail verification. Process: send initial password using mail.
16
System Analysis
4.3
DFD
Level 0
17
System Analysis
Level 1
18
System Analysis
Level 2
19
System Analysis
20
System Analysis
4.5
ACTIVITY DIAGRAM
21
System Design
22
1. Admin Login
23
System Design
2. User Login
3. Disconnect User
24
System Design
4.
5. Send document
25
7. Edit Profile
26
System Design
8. Disconnect all
27
Admin GUI
Main Application
DB management
Client GUI
Fig 5.1.3.1. Component Diagram
28
System Design
29
System Design
30
System Design
Table Name: student Purpose: This table is used to store the details of students.
Table 5.1.1
Table Name: faculty Purpose: This table is used to store the details of faculties.
Table 5.1.2
31
System Design
Table Name: stu_detail Purpose: The authorized email-id of students are stored in this table.
Table 5.1.3
Table Name: sem_faculty Purpose: This table is used to store the details of time tables of faculties labs.
Table 5.1.4
32
System Design Table Name: message Purpose: This table is used to store all the messages sent via this application.
Table 5.1.5
Table Name: files Purpose: This table is used to store all the documents sent via this application.
Table 5.1.6
33
System Design
34
Implementation Planning
35
Implementation Planning 3. Chatting This module provides the main purpose of our application. Through this module students can ask their doubts and send important documents to their respective lab faculties. Through this module faculties can discuss their important topics, send some important messages to their whole batch or to a particular student. This module also provides functionality of profile editing, see old messages, se files and signing out. 4. Server It is the core part our application. All the modules above this run on this module. Communication between above modules and server is done using TCP sockets in Java.
36
Testing
7.0 TESTING
Testing is the process carried out on software to detect the differences between its behavior and the desired behavior as stipulated by the requirements specifications. Testing is advantageous in several ways. Firstly, the defects found help in the process of making the software reliable. Secondly, even if the defects found are not corrected, testing gives an idea as to how reliable the software is. Thirdly, over time, the record of defects found reveals the most common kinds of defects, which can be used for developing appropriate preventive measures such as training, proper design and reviewing
UNIT TESTING
M ODULE TESTING
ACCEPTANCE TESTING
37
Testing
NO. ACTION INPUT EXPECTED OUTPUT OUTPUT RESULT COMMENT
Server must be satrted Waiting for connections Now, user can login User must be registred first. He should select proper option i.e. student or faculty. Authenticated details should be entered. Initial password for login is sent to registered email-id Now, user can send message, files and receive message,files. User can edit profile. User can see old received messages User can download files only once User should enter valid data
1 Run the application Click on "Click Login screen here to continue" 2 Start the server Click on Start Server should be started 3 Run the application Click on "Click Login screen here to continue" 4 Attempt to login Enter user-ID User should be and password logged in Chatting Click on Login screen
Pass Pass
Fail
Please select Fail proper options and enter valid details 6 Attempt to register Enter valid, Password sent to Password sent to Pass authenticated registered mail- registered maildetails Click id. Registered id. Registered on register successfully. successfully. 7 Attempt to login Enter user-ID User should be User should be Pass and password logged in Chatting logged in Click on Login screen Chatting screen
Registered successfully
10 Check files
Click on Check Received files Files should be displayed 11 Attempt to edit Fetched data Enter valid data profile removed and no data inserted and click on submit 12 Attempt to forget Enter user-ID New password password and secure should be answer. generated 13 Attempt to sign out Click on sign User should be out signed out successfully
Pass Pass
Pass
Fail
Pass
User must enter correct secure answer. New user can login or register
38
Testing
Testing 7.3.2 Code Coverage The way to make sure that you have got all the control flow covered is to cover all the paths in the program during the testing (via white-box testing). This implies that both branches are exercised for an if statement, all branches are exercised for a case statement, the loop is taken once or multiple times as well as ignored for a while statement, and all components of complicated logical expressions are exercised. This is called Path Testing. Branch Testing reports whether entire Boolean expression tested in control structures evaluated to both true and false. Additionally it includes coverage of switch statement cases, exception handlers and interrupts handlers. Path testing includes branch testing as it considers all possible combination of individual branch conditions. A simpler version is Statement Testing which determines if each statement in the program has been executed at least once. The coverage via Path Testing includes the coverage via Statement Testing.
40
User Manual
When user will run the application, this screen will be displayed. By clicking on Click Here, user will navigate to login.
41
User Manual
User can do login or register through this window. User has to enter his ID and Password.
42
User Manual
Figure 8.3 User Chatting Window User can send messages and documents, see old messages and files, edit profile and sign out.
43
User Manual
44
User Manual
Fig 8.7 Check Messages User can see their history and download files only once.
45
User Manual
Fig 8.8 Add Lab Faculties can add lab to their schedule.
46
User Manual
Fig 8.10 Forgot password with mail sent If user forgets his password, new password will be sent to his mail-ID.
47
User Manual
Fig 8.11 Registration User will be registered and password will be sent to his mail-id.
48
Limitations
9.0 LIMITATIONS
The part of the system can be implemented using the current technology although some modifications had to be done at various places. At various places some alterations with the prototypes and functionalities would be done in order to work out the cost constraints and to cope with the scheduling constraints. User cannot register itself to do it, it should has authorization provided by admin. Application may take time to run on server because SQL data source has been used.
49
Bibliography
10.2 DISCUSSION
10.2.1 Self Analysis of Project Viabilities According to us, this projected is completed with the primary functionalities as specified earlier but then again there is lot more than this which can be done. The project is well capable to handle the given job for some particular task but not all of them. So then it is a challenge to further develop it in to a well flagged software as it was challenge to develop upto this very stage.
10.2.2 Problem Encountered There were many problems encountered during the design and the development phase of the project. The problem to maintain priorities The problem to maintaining and accessing the database The problem for using sockets in Java.
50
Bibliography 10.2.3. Summary of Project Work We have completed our project work using software engineering, system analysis and design approach. We have done work with preplanned scheduling related with time constraints and result oriented progress in project development.
10.3 BIBLIOGRAPHY
www.msdn.microsoft.com www.jqueries.com www.codeproject.com www.w3school.com www.docs.oracle.com
51