Project Lab report final first1
Project Lab report final first1
REACT NATIVE
1
PROJECT LAB REPORT AT
QUANTUM UNIVERSITY
ROORKEE, INDIA
Submitted by Q ID
2
QUANTUM UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ROORKEE, INDIA
CERTIFICATE
This is to certify that the project report entitled “CHAT APPLICATION” being submitted by
Ishak Gauri, Pratiksha Singh, Aayush Kumar Jha and Aayush Chaudhary in partial fulfilment
for the award of the Degree of Bachelor’s of Technology in Computer Science and
Engineering to the Quantum University, Roorkee a sare cord of Bonafide work carried out by
these students under my guidance and supervision.
Project Supervisor
Asst. Prof Manoj PAL
Department of Computer Science
And Engineering, Roorkee, India
3
DECLARATION
I hereby declare that the project entitled “Chat Application” submitted for the Bachelor’s of
Computer Science and Engineering is my original work and the project has not formed the
basis or submitted for the award of any degree, diploma, or any other similar titles in any
college/ institute / university.
Signature:
Place:
Date:
4
ACKNOWLEDGMENT
We would like to express my sincere thanks to Asst. Prof Manoj Pal, for his valuable
guidance and support in completing our project. We would also like to express our gratitude
towards our department for giving us this great opportunity to do a project on “Chat
Application”.
Your valuable guidance and suggestions helped us in various phases of the completion of
this project. We will always be thankful to you in this regard.
5
ABSTRACT
Chat applications enable real-time communication through text, audio, or video, connecting
multiple users via a server-client architecture. This project focuses on building a secure
client-server-based mobile chat application supporting features like real-time messaging,
cross-platform compatibility, and user status tracking (online/offline).
The proposed system includes friendship requests, secure key exchange for session initiation,
and end-to-end message encryption, ensuring privacy and protection against unauthorized
access.
Additionally, the system prioritizes fast message transfer and local storage security. The
project also evaluates the application's performance and security to enhance user experience
and data protection.
6
TABLE OF CONTENTS
Certificate
Declaration
Acknowledgment
Abstract
Chapter: 1 Introduction
Chapter: 2 Objectives of the project
Chapter: 3 SDLC
3.1 Project Planning
3.2 Requirements
3.3 Design
3.3.1 DFD (Data Flow Diagram)
3.3.2 ERD (Entity Relationship Diagram)
Chapter: 4 Needs of React Native for the Chat Application
4.1 Coding:
4.1.1 App.js
4.1.2 App config.js
4.1.3Firebase.js
Chapter: 5 Snapshots of App
Fig 5.1.1 Login page
Fig 5.1.2 Signup page
Fig 5.1.3 Chats page
Fig 5.1.4 Users page
Chapter: 6 Conclusion
Chapter: 7 Future Work
7
Chapter 1
Introduction
Communication is the cornerstone of human interaction, and traditional methods such as
emails, phone calls, and text messages have been integral to personal and professional
exchanges for decades. However, these methods often lack the immediacy and accessibility
required in today's fast-paced world. The introduction of chat applications for mobile web has
revolutionized the way people connect and collaborate.
This project explores the development and utility of a mobile web-based chat application as a
modern alternative to traditional communication methods. It highlights the app's ability to
offer real-time messaging, cross-platform compatibility, and enhanced user engagement,
which significantly streamline interactions compared to conventional tools.
By addressing limitations like delayed responses and fragmented communication channels,
the chat application serves as a comprehensive solution for seamless and efficient exchanges
in professional and personal contexts.
8
Chapter 2
9
Chapter 3
SDLC
The Software Development Life Cycle (SDLC) is a structured process used for developing
software applications. It provides a systematic approach to ensure the efficient planning,
design, development, testing, deployment, and maintenance of software. The SDLC
framework enhances project management and ensures high-quality software delivery by
reducing risks and errors.
Phases of SDLC
1. Project Planning
2. Gathering Requirements & Analysis
3. Design
4. Coding or Implementation
5. Testing & Deployment
6. Maintenance
10
3.2 Requirements
Software Requirements:
The software requirements for the chat application include React Native, Firebase SDK,
Node.js, Android Studio/Xcode (for mobile development), and VS Code (for desktop
development). Additionally, a Firebase account for authentication and database management
is required.
3.3 Design
11
DFD for Chat Application
12
3.3.2 ERD (Entity Relationship Diagram)
An Entity-Relationship (ER) Diagram visually shows how different entities in a system relate
to each other. In a chat application:
Entities: Represent objects like User, Message, and Chatroom.
Attributes: Characteristics of entities, e.g., User has user-id, username, and email.
Relationships: How entities are connected, e.g., User sends Messages, and Messages
belong to a Chatroom.
Typical relationships:
User-Message: One user sends multiple messages (one-to-many).
Message-Chatroom: One message belongs to one chat room (many-to-one).
User-Chatroom: One user can join multiple chat rooms (many-to-many).
13
Chapter 4
14
4.1 Coding
4.1.1 App.js
15
name="Help" component={Help} /> <Stack.Screen name="Account" component={Account}
/> <Stack.Screen name="Group" component={Group} options={{ title: 'New Group' }} />
<Stack.Screen name="ChatInfo" component={ChatInfo} options={{ title: 'Chat
Information' }} /> </Stack.Navigator>); const AuthStack = () => ( <Stack.Navigator
screenOptions={{ headerShown: false }}> <Stack.Screen name='Login' component={Login}
/> <Stack.Screen name='SignUp' component={SignUp} /> </Stack.Navigator> ); const
RootNavigator = () => { const { user, setUseruseContext(AuthenticatedUserContext); const
[isLoading, setIsLoading]= useState(true); useEffect(() => { const unsubscribeAuth =
onAuthStateChanged(auth, async authenticatedUser =>{setUser(authenticatedUser || null);
setIsLoading(false);}); return unsubscribeAuth; }, []); if (isLoading) {return (<View
style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <ActivityIndicator
size='large' /> </View>) ; } return (<NavigationContainer>{user ? <MainStack /> :
<AuthStack />}</NavigationContainer>);};const App = () => {return (<MenuProvider>
<AuthenticatedUserProvider> <UnreadMessagesProvider> <RootNavigator />
</UnreadMessagesProvider></AuthenticatedUserProvider></MenuProvider>)}; export
default App;
16
4.1.3Firebase.js
// config/firebase.js
import 'dotenv/config'; // Ensure you load the .env file // import { initializeApp } from
"firebase/app"; import { getAnalytics } from "firebase/analytics"; import { getAuth } from
"firebase/auth"; // Firebase configuration from .env file// const firebaseConfig = { apiKey:
process.env.EXPO_PUBLIC_API_KEY, authDomain:
process.env.EXPO_PUBLIC_AUTH_DOMAIN, databaseURL: `https://$
{process.env.EXPO_PUBLIC_PROJECT_ID}.firebaseio.com`,projectId:process.env.EXPO_
PUBLIC_PROJECT_ID,storageBucket:process.env.EXPO_PUBLIC_STORAGE_BUCKET,
messagingSenderId:process.env.EXPO_PUBLIC_MESSAGING_SENDER_ID,appId:proces
s.env.EXPO_PUBLIC_APP_ID,measurementId:
process.env.EXPO_PUBLIC_MEASUREMENT_ID,};// Initialize Firebase// const app =
initializeApp(firebaseConfig);// Initialize Firebase services// const auth = getAuth(app); const
analytics = getAnalytics(app); // Export Firebase services for use elsewhere in your appexport
{ auth, analytics };
17
Chapter 5
18
Fig 5.1.3 Chats page Fig 5.1.4 Users page
19
Chapter 6
Conclusion
The chat application serves as a robust platform for seamless communication, connecting
users through efficient and interactive features. By incorporating essential entities such as
users, messages, and chat rooms, it ensures an organized and user-friendly experience.
With a well-structured foundation illustrated by the Entity-Relationship (ER) diagram, the
application is equipped to support scalable and secure communication. Its design prioritizes
functionality, user engagement, and adaptability to modern needs.
Looking ahead, the integration of advanced technologies like AI, enhanced security measures,
and cross-platform compatibility will enable the application to evolve further. By
continuously innovating, the platform can meet diverse user demands and remain relevant in
a dynamic digital landscape.
The chat application's future promises enhanced usability and a broader reach, making it an
invaluable tool for both personal and professional communication.
20
Chapter 7
Future Work
The chat application holds significant potential for growth and evolution, ensuring its
relevance in an ever-changing technological landscape. Below are some potential avenues for
development:
1. Advanced Features: Add file sharing, voice notes, and video messaging.
2. AI Integration: Enable smart replies, sentiment analysis, and personalized
recommendations.
3. Enhanced Security: Introduce end-to-end encryption and biometric authentication.
4. Cross-Platform: Ensure seamless functionality across web, mobile, and desktop.
5. Customizations: Allow personalized themes and chat room settings.
6. Global Reach: Support multiple languages for diverse user bases.
7. Third-Party Integration: Connect with calendars and task managers.
8. Scalability: Optimize for large communities and peak usage.
9. Real-Time Analytics: Offer insights to monitor and enhance chat activities.
10. AR Features: Include immersive virtual chat environments.
These advancements will keep the application competitive and future-ready.
21