Project Report
Project Report
Project Report
On
ChatApp
Bachelor of Technology
In
Session 2024-2025
CANDIDATE’S DECLARATION
I hereby certify that theworkwhichisbeingpresentedinthisProjectentitled
“ChatApp”inpartialfulfilmentoftherequirementfortheawardofdegreeofB.Tech
ComputerScienceandEngineeringsubmittedinDepartmentofComputerScience&
Engineering at Guru Nanak Institute of Technology, Mullana, Ambala affiliated to
Kurukshetra University, Kurukshetra is an authentic record of my work carried out
under the supervision of Mr. Sachin Sharma, Assistant professor, Department of
CSE, GNIT, Mullana, Ambala.
ThematterpresentedherehasnotbeensubmittedbymetoanyotherUniversity
/ Institute for the award of any otherdegree.
Tanish Garg
2021216814
Thisistocertifythattheabovestatementmadebythecandidateiscorrecttothebest
of my knowledge.
i
ACKNOWLEDGEMENT
IwishtoexpressmysincereregardsandgratitudetoMr.SachinSharma(Assistant
professor),intheDepartmentofComputerScienceandEngineeringforhisguidance,
moral boosting, continuous encouragement, and appreciation, which are the vital
factors in the successful completion of my major project work.
I sincerely extend my thanks to Ms. Geetika Konshal Head, the Department of
Computer Science & Engineering for his administrative support and guidance.
My sincere thanks to all the faculty members and technical staff of the Computer
Science&EngineeringDepartmentforprovidingpleasantworkingconditionsforthe
complete duration of the major project.
TheseAcknowledgementsshallremaininconclusivewithoutthankingmyclassmates
who helped provide a calm and congenial atmosphere without which my project
would not have seen light of the day.
Tanish Garg
ii
LIST OF FIGURES
iii
CONTENTS
Particulars Page No.
Acknowledgement ii
Abstract vi
1.1Overview 1
5.1Screenshots 9-11
iv
Chapter 6: Conclusion and Future Scope 12
6.1Conclusion 12
References 13
Annexure(Code) 14-33
v
ABSTRACT
Theadventofdigitalcommunicationhasrevolutionisedthewayweinteractwitheach
other, fostering connections across vast distances. The demand for efficient and
user-friendly communication platforms has surged in recent years, driving the
development of innovative solutions. This project presents ChatApp, a web-based
application designed to provide a seamless and engaging real-time communication
experience.
ChatAppisbuiltwithamoderntechstack(React,Express,Node,Tailwind,Socket.io,
Mongoose). ChatApp delivers a smooth and responsive user interface for real-time
communication. The application leverages MongoDB for scalable data storage and
Socket.io for instant message delivery, ensuringaseamlessandengagingexperience
for users.
ChatApprepresentsasignificantadvancementinthefieldofreal-timecommunication
platforms. By combining cutting-edge technologiesandauser-focusedapproach,the
applicationdeliversapowerfulandengagingsolutionthatmeetstheevolvingneedsof
modern users.
vi
CHAPTER: 1
INTRODUCTION
1.1Overview:
The demand for efficient and user-friendly communication platforms has surged in
recent years, driving the development of innovative solutions. This project presents
ChatApp, a web-based application designed to provide a seamless and engaging
real-time communication experience.
Leveraging a robust technological stack, ChatApp offers a comprehensive suite of
featuresthatcatertothediverseneedsofmodernusers.Theapplication'sfrontendis
built on ReactJS. This foundation enables a dynamic and interactive user interface,
ensuring a smooth and intuitive experience.
On the backend, Express.js, a Node.js web framework, serves asthefoundationfor
handling server-side logic and API endpoints. Express's modular and flexible
architecture facilitates the efficient management of HTTP requests and responses,
ensuring optimal performance and scalability.
To store chat data and enable real-time communication, MongoDB, a NoSQL
database,isutilised.MongoDB'sdocument-orientedstructureprovidesaflexibleand
scalable solution for storing and retrieving chat messages efficiently.
ChatApp offers a range of features designed to enhance user interaction and
communication.Userscancreateaccounts,login,andengageinreal-timetext-based
conversations.
Asthedigitallandscapecontinuestoevolve,ChatAppispoisedtoplayavitalrolein
fostering connections and facilitating meaningful interactions.
1
1.2Scope of the project:
● One-to-one messaging: Users can send and receiveprivatemessagestoand
from other users. Users can send emoji along with text.
● Real-time communication: Messages are delivered instantly, providing a
seamless and interactive experience.
● Securepasswordauthentication:Userscancreateaccountsandloginusing
secure passwords to protect their data.
● File sharing:Users can send and receive files, suchas images and video clips.
● Emoji:Users can send emoji along with text.
● Userprofiles:Userscancreateprofileswithbasicinformation,suchasname
and profile picture.
● User Blocking: It provides the feature to block aspecificpersonsothatthe
user can feel safe.
● Message history: Users can view previous messages to find specific
conversations.
● Extensive mobile app development: The focus will be on developing a
web-based chat application, with potential mobile app development
considered in future iterations.
2
CHAPTER: 2
FEASIBILITY STUDY
2.1Introduction to feasibility study:
Afeasibilitystudyisaprocessofanalysingandidentifyingifaproblemcanbesolved
or not solved, focusing on helping answer the essential question of “Should we
continue the proposed project ideas?” All activities ofthestudyaredirectedtoward
helpinganswerthisquestion.Afeasibilitystudyisgenericandcanbeappliedtoany
typeofproject,beitforsystemsandsoftwaredevelopment,makinganacquisition,or
anyotherproject.Afeasibilitystudyisatestofasystemaccordingtoitsworkability
to meet user needs and effective use of the resources. We can test our system by
differenttypesoffeasibility.Thisstudyhassixpartstoconductaneffectivefeasibility
study:
1. The Project Scope: This is used to define the business problem and/or
opportunity to be addressed. The adage,” The problem well stated is half
solved.” is very apropos. The scope should be definitive and to the point
rambling narrative serves no purpose and can confuse project participants.
2. The current analysis: This is used to define and understand the current
methodofimplementation,suchasasystem,aproject,etc.Fromthisanalysis,
it is not uncommon to discover there is actually nothing wrong with the
current system or product other than somemisunderstandingsregardingitor
perhaps it needs some simple modification as opposed to a major overhaul.
3. Requirements: How requirements are defined depends on the object of the
project’sattention.Forexample,howrequirementsarespecifiedforaproduct
is substantially different than requirements for an edifice, a bridge, or an
informational system.
4. The approach: Represents the recommended solution orcourseofactionto
3
2.2Technical Feasibility:
Based on the proposed featuresandtechnologies,theChatAppprojectistechnically
feasible.FrontendDevelopment(ReactJs&Tailwind),BackendDevelopment(Node&
Express), Real-Time Communication(Socket.io), Security(Salt & Hashing),
Database(MongoDB). By addressing potential challenges and following best
practices, the project can be successfully implemented to provide a reliable and
scalable real-time communication platform.
2.3Economical feasibility:
The economic viability of ChatApp hinges on a careful analysis of its costs and
potentialrevenuestreams.Here'sabreakdownofkeyfactorsinfluencingitseconomic
feasibility:
2.4Operational feasibility:
● User Acceptance: Will users find the website easy to use and beneficial?
Conducting user surveys or usability tests can help assess this.
● Resource Availability: Does the project have access to the necessary
resources, such as hosting infrastructure, and development tools?
● Cost-Effectiveness: Is the project cost-effective in terms of development,
maintenance, and operation?
● Scalability: Is the projectscalabletoaccommodatepotentialgrowthinusers
and data volume?
2.5Existing System:
● Web-basedchatapplications:Existingweb-basedchatplatformsthatrequire
installation of browser extensions or plugins.
● Installation requirements: Many existing chat applications require users to
install software or browser extensions, which can be inconvenient for users
who prefer not to install additional applications.
4
● Lack of privacy features: Some existing systems may not have robust
privacyfeatures,suchastheabilitytodeleteentirechatsorpreventmessages
from being unsend.
2.6Proposed System:
● Web-based platform: A fully web-based platform thatdoesnotrequireany
installation.
● Privacy-focused features:
○ No message unsending:Messages can’t be unsend oncethey are sent.
○ Complete chat deletion: Users can delete entire chat histories from
the database.
○ Secure communication: Encryption and other security measures to
protect user data.
● User-friendly interface: A simple and intuitive interfacethatiseasytouse,
even for non-technical users.
● Computer:Anymoderncomputercapableofrunningacodeeditorandaweb
browser will suffice.
● Internet Connection: Required for fetching data from the Database and
posting to the website.
● RAM:A minimum of 4GB RAM is needed for a good userexperience.
Software Requirements:
● Frontend:
○ ReactJS:A JavaScript library for building user interfaces.
○ Tailwind CSS:A CSS framework for rapid UI development.
● Backend:
○ Node.js:A JavaScript runtime environment.
○ Express.js:A web framework for building Node.js applications.
○ Socket.io:A real-time communication library.
● Database:
○ MongoDB:A NoSQL document database.
5
CHAPTER: 3
PROBLEM FORMULATION AND REQUIREMENT
PHASE
3.1Problem Statement:
Many existing communication platforms require userstoinstallsoftwareorbrowser
extensions, which can be inconvenient and pose security risks. Additionally, these
platformsmaynotoffersufficientprivacyfeatures,suchastheabilitytodeleteentire
chat histories or prevent messages from being unsend.
TheprojectaimstoDevelopasecureandprivateweb-basedcommunicationplatform,
Provideuserswiththeabilitytodeleteentirechathistories,Implementstrongprivacy
features, Create a user-friendly interface.
Objectives:
● Secure and Private Communication: Ensure that all user data, including
messages and personal information, is protected from unauthorised access.
Provide a platform for one-to-one communication.
● Robust Encryption: Implement strong encryption algorithms, such as salt
and hashing, to protect user passwords and ensure data integrity.
● Real-Time Communication: Utilise Socket.io to enable instant message
delivery and create a dynamic and interactive user experience.
● Accessibility:Ensure that the ChatApp is accessibleto all users.
● Data Integrity and Confidentiality: Maintain the accuracy and privacy of
user data throughout transmission and storage.
● User Blocking: It provides the feature to block aspecificpersonsothatthe
user can feel safe.
● User Profile/Avatar: It provides a feature to add a profile pic or an avatar
using the name of the user.
● Emoji:Users can send emoji along with text.
● Security Best Practices: Stay updated with the latestsecuritybestpractices
and implement measures to safeguard user data against emerging threats.
6
● Scalability: Design the app architecture to be scalable, allowing for future
updates and integration of new features.
3.3Module Description:
1. Frontend Modules:
○ ReactJS: A well-established and widely used JavaScript library for
building user interfaces, providing a solid foundation for the frontend.
○ TailwindCSS:Autility-firstCSSframeworkthatoffersflexibilityand
efficiency in styling the application.
2. Backend Modules:
○ Node.js: A popular runtime environment for JavaScript, providing a
scalable and efficient backend.
○ Express.js: A versatile web framework that simplifies the
development of server-side logic.
○ MongoDB:ANoSQLdatabasesuitableforhandlingunstructureddata
like chat messages, offering flexibility and scalability.
3. Real-Time Communication Module:
○ Socket.io: A reliable and mature library for building real-time
applications, capable of handling the requirements of a chat
application.
4. Security Module:
○ Encryption: Using salt and hashing for password storage and
encryption of sensitive data ensures security.
○ Authentication: Implementing secure authentication mechanisms
protects user accounts and data.
7
CHAPTER: 4
SYSTEM DESIGN
4.1Data Flow Diagram:
8
CHAPTER: 5
RESULT AND DISCUSSIONS
5.1 Screenshots:
1) Login Page:
9
3) Home Page:
4) Conversation:
10
5) Updating Name & Profile_pic:
11
CHAPTER: 5
CONCLUSION AND FUTURE SCOPE
5.1Conclusion:
The ChatAppprojectsuccessfullyaddressesthegrowingneedforsecureandprivate
communicationplatformsthatprioritiseuserprivacyandconvenience.Byprovidinga
web-based application that does not requireanyinstallationandoffersfeaturessuch
as complete chat deletion and message unsending prevention, the ChatApp aims to
cater to the needs of users who value these aspects. The ChatApp project has the
potential to be a valuable addition to the landscape of communication platforms,
offering users a secure and convenient way to connect and communicate online.
5.2Future Scope:
1. Calling: Implement voice and video calling featuresfor chats.
2. File sharing: Expand file sharing capabilitiestoincludelargerfilesizesand
different file formats.
3. Integration with other platforms: Integrate with social media platforms,
calendars, or task management tools to enhance user experience.
4. AI-powered features: Explore incorporating AI features such as natural
language processing for intelligent chat suggestions or sentiment analysis.
5. Customizationoptions:Allowuserstocustomisetheirchatinterface,themes,
and notification settings.
6. Partnerships: Collaborate with other businesses or organisations to offer
complimentary services or cross-promote products.
12
REFERENCES
● https://react.dev/
● https://nodejs.org/en/
● https://www.mongodb.com/
● https://www.npmjs.com/
● https://www.youtube.com
● https://www.w3schools.com/
● https://tailwindcss.com/
13
ANNEXURE
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh
0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<title>Login</title>
</head>
<body>
<div id="root"></div>
</body>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcI
dslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</html>
14
App.js
import './App.css';
function App() {
return (
<>
<Toaster />
<main >
<Outlet />
</main>
</>
);
}
App.css
.scrollbar::-webkit-scrollbar {
width: 10px;
}
.scrollbar::-webkit-scrollbar-track {
@apply bg-slate-100
}
.scrollbar::-webkit-scrollbar-thumb {
}
15
App.test.js
render(<App />);
expect(linkElement).toBeInTheDocument();
});
index.js
import './index.css';
root.render(
<React.StrictMode>
<Provider store={store}>
<RouterProvider router={router}>
<App />
</RouterProvider>
</Provider>
16
</React.StrictMode>
);
index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
body {
margin: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@apply bg-slate-200
}
code {
}
routes/index.js
17
import Forgotpassword from "../pages/Forgotpassword";
{
path: "/",
children: [
{
path: "register",
},
{
path: "login",
},
{
path: 'forgot-password',
},
{
path: "",
children: [
{
path: ':userId',
18
}
]
}
]
}
])
redux/store.js
reducer: {
user: userReducer
},
})
redux/userSlice.js
const initialState = {
_id: "",
name: "",
email: "",
profile_pic: "",
token: "",
onlineUser: [],
19
socketConnection: null
}
name: 'user',
initialState,
reducers: {
state._id = action.payload._id
state.name = action.payload.name
state.email = action.payload.email
state.profile_pic = action.payload.profile_pic
state.bg_color = action.payload.bg_color
},
state.token = action.payload
},
state._id = ""
state.name = ""
state.email = ""
state.profile_pic = ""
state.token = ""
state.socketConnection = null
state.bg_color = ""
},
20
state.onlineUser = action.payload
},
state.socketConnection = action.payload
}
},
})
// Action creators are generated for each case reducer function
export const { setUser, setToken, logout, setOnlineUser, setSocketConnection } =
userSlice.actions
pages/LoginPage.js
21
const [showPassword, setShowPassword] = React.useState(false);
const [data, setData] = React.useState({ email: "", password: "", userId: "",
profile_pic: "", name: "", bg_color: "" });
...prev,
[name]: value
}))
}
setLoading(true)
e.preventDefault()
e.stopPropagation()
try {
if (data.email) {
if (response.data.success) {
setEmailValid(true)
toast.success(response.data.message)
setLoading(false)
22
}
}
else {
setLoading(false)
}
} catch (error) {
toast.error(error?.response?.data?.message)
setLoading(false)
}
}
setLoading(true)
e.preventDefault()
e.stopPropagation()
try {
method: 'post',
url: URL,
data: {
userId: data.userId,
password: data.password
},
withCredentials: true
})
23
if (response.data.success) {
toast.success(response.data.message)
dispatch(setToken(response?.data?.token))
localStorage.setItem('token', response?.data?.token)
setLoading(false)
navigate('/')
}
} catch (error) {
toast.error(error?.response?.data?.message)
setLoading(false)
}
}
return (
<div className='mt-5'>
{loading &&
<Loading />
</div>)
}
{
isEmailValid &&
<Avatar
width={70}
24
height={70}
name={data.name}
imageUrl={data.profile_pic}
bg_color={data.bg_color}
/>
</div>
}
</div>
{
isEmailValid ?
<>
<label htmlFor="floatingPassword">Password</label>
setShowPassword(!showPassword)
}}>
{!showPassword ? (
25
) : (
)}
</button>
</div>
</>
:
<>
</>
}
</div>
</div>
)
}
26
pages/RegisterPage.js
name: "",
email: "",
password: "",
profile_pic: "",
bg_color: ""
})
const bgColor = [
27
'bg-slate-200',
'bg-teal-200',
'bg-red-200',
'bg-green-200',
'bg-yellow-200',
'bg-gray-200',
"bg-cyan-200",
"bg-sky-200",
"bg-blue-200"
]
React.useEffect(() => {
document.title = "SignUp"
...prev,
bg_color: bgColor[randomNumber]
}))}, [])
setOtp(e.target.value)
}
setData((prev) => {
return {
...prev,
[name]: value
28
}})}
setLoading(true)
setUploadPhoto(file)
...prev,
profile_pic: uploadPhoto?.url
}))
setLoading(false)
}
e.stopPropagation()
e.preventDefault()
setUploadPhoto(null)
}
setLoading(true)
e.preventDefault()
e.stopPropagation()
try {
...data,
otp
29
})
if (response.data.success) {
toast.success(response.data.message)
setData({
name: "",
email: "",
password: "",
profile_pic: "",
bg_color: ''
})
setLoading(false)
navigate('/login')
}
} catch (error) {
toast.error(error?.response?.data?.message)
setLoading(false)
}
}
return (
<div className='mt-5'>
{
!otpSent ?
<form onSubmit={sendOtp}>
30
<>
</div>
</>
{emailVarified &&
<>
</div>
<label htmlFor="floatingPassword">Password</label>
setShowPassword(!showPassword)
}}>
{!showPassword ? (
31
) : (
)}
</button>
</div>
<label htmlFor='profile_pic'>
{
}
</p>
{
uploadPhoto?.name && (
<IoClose />
</button>
)
}
</div>
</label>
<input
type='file'
32
id='profile_pic'
name='profile_pic'
onChange={handleUploadPhoto}/>
</div>
</>}
</form>
:
<form onSubmit={handleRegisterSubmit}>
</div>
</form>}
{loading &&
<Loading />
</div>)}</div></div>)}
33