0% found this document useful (0 votes)
42 views77 pages

Manav Final Sem Project-1

Uploaded by

TARUN KOHLI
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)
42 views77 pages

Manav Final Sem Project-1

Uploaded by

TARUN KOHLI
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
You are on page 1/ 77

SEMESTER TRAINING REPORT

On
REAL CHAT APPLICATION
Submitted in partial fulfillment of requirements
for the award of the degree

Bachelor of Technology
In
Computer Science and Engineering
To
IKG Punjab Technical University, Jalandhar
SUBMITTED BY:
Name: Manav Maini
Roll no.: 2003223
Semester:8th
Batch:2020-2024

Under the guidance of


Mr. Rajeev Sharma
Assistant Professor

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


Chandigarh Engineering College-CGC, Landran
Mohali, Punjab - 140307
CERTIFICATE

This is to certify that Mr. Manav Maini has partially completed / completed / not
completed the Semester Training during the period from 10th Jan 2023 to 10th Jun 2023
in our Organization / Industry as a Partial Fulfillment of Degree of Bachelor of
Technology in Computer Science & Engineering.

(Signature of Project Supervisor)

Date: 20-05-2024

i
CANDIDATE DECLARATION

I hereby declare that the Project Report entitled ("Real Chat Application") is an authentic
record of my own work as requirements of 8th semester academic during the period from
10th January 2023 to 10th June 2023 for the award of degree of B.Tech. (Computer
Science & Engineering, Chandigarh Engineering College- CGC, Landran, Mohali under
the guidance of (Mr. Rajeev Sharma).

(Signature of student)

Date: 20-05-2024 (Manav Maini)


(2003223)

Certified that the above statement made by the student is correct to the best of our
knowledge and belief.

Signatures

Examined by:

1. 2. 3. 4.

Head of Department
(Signature and Seal)

ii
ACKNOWLEDGMENT

I take this opportunity to express my sincere gratitude to the Director-Principal


Dr. Rajdeep Singh Chandigarh Engineering College, Landran for providing this
opportunity to carry out the present work.

I am highly grateful to the Dr. Sukhpreet Kaur HOD CSE, Chandigarh Engineering
College, Landran (Mohali). I would like to expresses my gratitude to other faculty
members of Computer Science & Engineering department of CEC, Landran for providing
academic inputs, guidance & Encouragement throughout the training period. The help
rendered by Mr. Rajeev Sharma, Supervisor for Experimentation is greatly
acknowledged. Finally, I express my indebtedness to all who have directly or indirectly
contributed to the successful completion of my semester training.

iii
ABOUT COMPANY

As a final semester student pursuing a degree in Computer Science & Engineering, I had
the opportunity to gain valuable industry experience through a Six-month Semester Training
program with Technext Global Education Pvt. Ltd.

During my training, I received a certification in Full Stack Development, which provided


me with a strong foundation in programming and software development. However, my
major project revolved around the development of an online job portal using Java Full Stack.
This project required extensive work on my part, to meet the requirements for our End-
Semester Project. My focus was on implementing various features such as user
authentication, job listings, resume uploads, and search functionalities to create a robust and
user-friendly platform for job seekers and employers. The project demanded independent
effort outside of the Institute to ensure its successful completion.

Technext Global Education Pvt. Ltd is a leading Software and Web Application
Development Company, based in Fazilka (Punjab), that provides high-quality
comprehensive services to enterprises across a wide range of platforms and technologies.
Our major areas of expertise are in providing quality, cost-effective software, or web
development services. Technext Global Education Pvt. Ltd. is an acclaimed IT service
provider contributing its part in the development of many businesses around the globe. We
socialize with our clients to get a superior cognizance of their business and requirements
and help them in fabricating websites and applications for their business.

Services Offered: IT Consulting, Software Design & Prototyping Custom Software


Development, Software Testing & QA Services, Web Application Development,
Application Support & Software Maintenance, Web Designing Solutions (Graphics, Brand
& Logo Designing) , Web Development Solutions (PHP, .Net, HTML, C++, Java) , Mobile
Application Development (Android, Ios) , Internet Marketing (SEO, SEM, SMM).

iv
ABSTRACT

Real Chat is a modern, real-time chat application built using the MERN (MongoDB, Express.js,
React.js, Node.js) stack, offering users a seamless communication experience. The project aims
to develop a robust, scalable, and feature-rich chat platform that leverages the power of MERN
technologies for both frontend and backend components.

Key features of Real Chat include real-time messaging, user authentication and authorization,
multimedia support, group chats, and a responsive user interface. MongoDB is utilized as the
database to store user information and chat history, while Express.js and Node.js handle the
backend logic and RESTful API endpoints. React.js powers the frontend, providing a dynamic
and interactive user interface.

The project focuses on implementing efficient data synchronization mechanisms to ensure real-
time updates across all connected clients. Additionally, security measures such as encryption
of messages and secure user authentication are integrated to safeguard user privacy and data
integrity.

Real Chat not only serves as a practical chat application but also serves as a learning resource
for developers interested in building real-time web applications using the MERN stack. The
project's modular architecture and clean codebase facilitate easy customization and extension,
making it suitable for various use cases and deployment environments.

Real Chat incorporates a wide range of functionalities to enhance user engagement and
productivity. These include real-time messaging with instant updates, user authentication and
authorization mechanisms for secure access control, multimedia support for sharing images,
videos, and files, group chat functionality for collaborative discussions, and a responsive user
interface optimized for various devices and screen sizes.

MongoDB serves as the primary database for storing user profiles, authentication data, and chat
history, ensuring efficient data management and retrieval. Express.js and Node.js form the
backend infrastructure, handling the business logic, routing, and communication with the
database through RESTful API endpoints. React.js powers the frontend, enabling dynamic
rendering of UI components and seamless interaction with the application.

v
Table of Contents
CONTENT
PAGE NO.

Certificate .............................................................................................................................. i

Candidate Declaration .......................................................................................................... ii

Acknowledgement ............................................................................................................... iii

About Company .................................................................................................................. iv

Abstract ................................................................................................................................ v

Table of Contents ................................................................................................................ vi

List of Figures ...................................................................................................................viii

List of Tables.......................................................................................................................ix

Chapter 1: Introduction ........................................................................................................ 1

1.1 Brief Overview of Work............................................................................................. 1

1.2 Objective…………………………………………………………………………………….2

1.3 Scope…………………………………………………………………………………………3

1.4 Project Modules .......................................................................................................... 2

1.4.1 User Authentication………………………………………………………………………6

1.4.2 Real-Time Messaging…………………………………………………………………....6

1.4.3 Group Chat Management………………………………………………………………...6

1.5 Project Requirements…………………………………………………………………………7

1.5.1 Hardware…………………………………………………………………………………7

1.5.2 Software………………………………………………………………………………….7

Chapter 2: System Analysis…………………………………………………………………8

2.1 Literature Review…………………………………………………………………………….8

vi
2.2 Project Feasibility Study……………………………………………………………………10

2.2.1 Technical Feasibility……………………………………………………………………10

2.2.2 Economic Feasibility……………………………………………………………………10

2.2.3 Operational Feasibility…………………………………………………………………10

2.4 Project Timeline Chart……………………………………………………………………...11

2.5 Detailed Module Description……………………………………………………………….12

Chapter 3: System Design…………………………………………………………………………14

3.1 Use case Diagrams………………………………………………………………………… 14

3.2 Data Flow Diagrams………………………………………………………………………..15

3.3 Class Diagram………………………………………………………………………………17

3.4 ER Diagrams………………………………………………………………………………. 17

3.5 Activity Diagrams………………………………………………………………………….18

3.6 Features of Real-Chat…………………………………………………………………………21

Chapter 4: Software Tools………………………………………………………………………...29

4.1 Overview of MERN stack………………………………………………………………….29

4.1.1 History………………………………………………………………………………...29

4.1.2 Features of MERN stack……………………………………………………………...29

4.2 HTML…………………………………………………………………………………….,,30

4.3 JavaScript…………………………………………………………………………………..32

4.4 About CSS……………………………………………………………………………….....39

4.5 Introduction to Node.js……………………………………………………………………..42

vii
Chapter 5: Implementation and Testing ........................................................................................... 55

5.1 User Interface and snapshots ................................................................................................ 58

5.2 Test Cases………………………………………………………………………………….62

Chapter 6: Conclusion & Future work ............................................................................................. 63

Refrences………………………………………………………………………………………….65

viii
List Of Figures
CONTENT PAGE NO.

Figure 2.1- Timeline Chart……………………………………………………………………….11


Figure 3.1- Use case Diagram……………………………………………………………………14
Figure 3.2- DFD 0 level Diagram………………………………………………………………..15
Figure 3.3- DFD 1 level Diagram………………………………………………………………..15
Figure 3.4- DFD 2 level Diagram………………………………………………………………..16
Figure 3.5- Class Diagram……………………………………………………………………….17
Figure 3.6- ER Diagram .................................................................................................................17
Figure 3.7- Company Activity Diagram…………………………………………………………18
Figure 3.8 Top Features…………………………………………………………………………......21
Figure 3.9 Agents…………………………………………………………………………………...22
Figure 3.10Example of Architecture of WhatsApp………………………………………………...27
Figure 3.11Node.js Client- Server Architecture…………………………………………………….28
Figure 5.1- Home page I.................................................................................................................58
Figure 5.2- Home page II ...............................................................................................................58
Figure 5.3- Chat Interface Page .......................................................................................................59
Figure 5.4- Search Friends .............................................................................................................59
Figure 5.5- Create Group Chat .......................................................................................................60
Figure 5.6- Manage Group Settings ...............................................................................................61

I ix
List of Tables
CONTENT PAGE NO.

Table 1- Additional APIs ………………………………………………………………………..48


Table 2- Session Tracking……………………………………………………………………….51
Table 3- Cookies Acceptance…………………………………………………………………….52
Table 4- Variation in Authorization and Authentication…………………………………………53
Table 5- Test Cases and Results………………………………………………………………….62

x
Chapter 1: Introduction

1.1 Brief Overview of Work


The project encompasses the following key components and functionalities:

1. Technology Stack: Real Chat leverages the power of the MERN stack, utilizing
MongoDB as the database, Express.js and Node.js for the backend logic and API
development, and React.js for the frontend user interface.

2. Features: The application offers a wide range of features including real-time messaging,
user authentication and authorization, multimedia support for sharing images, videos, and
files, group chat functionality, and a responsive UI.

3. Real-time Communication: Real Chat implements efficient data synchronization


mechanisms, including WebSocket integration, to ensure real-time updates across all
connected clients, facilitating instant message delivery and synchronization.

4. Security: To prioritize user privacy and data security, Real Chat incorporates end-to-end
encryption for messages and robust authentication mechanisms to prevent unauthorized
access.

5. Scalability and Customization: The project's modular architecture and clean codebase
enable easy customization and extension, making it suitable for various deployment
environments and use cases. Developers can leverage Real Chat as a learning resource to
build their own real-time web applications using the MERN stack.

Overall, Real Chat aims to provide developers and businesses with a scalable, feature-
rich, and secure solution for building real-time chat applications tailored to their specific
requirements.

1
1.2 Objective
The primary objective of the Real Chat project is to develop a robust, scalable, and feature-rich
real-time chat application using the MERN (MongoDB, Express.js, React.js, Node.js) stack. The
project aims to achieve the following objectives:

1. Seamless Communication: Create a platform that offers users a seamless communication


experience, with real-time messaging capabilities, multimedia support, and group chat
functionality.

2. Technology Mastery: Provide developers with an opportunity to master the MERN stack by
building a practical application, gaining hands-on experience in database management, backend
development, frontend design, and real-time communication protocols.

3. Security and Privacy: Implement robust security measures, including end-to-end encryption for
messages and secure user authentication, to ensure user privacy and data integrity.

4. Scalability and Performance: Design the application with scalability and performance in mind,
allowing it to handle a large number of users and messages efficiently, while maintaining low
latency and high responsiveness.

5. Customization and Extensibility: Build the project with a modular architecture and clean
codebase, enabling easy customization and extension for developers interested in adapting the
application to their specific requirements or integrating additional features.

6. Educational Resource: Serve as a valuable educational resource for developers, offering


documentation, tutorials, and best practices for building real-time web applications using the
MERN stack.

Overall, the objective of the RealChat project is to deliver a comprehensive solution for real-time
communication, empowering developers to build innovative chat applications tailored to various
use cases and deployment scenarios.

2
1.3 Scope

As The scope of the Real Chat project encompasses the following key areas:

1. Functional Requirements:

• User Authentication: Implement user authentication mechanisms to allow users to register, login, and
manage their accounts securely.

• Real-time Messaging: Develop features for users to send and receive real-time messages, supporting
text, emojis, and multimedia content.

• Group Chats: Enable users to create, join, and manage group chat conversations for collaborative
communication.

• Multimedia Support: Implement functionality for users to share images, videos, files, and other
multimedia content within chat conversations.

• Search and Navigation: Incorporate search functionality and intuitive navigation to allow users to find
and access conversations efficiently.

• Notifications: Provide real-time notifications to users for new messages, mentions, or other relevant
updates.

• Profile Management: Allow users to customize their profiles, including profile pictures, status
messages, and notification preferences.

• Security Features: Implement end-to-end encryption for messages, secure user authentication
mechanisms, and measures to prevent unauthorized access or data breaches.

3
2. Non-Functional Requirements:

• Scalability: Design the application to handle a large number of concurrent users and messages, ensuring
scalability as user traffic increases.

• Performance: Optimize the application for performance, minimizing latency and maximizing
responsiveness to provide a smooth user experience.

• Reliability: Ensure high availability and reliability of the application through robust error handling, fault
tolerance, and backup mechanisms.

• Security: Implement industry-standard security practices to protect user data, prevent attacks such as
SQL injection or cross-site scripting, and comply with data protection regulations.

• User Experience (UX): Design an intuitive and user-friendly interface, with responsive layouts and
intuitive navigation, to enhance user satisfaction and engagement.

• Documentation: Provide comprehensive documentation, including installation guides, user manuals,


and developer documentation, to facilitate easy deployment, usage, and customization of the application.

4
3. Development Methodology:

• Adopt an Agile development methodology, such as Scrum or Kanban, to facilitate iterative


development, collaboration, and adaptation to changing requirements.

• Use version control systems, such as Git, for source code management and collaboration among team
members.

• Conduct regular testing, including unit tests, integration tests, and user acceptance testing, to ensure the
quality, reliability, and functionality of the application.

4. Future Enhancements:

• Consider future enhancements and features, such as voice and video calling, chatbots, integration with
third-party services, or support for additional platforms (mobile, desktop).

• Plan for ongoing maintenance, updates, and improvements to address user feedback, fix bugs, and
adapt to evolving technologies and user needs.

5
1.4 Project Modules

1.4.1 User Authentication and Authorization

Module responsible for user registration, login, and authentication.


Implement user roles and permissions to control access to features and resources.
Utilize encryption techniques to securely store and manage user credentials.

1.4.2 Real-Time Messaging

Core module handling the exchange of real-time messages between users.


Implement WebSocket communication for instant message delivery and
synchronization.
Support features like text formatting, emojis, and attachments for rich messaging.

1.4.3 Group Chat Management

Module for creating, joining, and managing group chat conversations.


Enable users to invite others to group chats, manage participants, and set chat settings.
Implement features like group chat archives and moderation controls.

6
1.5 Project Requirements

1.5.1 Hardware
The system requires the following hardware:

• RAM: 1 GB (further increase that as per requirement.)


• Hard Disk: 80 GB (further increase that as per requirement.)
• Display: 1024 * 768, True Type Color-32 Bit
• Mouse: Any Normal Mouse.
• Keyboard: Any window Supported Keyboard.

1.5.2 Software
• Database Server: MongoDB server
• Web Server: Internet Information Server
• Technologies: HTML, CSS, JavaScript, Node.js, React.js, MongoDB.

7
Chapter 2: System Analysis

2.1 Literature Review

1. Real-Time Web Applications: Real-time web applications have gained significant


attention due to their ability to provide instantaneous communication and collaboration
among users. Literature in this area emphasizes the importance of technologies like
WebSockets for achieving real-time communication and discusses various approaches to
building scalable and efficient real-time applications.

2. MERN Stack Development: Studies on the MERN (MongoDB, Express.js, React.js,


Node.js) stack highlight its advantages in developing modern web applications. Research
focuses on best practices, design patterns, and performance optimization techniques
specific to each component of the MERN stack, emphasizing the importance of choosing
the right tools and frameworks for building robust and scalable applications.

3. User Authentication and Authorization: Literature on user authentication and


authorization covers various authentication mechanisms, including JWT (JSON Web
Tokens) and OAuth, along with best practices for securing user credentials and managing
user sessions. Studies also explore the challenges of implementing secure authentication
in real-time applications and strategies for mitigating common security threats.

4. Real-Time Messaging Protocols: Research on real-time messaging protocols delves into


the underlying technologies and protocols used to enable instant message delivery and
synchronization in web applications. WebSocket, MQTT, and STOMP are among the most
commonly studied protocols, with a focus on their performance, scalability, and suitability
for different use cases.

5. Security in Real-Time Applications: Security considerations in real-time applications


are a significant focus in literature, with discussions on securing data transmission,
protecting against common vulnerabilities such as XSS (Cross-Site Scripting) and CSRF
(Cross-Site Request Forgery), and implementing encryption techniques to safeguard user
privacy and data integrity.

8
6. Scalability and Performance Optimization: Scalability and performance optimization
techniques are essential topics in literature related to web application development. Studies
discuss strategies for horizontal scaling, load balancing, caching, and database
optimization to ensure applications can handle increasing user loads and maintain
responsiveness under heavy traffic.

7. Multimedia Support and File Management: Research on multimedia support and file
management in web applications explores various techniques for handling multimedia
content, including file storage, compression, and delivery optimization. Studies also
discuss best practices for managing file uploads, ensuring security, and providing a
seamless user experience for sharing multimedia content.

8. Group Chat Functionality: Group chat functionality is a common feature in real-time


communication applications, with literature discussing the design considerations,
scalability challenges, and implementation strategies for supporting group conversations.
Studies also explore features like message threading, moderation controls, and notification
management in group chat environments.

9
2.2 Project Feasibility Study

2.2.1 Technical Feasibility


Technical feasibility study is concerned with specifying equipment and software that will
successfully satisfy the user requirement; the technical needs of the system may vary
considerably.

The facility to produce outputs in each time. Our project is a web-based application which
is based on client-server-based application. In this application every page as output is
render from server to client so it is necessary that the page should be rendered in time. For
this I have avoided more and more code in the page- load event.

2.2.2 Economic Feasibility


Economic feasibility is the measure to determine the cost and benefit of the proposed
system. A project is economical feasible which is under the estimated cost for its
development. These benefits and costs may be tangible or intangible. Chat Application is
the cost-effective project in which there is less possibility of intangible cost so there is no
difficulty to determine the cost of the project.

2.2.3 Operational Feasibility


Operation feasibility is used to check whether the project is operationally feasible or not.
Our project is mainly different from the other system because of its web-support feature.
So, the measure for operational feasibility is something different from other system.
Generally, the operational feasibility is related to organization aspects.

10
2.4 Project Timeline Chart

• Define project objectives, scope, and requirements.


• Conduct initial research and gather necessary resources
Week 1-2

• Develop backend functionalities such as user authentication, file


storage, and database.
• Implement API endpoints for file manipulation, user managment,
Week 3-5 and authentication.

• Implement frontend components using technologies like HTML,


CSS, and React.js.
• Integrate frontend interfaces with backend API endpoints for
Week 5-7 seamless interaction

• Conduct comprehensive testing of both frontend and backend


components
Week 8-10 • Address any bugs or issues identified during testing.

• Refine user interfaces based on user feedback and usability testing


results.
• Optimize UI/UX design for improved accessibilty, and user
Week 10-13 interaction

Figure 2.1- Timeline chart

11
2.5 Detailed Module Description with all Functionalities

2.5.1 User Authentication and Authorization Module:

• User Registration: Allow users to create new accounts by providing necessary information
such as username, email, and password.

• User Login: Enable registered users to authenticate themselves securely by entering their
credentials.

• Password Management: Implement features for users to reset forgotten passwords or


change their passwords securely.

• Access Control: Define user roles (e.g., regular user, administrator) and enforce access
control policies to restrict unauthorized access to certain features or resources.

2.5.2 Real-Time Messaging Module:

• Message Sending: Allow users to compose and send text messages in real-time to individual
users or groups.

• Message Reception: Instantly deliver incoming messages to recipients and update message
threads in real-time.

• Message Editing and Deletion: Support editing and deleting messages, with real-time
synchronization to reflect changes across all clients.

• Typing Indicators: Display typing indicators to indicate when a user is typing a message in
a conversation.

• Read Receipts: Provide read receipts to indicate when a message has been read by the
recipient.

12
2.5.3 Group Chat Management Module:

• Group Creation: Allow users to create new group chats and define group settings such as
name, description, and privacy settings.

• Group Invitation: Enable users to invite other users to join existing group chats, with options
for accepting or declining invitations.

• Group Moderation: Implement moderation controls for group chats, allowing


administrators to manage members, delete messages, and enforce group rules.

• Group Archives: Provide access to past messages and chat history within group
conversations for reference and review.

13
Chapter 3: System Design

3.1 Use Case Diagram

Figure 3.1- Use case Diagram

14
3.2 Data Flow Diagrams
3.2.1 Context-Level (Level 0) DFD

Figure 3.2- DFD 0 level Diagram

3.3.2 Level 1 DFD

Figure 3.3- DFD 1 level Diagram

15
3.2.2 Level 2 DFD

Figure 3.4- DFD 2 level Diagram

16
3.3 Class Diagram

Figure 3.5- Class Diagram

17
3.4 Activity Diagram
3.4.1 Company

Figure 3.7- Employer Activity Diagram

18
3.4.2 User

Figure 3.8- User Activity Diagram

19
3.4.3 Admin

Figure 3.9- Admin Activity Diagram

20
Features of Real Chat

Figure 3.10- Top features

21
Figure 3.11- Agents

22
23
24
25
26
Figure 3.12- Example of WhatsApp

27
Figure 3.13- Node.js Server-client

28
Chapter 4: Software Tools

4.1 Overview of MERN Stack

4.1.1 History of MERN stack

A technology stack can be custom (developers can choose the technologies depending on
their project requirements) or pre-built (where the technologies have been pre-decided).
MERN is a pre-built technology stack based on JavaScript technologies. MERN stands
for MongoDB, Express, React, and Node, after the four key technologies that make up the
stack.

• MongoDB — document database


• Express.js — Node.js web framework
• React.js — a client-side JavaScript framework.
• Node.js — the premier JavaScript web server (runtime)

4.1.2 Features of MERN Stack

• Pre-defined stack of technologies that are known to work well together


• Focus is on JavaScript and JavaScript based on technologies and frameworks
• Streamlined and unified development approach
• Promotes code reusability due to single language components that can be used across

29
4.1 About HTML

World wide HTML stands for Hypertext Markup Language. It is the standard markup
language used to create web pages. HTML is a combination of Hypertext and Markup
language. Hypertext defines the link between web pages. A markup language is used to define
the text document within the tag to define the structure of web pages.
This language is used to annotate (make notes for the computer) text so that a machine can
understand it and manipulate text accordingly. Most markup languages (e.g. HTML) are
human-readable. The language uses tags to define what manipulation has to be done on the
text.
HTML is a very important language as it is widely used in creating websites. Most of the
websites are built using HTML5 (the latest version of HTML). HTML mainly contains tags
and attributes that determine the formatting and structure of a website.

30
4.1.1 Java Virtual Machine

When we compile the code, java compiler creates machine code (byte code) for a
hypothetical machine called java virtual machine (JVM). The JVM will execute the byte
code and overcomes the issue of portability. The code is written and compile for one
machine and interpreted all other machines. This machine is called java virtual machine.

4.1.2 Paradigm Of Java

 Dynamic down loading applets (small application programs);

Changing economic model of the software

 Up-to-date software availability

 Supports network entire computing

4.2About Html

HTML (hypertext markup language) is a language used to create hypertext documents that
have hyperlinks embedded in them . it consists of tags embedded in the text of a document
with HTML. We can build web pages or web document s. it is basically a formatting
language and not a programming language. The browser reading the document interprets
markup tags to help format the document for subsequent display to a reader. HTML is a
language for describing structured documents. HTML isa platform independent. WWW
(world wide web) pages are written using HTML. HTML tags control in part the
representation of the WWW page when view with web browser.

31
Java Script
Java script is a general purpose prototype based, object oriented scripting language
developed jointly by sun and Netscape and is meant for the WWW . it is designed to be
embedded in diverse applications and systems, without consuming much memory . java
script borrows most of its syntax from java but also inherits from AWK and PERL, with
some indirect influence from self in its object prototype system.
Java scripts dynamically typed that is programs do not declare variable types, and the type
of variable is unrestricted and can change at runtime. source can be generated at run time
and evaluated against an arbitrary scope. Typical implementations compile by translating
source into a specified byte code format, to check syntax and source consistency. Note that
the availability to generate and interpret programs at runtime implies the presence of a
compiler at runtime.
Java script is a high-level scripting language that does not depend on or expose machine
representations or operating system services. It provides automatic storage management,
typically using a garbage collector.

Features:

• Java script is embedded into HTML documents and is executed with in them.
• Java script is browser dependent
• Java script is an interpreted language that can be interpreted by the browser at run time.
• Java script is loosely typed language
• Java script is an object based language.
• Java script is an Event-Driven language and supports event handlers
tospecify the functionality of a button.

Advantages

• Java script can be used for client side application


• Java script provides means to contain multi frame windows forpresentation of the web.
• It creates interactive forms and client side lookup tables .
• Java script provides basic data validation before it is sent to the server. EG : login and
password checking or whether the values entered are correct or whether all fields in a
from are filled and reduced network traffic .

32
6.3 Introduction to Servlets:

Servlets provide a Java (TM)-based solution used to address the problems currently associated
with doing server-side programming, including inextensible scripting solutions, platform-
specific APIs, and incomplete interfaces. Servlets are objects that conform to a specific
interface that can be plugged into a Java-based server. Servlets are to the server-side what
applets are to the client-side -- object byte codes that can be dynamically loaded off the net.
They differ from applets in that they are faceless objects (without graphics or a GUI
component). They serve as platform-independent, dynamically-loadable, pluggable helper
byte code objects on the server side that can be used to dynamically extend server-side
functionality.

What are Servlets?

Servlets are modules that extend request/response-oriented servers, such as Java-enabled web
servers. For example, a SERVLET might be responsible for taking data in an HTML order-
entry form and applying the business logic used to update a company's order database servlets
are to servers what applets are to browsers. Unlike applets, however, servlets have no graphical
user interface. Servlets can be embedded in many different servers because the servlet API,
which you use to write servlets, assumes nothing about the server's environment or protocol.
Servlets have become most widely used within HTTP servers; many web servers support the
Servlet API.

Use Servlets instead of CGI Scripts!

SERVLETS are an effective replacement for CGI scripts. They provide a way to generate
dynamic documents that is both easier to write and faster to run. Servlets also address the
problem of doing server-side programming with platform-specific APIs: they are developed
with the Java Servlet API, a standard Java extension.
So use SERVLETS to handle HTTP client requests. For example, have servlets process data
posted over HTTPS using an HTML form, including purchase order or credit card data. A
servlet like this could be part of an order-entry and processing system, working with product
and inventory databases, and perhaps an on-line paymentsystem.

33
Other Uses for Servlets

Here are a few more of the many applications for servlets:

• Allowing collaboration between people. A servlet can handle multiple requests


concurrently, and can synchronize requests. This allows servlets to support systems
such as on-line conferencing.

• Forwarding requests. Servlets can forward requests to other servers and servlets. Thus,
servlets can be used to balance load among several servers that mirror the same content,
and to partition a single logical service over several servers, according to task type or
organizational boundaries.

Architecture of the Servlet Package

The javax.servlet package provides interfaces and classes for writing servlets. The
architecture of the package is described below.

The Servlet Interface

The central abstraction in the Servlet API is the Servlet interface. All servlets
implement this interface, either directly or, more commonly, by extending a class that
implements it such as HTTPSERVLET.
The Servlet interface declares, but does not implement, methods that manage the servlet
and its communications with clients. Servlet writers provide some or all of these methods
when developing a servlet.

Client Interaction

When a servlet accepts a call from a client, it receives two objects:

• A SERVLETREQUEST, which encapsulates the communication from the client to the server.
• A SERVLETRESPONSE, which encapsulates the communication from the servlet
backto the client.

34
The Servlet Request Interface

The SERVLETREQUEST interface allows the servlet access to:

• Information such as the names of the parameters passed in by the client, the protocol
(scheme) being used by the client, and the names of the remote host that made the
request and the server that received it.

• The input stream, SERVLETINPUTSTREAM. SERVLETS use the input stream to get data
from clients that use application protocols such as the HTTP POST and PUT methods.
• Interfaces that extend SERVLETREQUEST interface allow the servlet to retrieve more
protocol- specific data. For example, the HTTPSERVLETREQUEST interface contains
methods for accessing HTTP-specific header information.

The Servlet Response Interface

The SERVLETRESPONSE interface gives the servlet methods for replying to the client.

• It Allows the servlet to set the content length and MIME type of the reply.
• Provides an output stream, SERVLETOUTPUTSTREAM, and a Writer through
which the servlet can send the reply data.

• Interfaces that extend the SERVLETRESPONSE interface give the servlet more protocol-
specific capabilities. For example, the HTTPSERVLETRESPONSE interface contains
methods that allow the servlet to manipulate HTTP-specific header information.

35
Additional Capabilities of HTTP Servlets

The classes and interfaces described above make up a basic Servlet. HTTP servlets have
some additional objects that provide session-tracking capabilities. The servlet writer can
use these APIs to maintain state between the servlet and the client that persists across
multiple connections during some time period. HTTP servlets also have objects that
provide cookies. The servlet writer uses the cookie API to save data with the client and to
retrieve this data.

The classes mentioned in the Architecture of the Servlet Package section are shownin the
example in bold:

• SIMPLESERVLET extends the HTTPSERVLET class, which implements the Servlet


interface.

• Simple SERVLET overrides the do Get method in the HTTPSERVLET class. The do Get
method is called when a client makes a GET request (the default HTTP request method),
and results in the simple HTML page being returned to theclient.
• Within the do Get method, The user's request is represented by an HTTPSERVLETREQUEST
object.
• The response to the user is represented by an HTTPSERVLETRESPONSE object.
• Because text data is returned to the client, the reply is sent using the Writer object obtained
from the
HTTPSERVLETRESPONSE object.

Servlets Lifecycle

Each servlet has the same life cycle:

• A server loads and initializes the servlet


• The SERVLET handles zero or more client requests
• The server removes the servlet

36
Initializing a Servlet

When a server loads a servlet, the server runs the servlet's init method. Initialization
completes before client requests are handled and before the servlet is destroyed.

Even though most servlets are run in multi-threaded servers, servlets have no concurrency
issues during servlet initialization. The server calls the init method once, when the server
loads the servlet, and will not call the init method again unless theserver is reloading
the servlet.
The server can not reload a servlet until after the server has destroyed the SERVLET by
calling the
destroy method.

The init Method

• The in its method provided by the HTTP servlet class initializes the servlet
andlogs the initialization. To do initialization specific to your servlet, override the in it
() method following these rules:

• If an initialization error occurs that renders the servlet incapable of handling clientrequests,
throw an Unavailable exception.

• An example of this type of error is the inability to establish a required network


connection.

• Do not call the system. Exit method

37
Initialization Parameters

• The second version of the init method calls the GETINITPARAMETER method. This method
takes the parameter name as an argument and returns a String representation of the
parameter's value.
• The specification of initialization parameters is server-specific. In the Java Web Server, the
parameters are specified with a servlet is added then configured in the Administration Tool.
For an explanation of the Administration screen where this setup is performed, see the
Administration Tool: Adding Servlets online help document. If, for some reason, you need
to get the parameter names, use the getparameternames method.

Destroying a Servlet

Servlets run until the server are destroys them, for example at the request of a system
administrator. When a server destroys a servlet, the server runs the servlet's destroy
method. The method is run once; the server will not run that servlet again untilafter the
server reloads and reinitializes the servlet.
When the destroy method runs, another thread might be running a service request. The
Handling Service Threads at Servlet Termination section shows you howto provide a clean
shutdown when there could be long-running threads still running servicerequests.

38
CSS

The Cascading Style Sheets is a simply designed language intended to simplify the
process of making web pages presentable. CSS allows you to apply styles to HTML
documents. It describes how a webpage should look. It prescribes colors, fonts, spacing,
etc. In short, you can make your website look however you want.

CSS lets developers and designers define how it behaves, including how elements are
positioned in the browser.
HTML uses tags and CSS uses rulesets. CSS styles are applied to the HTML element
using selectors. CSS is easy to learn and understand, but it provides powerful control
over the presentation of an HTML document.

39
Handling Service Threads at Servlet Termination

All of a SERVLET'S service methods should be complete when a servlet is removed. The
server tries to ensure this by calling the destroy method only after all service requests
have returned, or after a server-specific grace period, whichever comes first. If your servlet
has operations that take a long time to run (that is, operationsthat may run longer than the
server's grace period), the operations could still be running when destroy is called. You
must make sure that any threads still handling client requests complete; the remainder of
this section describes a technique for doing this.
If your servlet has potentially long-running service requests, use the following
techniques to:

• Keep track of how many threads are currently running the service method.
• Provide a clean shutdown by having the destroy method notify long-
runningthreads of the shutdown and wait for them to complete
• Have the long-running methods poll periodically to check for shutdown and, if
necessary, stop working, clean up and return.

Tracking Service Requests


To track service requests, include a field in your servlet class that counts the number of
service methods that are running. The field should have access methods to increment,
decrement, and return its value.
The service method should increment the service counter each time the method is
entered and decrement the counter each time the method returns. This is one of the few
times that your httpservlet subclass should override the service method. The new
method should call super.service to preserve all the original
httpservlet.service method's functionality.

Providing a Clean Shutdown

To provide a clean shutdown, your destroy method should not destroy anyshared resources
until all the service requests have completed. One part of doing this isto check the service
counter. Another part is to notify the long-running methods that it is time to shut down. For
this, another field is required along with the usual access methods.

40
Servlet-client Interaction Handling HTTP Clients

An HTTP Servlet handles client requests through its service method. The service
method supports standard HTTP client requests by dispatching each request toa method
designed to handle that request. For example, the service method calls the do Get method
shown earlier in the simple example servlet.

Requests and Responses

Methods in the HTTPSERVLET class that handle client requests take two arguments:

• An HTTPSERVLETREQUEST object, which encapsulates the data from the client


• An HTTPSERVLETRESPONSE object, which encapsulates the response to the client

HTTP Servlet Request Objects

An HTTPSERVLETREQUEST object provides access to HTTP header data, such as any cookies
found in the request and the HTTP method with which the request was made. The
HTTPSERVLETREQUEST object also allows you to obtain the arguments that the client sent as
part of the request.

To access client data:


he GETPARAMETER method returns the value of a named parameter. If your parameter
could have more than one value, use GETPARAMETERVALUES instead.

• The GETPARAMETERVALUES method returns an array of values for the named


parameter. (The method GETPARAMETERNAMES provides the names of the parameters.)
• For HTTP GET requests, the GETQUERYSTRING method returns a String of raw data
from the client. You must parse this data yourself to obtain the parameters and values.
• For HTTP POST, PUT, and DELETE requests,
• If you expect text data, the GETREADER method returns a BUFFEREDREADERfor you to use
to read the raw data.

• If you expect binary data, the GETINPUTSTREAM method returns a SERVLETINPUTSTREAM


for you to use to read the raw data

41
About Node.js

• Node.js is an open-source server environment


• Node.js is free
• Node.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
• Node.js uses JavaScript on the server

It is groundbreaking server-side platform introduced by Ryan Dahl in 2009, has undergone


continuous evolution, with its latest version, v0.10.36, showcasing advancements in
performance and functionality. The essence of Node.js, as articulated in its official
documentation, revolves around harnessing Chrome's JavaScript runtime to empower
developers in building high-performance and scalable network applications with ease.

Handling GET and POST Requests

The methods to which the service method delegates HTTP requests include,

• DOGET, for handling GET, conditional GET, and HEAD requests

• DOPOST, for handling POST requests

• DOPUT, for handling PUT requests

• DODELETE, for handling DELETE requests

42
Servlet Descriptions

In addition to handling HTTP client requests, some applications, such as theJava Web
Server's Administration Tool, get descriptive information from the servlet and display it.
The servlet description is a string that can describe the purpose of the servlet,its author, its
version number, or whatever the servlet author deems important.
The method that returns this information is GETSERVLETINFO, which returns nullby default.
You are not required to override this method, but applications are unable to supply a
description of your servlet unless you do.

Writing Your First Servlet

Servlets are also easy to develop. This document discusses the following minimumsteps
needed to create any servlet:

1. Write the servlet


a. Import the necessary Java packages
b. Inherit from GENERICSERVLET or the HTTP convenience class HTTPSERVLET
c. Override the service method (this is where the actual work is done by the servlet)
d. Save the file with a .java filename extension
2. Compile the servlet
a. Make sure jws.jar is included in your class path
b. Invoke javac
3. Install the servlet
a. Use the Java Web Server's Administration Tool to install it, and optionally configure it.
4. Test the servlet
a. Invoke the servlet from a JDK1.1-compatible browser.

43
About Session Tracking
Session T tracking is a flexible, lightweight mechanism that enables STATEFUL
programming on the web. Its general implementation serves as a basis for more
sophisticated state models, such as persistent user profiles or multi-user sessions.

A session is a series of requests from the same user that occur during a time period. This
transaction model for sessions has many benefits over the single-hit model.It can maintain
state and user identity across multiple page requests. It can alsoconstruct a complex
overview of user behavior that goes beyond reporting of user hits.

Server-Side Session Objects and Users

Session tracking gives servlets and other server-side applications the ability to keep state
information about a user as the user moves through the site. Server-side applications
can use this facility to create more STATEFUL user experiences and totrack who's doing
what on the site.
Java Web Server maintains user state by creating a Session object for each useron the site.
These Session objects are stored and maintained on the server. When a user first makes a
request to a site, the user is assigned a new Session object and a unique session ID.

Session Endurance

After the user has been idle for more than a certain period of time (30 minutes bydefault),
the user's session becomes invalid, and the corresponding Session object is destroyed.

A session is a set of requests originating from the same browser, going to the same server,
bounded by a period of time. Loosely speaking, a session corresponds toa single sitting of
a single anonymous user (anonymous because no explicit login or authentication is required
to participate in session tracking).

The first part of the DOGET method associates the Session object with the user making the
request. The second part of the method gets an integer data value from the Session object
and increments it. The third part outputs the page, including the current value of the counter.

44
When run, this servlet should output the value of the counter that increments every time you
reload the page. You must obtain the Session object before you actually write any data to
the SERVLET'S output stream. This guarantees that the session tracking headers are sent
with the response.

Any name, such as sessiontest.counter, may be used to identify values in the


Session object. When choosing names, remember that the Session object is shared among
any servlets that the user might access. Servlets may access or overwrite each other's values
from the Session.
Thus, it is good practice to adopt a convention for organizing the namespace to avoid
collisions between servlets, such as: servletname.name.

Session Invalidation
Sessions can be invalidated automatically or manually. Session objects that haveno page
requests for a period of time (30 minutes by default) are automatically invalidated by the
Session Tracker SESSIONINVALIDATIONTIME parameter. When a session is invalidated, the
Session object and its contained data values are removed from the system.

After invalidation, if the user attempts another request, the Session Trackerdetects that the
user's session was invalidated and creates a new Session object. However, data from the
user's previous session will be lost.

Session objects can be invalidated manually by calling session.invalidate(). This will


cause the session to be invalidated immediately, removing it and its datavalues from
the system.

45
About React

The React is a powerful JavaScript library for building dynamic and interactive user
interfaces (UIs). It is developed by Facebook. React is known for its component-based
architecture which allows you to create reusable UI elements, making complex web
applications easier to manage and maintain. React is used to build single-page
applications.

React operates by creating an in-memory virtual DOM rather than directly manipulating
the browser’s DOM. It performs necessary manipulations within this virtual
representation before applying changes to the actual browser DOM. React is efficient,
altering only what requires modification.

One-way data binding, the name itself says that it is a one-direction flow. The data in
react flows only in one direction i.e. the data is transferred from top to bottom i.e. from
parent components to child components. The properties(props) in the child component
cannot return the data to its parent component but it can have communication with the
parent components to modify the states according to the provided inputs.

46
Multiple Servlets

URL conversions are required only if the servlet supports session tracking for browsers that
do not support cookies or browsers that reject cookies. The consequences of not doing these
conversions is that the user's session will be lost if the user's browser does not support
cookies and the user clicks on an un-rewritten URL. Note that this can have consequences
for other servlets. If one servlet does notfollow these conventions, then a user's session could
potentially be lost for all servlets.

Using Session Tracking with the Page Compiler

Page compilation is a feature of the Java Web Server that allows HTML pages containing
Java code to be compiled and run as servlets. Page compilation also simplifies the task of
supporting session tracking. To that end, if URL rewriting is enabled, page compilation
automatically adds the encoder call to links in the HTML page.

47
Additional APIs
In addition to the Session object, there are a few more classes that may interest theservlet
developer.

Description Class

The httpsessioncontext is the


object that contains all existing and
valid sessions. The http session
contextcan be obtained by calling get
Httpsessio
ncontext Session Context () on the Session
object. The Http Session Context
lets youfind other Session objects by
their IDs and list the IDs ofall valid
sessions.
HttpSessionBindingListener is an
interface that can be implemented by
objects placed into a Session. When the
Session object is invalidated, its
contained values are also removed from
the system. Some of these values may
be active objects that require cleanup
HttpSessio
nBindingLi operations when their session is
stener
invalidated. If a value in a Session
object implements
HttpSessionBindingListener, then

thevalue is notified when the Session is


invalidated, thereby giving the object a
chance to perform any necessary
cleanup operations.

48
Session Swapping and Persistence
An Internet site must be prepared to support many valid sessions. A large site,for
example, might have hundreds, or even thousands, of simultaneously valid sessions.

Because each session can contain arbitrary data objects placed there by the
applicationservlets, the memory requirements for the entire system can grow prohibitively
large.

To alleviate some of these problems, the session tracking system places a limit on the
number of Session objects that can exist in memory. This limit is set in the
session.maxresidents property. When the number of simultaneous sessions
exceeds this number, the Session Tracker swaps the least recently-used sessions out to files
on disk. Those sessions are not lost: they will be reloaded into memory if further requests
come in for those sessions. This system allows for more sessions to remain valid than could
exist in memory

49
Session invalidation is not affected by session swapping. If a session goesunused for longer
than the normal invalidation time, the session is invalidated, whetherit is in memory or on
disk. Session invalidation is set in the session.invalidationinterval property.

Sessions are written to and read from disk using Java serialization. For this reason, only
serializable objects put into the Session object will be written to disk. Any objects put into
the Session object that are not serializable will remain in memory, evenif the rest of the
Session object has been written to disk. This does not affect session tracking, but does
reduce the memory savings that the Session Tracker gets from swapping a session to disk.
For this reason, the servlet developer should try to put only serializable objects into the
Session object. Serializable objects are those that implement either
java.io.Serializable or java.io.Externalizable.

The session-swapping mechanism is also used to implement session persistence, if the


session persistence feature is enabled. When the server is shut down, sessions still in
memory are written to the disk as specified in thesession.swapdirectory property.
When the server starts again, sessions that were written to disk will once again become
valid. This allows the server to be restarted without losing existing sessions. Only
serializable data elements in the session will survive this shutdown/restart operation.

Customizing Session Tracking

Session-tracking interfaces are in the javax. servlet. HTTP package.

Properties
You can customize properties in the Session Tracker. The properties are kept in the
server. properties
files
at:<server_root>/properties/server/javawebserver/server.properties where <server
root> is the directory into which you installed the Java Web Server product.

Note: These property settings are applied to all sessions, and cannot be tuned for individual
sessions.

50
Parameter Description Defa
ult
session. invalidation Time interval when Java 10000
interval
Web Server checks for (10 seconds)
sessions that have gone
unused long enough tobe
invalidated. Value is an
integer,specifying the
interval in milliseconds.
session. swapinterval Time interval when Java 10000
Web Server checks if too (10 seconds)
many sessionsare in
memory, causing the
overflow of sessions to be
swappedto disk. Value is an
integer, specifying the
interval in milliseconds.
session. Persistence Boolean value specifying true

if Java Web Server keeps


session data persistent. If
true, sessions are
swapped to disk when
Java Web Server shuts
down and are revalidated
from disk when it
restarts. If false, Java
Web Server removes
session swap files every

51
time it starts.
session.swapdirectory Name of directory that the Java Web sessionSwap

Server uses to swap out session data.


No other data shouldbe kept in this
directory.
session.maxresidents Number of sessions allowed to remain 1024
in memory at once. If the number of
sessions exceeds this number, sessions
will be swappedout to disk on a least
recently usedbasis to reduce the
number of resident sessions.

session.invalidationtim Amount of time a session is allowed to 1800000


e
go unused before it is invalidated.Value (30 minutes)
is specified in milliseconds.
enable.sessions Boolean value specifying whether true

Session Tracking is active. If false,


then the Java Web Server performsno
function for extracting or inserting
session IDs into requests.
enable.cookies Boolean value indicating whether Java true
Web Server uses cookies as avehicle for
carrying session ID. If true, session
IDs arriving as cookies are recognized
and the Java Web Server tries to use
cookies as a means for sending the
session ID.

52
enable.urlrewriting Boolean value indicating whether Java false
Web Server uses rewritten URLs as a
vehicle to carry the session ID. If true,
then session IDsarriving in the URL are
recognized,
and the Java Web Server rewrites
URLs if necessary to send the
session ID.
enable.protocolswitchrew Boolean value indicating whether the false
riting
session ID is added to URLs when the
URL dictates a switch from "http" to
"https" or vice-versa.
session.cookie.name Name of the cookie used to carry the jwssessionid

session ID, if cookies are in use.


session.cookie.comment Comment of the cookie used to carry Java Web
Server Session
the session ID, if cookies arein use.
Tracking
Cookie

session.cookie.domain If present, this defines the value ofthe null

domain field that is sent for session


cookies.
session.cookie.maxage If present, this defines the value ofthe -1
maximum age of the cookie.
session.cookie.path If present, this defines the value ofthe "/"
path field that will be sent for
session cookies.
session.cookie.secure If true, then session cookies will false

include the secure field.

53
Introduction to MongoDB

MongoDB, the most popular NoSQL database, is an open-source document-oriented


database. The term ‘NoSQL’ means ‘non-relational’. It means that MongoDB isn’t based
on the table-like relational database structure but provides an altogether different
mechanism for storage and retrieval of data. This format of storage is called BSON (like
JSON format). SQL databases store data in tabular format. This data is stored in a
predefined data model which is not very much flexible for today’s real-world highly
growing applications. Modern applications are more networked, social and
interactive than ever. Applications are storing more and more data and are accessing it
at higher rates.

Relational Database Management System (RDBMS) is not the correct choice when it
comes to handling big data by the virtue of their design since they are not
horizontally scalable. If the database runs on a single server, then it will reach a scaling
limit. NoSQL databases are more scalable and provide superior performance. MongoDB
is such a NoSQL database that scales by adding more and more servers and increases
productivity with its flexible document model.

54
Chapter 5: Implementation and Testing

Testing plays a critical role for quality assurance and for ensuring the reliability of the
software. Its basic function is to detect the errors. After the coding phase, testing is done to
test the proper working of the new system. Testing is the process of executing a program
with the intention of finding errors. It is a complete verification to determine whether the
objectives are met and the user requirements are satisfied. The testing phase involves testing
of a system using various test data.
Preparation of the test data plays a vital role in the system testing. After preparing the
test data, the system under study is testing using those test data. Errors were found and
corrected by using the following testing steps and corrections are recorded for future
references. Thus, a series of testing is performed on the system before it is ready for coding.
Since code is the only product that can be executed frequently whose actual behavior can
be observed, this phase is so important for the successful implementation of the software
product. Thus, the goal of testing is to uncover the requirements, design and coding errors
in the program.

Unit Testing

The first step in the testing is the unit testing. Unit test is normally considered as an adjunct
to the coding step. After the coding has been developed, received and verified for correct
syntax, unit testing begins. The standalone modules were tested individually for their correct
functionality, with the corresponding data. This ensures the reliability of the modules when
integrated. Each module is tested independently with sample data and it was found that all
modules are properly functioning. Using the unit test plans, prepared in the design phase of
the system as a guide, important control paths are tested to uncover errors within the
boundary of the modules. Boundary conditions were checked, all independent paths were
exercised to ensure that all statements in the module are checked at least once and all error
handling paths were tested. Each unit was thoroughly tested to check if it might fall in any
possible situation. This testing was carried out during the programming itself. At the end of
this testing phase, each unit was found to be working satisfactory, as regard to the expected
output from the module.

55
Integration Testing

The second step in the testing process is the Integration testing. Integration testing is the
systematic technique for constructing the program structure while conducting tests to
uncover errors associated with interfacing. All the modules when unit testing will work
properly but after interfacing the data can be lost across an interface, one module can have
an inadvertent, adverse effect on other, sub functions when combined may not produce the
desired major function, global data structures can cause problems, etc.
Integration testing was performed by integrating all the individual modules and the activities
of the user such as loading layers, retrieving information from any functions applying
themes based on the records present in the database etc. and is found that it works good to
the examination of the end users. Hence, the objective of integration testing is to take unit
tested modules and build a final program structure.
All the modules developed are independent. Even the whole process of approval for all.
Each module is integrated well with other modules. And all the interfaces are tested
successfully.

Functional Testing

This test involves testing the system under typical operating conditions with sample input
values. Functional testing was performed on the system by giving existing industryid or
plot number and a null or string as the input for any field in which case the user should
be redirected to the same state with the appropriate message, rather thanproceeding and
crashing in the system.
Functional testing was performed on the system by raising the demand with an eye to
check all the validations. The total processing of the system is satisfactory with the
following results.

• All the validations are clearly notified to the user regarding jobseekers reg, newclient reg,
job order, job providers, and job search preparation etc.

• Almost all the functional errors, data storage errors and all types of logical errorsare tested
successfully.

56
Implementation
Implementation includes all those activities that take place to convert the old system to the
new system. The new system will replace the existing system. The aspects of
implementation are as follows. Conversion, Post Implementation Review.

Conversion
Conversion means changing from one system to another. The objective is to put the tested
system into operation. It involves proper installation of the software package developed and
training the operating staff.

The software has been installed and found to be functioning properly. The users how to be
trained to handle the system effectively. Sample data provide to the operatingstuff and were
asked to operate on the system. The operating stuffs now have a clear out look of the
software and are ready for practical implementation of the package.

Post Implementation Review


A post implantation review is an evaluation of system in terms of the extent to which the
system accomplishes the stated objectives. This starts after the system is implemented and
conversation is complete.

57
1.1 User Interface and snapshots
Home Page

Figure 5.1- Home page (Login)

Figure 5.2- Home page (Sign up)

58
Chat Interface

Figure 5.3- Chat Interface

Search Users

Figure 5.4- Search Users

59
Create Group Chat

Figure 5.5- Create Group Chat

60
Manage Group Settings

Figure 5.6- Manage Group Setting

61
TEST CASES

Features to be tested

62
Chapter 6: Conclusion and Future Scope

The Real Chat project represents a comprehensive and feature-rich real-time chat
application developed using the MERN (MongoDB, Express.js, React.js, Node.js) stack.
Throughout the development process, the project has successfully achieved its objectives
of providing a seamless communication experience, mastering the MERN stack,
prioritizing security and privacy, ensuring scalability and performance, facilitating
customization and extension, serving as an educational resource, and delivering a valuable
solution for real-time communication needs.

By implementing modular components and detailed functionalities, Real Chat offers users
a wide range of features including user authentication, real-time messaging, group chat
management, multimedia support, search and navigation, notifications, profile
management, security features, scalability and performance optimization, documentation,
and user support. These functionalities cater to both personal and professional use cases,
enabling efficient communication, collaboration, and engagement across various domains.
Through the development of Real Chat, valuable insights and lessons have been gained in
building real-time web applications, leveraging the capabilities of the MERN stack,
implementing secure and scalable solutions, and meeting the needs of users in today's
interconnected world. The project has demonstrated the importance of real-time chat
applications in fostering communication, collaboration, and connectivity, while also
highlighting the significance of prioritizing user privacy, security, and user experience.

As the project concludes, Real Chat stands as a testament to the capabilities of modern
web technologies and the potential for innovation in real-time communication. Whether
used for personal connections, team collaboration, customer engagement, or community
building, Real Chat serves as a versatile and valuable tool for facilitating meaningful
interactions and fostering connections in an increasingly digital world.

63
Future Work

While the RealChat project has achieved its primary objectives and delivered a robust real-
time chat application, there are several avenues for future work and enhancements to
further improve the application's functionality, scalability, and user experience. Some
potential areas for future work include:

1. Voice and Video Calling: Integrate voice and video calling features to enable real-time
audio and video communication between users or within group chats, enhancing the
application's capabilities for remote collaboration and interaction.
2. Chatbot Integration: Implement chatbots to provide automated assistance, answer
frequently asked questions, perform tasks, and enhance user engagement through natural
language processing and machine learning algorithms.
3. Advanced Search and Filtering: Enhance the search and filtering functionalities to
support more advanced queries, including keyword-based search, filtering by message
attributes, and advanced search operators for more precise results.
4. Cross-Platform Support: Extend the application to support additional platforms such as
desktop applications, mobile apps (iOS and Android), or integration with messaging
platforms like Slack or Microsoft Teams, providing users with seamless access across
different devices and environments.
5. Analytics and Insights: Implement analytics and reporting features to provide users with
insights into chat usage, message trends, user engagement metrics, and other actionable
data to inform decision-making and improve user experience.

64
References

1. Full Stack React Projects" by Shama Hoque: This book provides practical
guidance and tutorials on building full-stack web applications using the
MERN stack, including real-time chat applications. It covers topics such as
user authentication, data management, and deployment strategies.
2. "Pro MERN Stack: Full Stack Web App Development with Mongo,
Express, React, and Node" by Vasan Subramanian: This comprehensive
guide covers the fundamentals of building full-stack web applications with
the MERN stack, including in-depth tutorials, best practices, and advanced
topics such as real-time communication and authentication.
3. "Node.js Design Patterns" by Mario Casciaro: This book explores design
patterns and best practices for building scalable and maintainable Node.js
applications, which can be beneficial for developing the backend logic of
the Real Chat application.
4. "React Design Patterns and Best Practices" by Carlos Santana Roldán:
This resource delves into design patterns and best practices specific to
React.js development, covering topics such as state management,
component composition, and performance optimization, which are essential
for building the frontend of the Real Chat application.
5. MDN Web Docs: The Mozilla Developer Network (MDN) provides
comprehensive documentation, tutorials, and guides on web development
technologies such as JavaScript, HTML, CSS, and web APIs. It serves as a
valuable reference for learning about frontend development and web
standards.
6. MongoDB Documentation: The official MongoDB documentation offers
extensive resources, tutorials, and examples for working with MongoDB,
including data modeling, query optimization, and deployment strategies. It
is a valuable reference for understanding database management in the Real
Chat project.

65

You might also like