Rameshvar Ubale Project
Rameshvar Ubale Project
Mandal’s
On
“Echo-chat”
Submitted for partial fulfillment of the degree of
B.Sc. (Computer Science) VI Semester
By
Rameshvar Pandurang Ubale Roll no.195
Academic Year 2024-2025.
CERTIFICATE
This is to certify that the candidates for the B.Sc. (Computer Science) VI
Semester has satisfactorily completed the project entitled "Echo - Chat" for the
Partial Fulfillment of the Undergraduate Degree of Dr. Babasaheb Ambedkar
Marathwada University, Chhatrapati Sambhajinagar for the academic year
2024-25.
Submitted By
Mr. Amol Ashok Shelke
Mr. Atul Ramesh Suradkar
Mr. Rushikesh Gajanan Kanade
Mr. Rameshvar Pandurang Ubale
ACKNOWLEDGMENT
Thankful to our principal, Prof. A.V. Tejankar, and the head of our department of
computer science, Dr. Ritesh A. Magre, for giving me a well-equipped lab and for their
encouragement and guidance.
Completion of the project would not be accomplished without cooperation and help from
a teacher guide. I wish to express my deep sense of gratitude to guide Mr. Abhijeet K.
Bhusare Department of Computer Science, Deogiri College, Chhatrapati Sambhaji
Nagar who has supported me throughout the project work in the form of comments,
corrections, and excellent suggestions.
Yours Faithfully,
Rameshvar Pandurang Ubale
(B.Sc. CS-TY)
INDEX
04
4. Introduction to
Backend
05
5. Hardware and Software Requirement Of
project
Database Design 06
6.
07
7. DFD
08 - 10
8. Form Layouts
11 - 50
9. Source Code
Limitations Of project 51 - 52
10.
Conclusion 53
11.
12. References 54
Introduction of Project:
In today's fast-paced digital age, effective communication is crucial for the success of any
educational institution. Echo Chat is a cutting-edge WhatsApp live chat platform designed
specifically to meet the unique needs of educational organizations. It empowers institutions to
connect with prospective and current students in real-time, fostering a more engaging and
personalized learning experience. Echo Chat is more than just a WhatsApp live chat solution;
it's a comprehensive communication platform that transforms the way educational
organizations connect with their students. By embracing real-time, personalized, and
streamlined communication, institutions can create a more engaging and supportive learning
environment, ultimately driving student success. The echo chat project demonstrates that
communication tools, when designed thoughtfully, can not only meet immediate user needs
but also innovate in ways that significantly enhance digital interaction. project will be
platform support, voice-to-text, and deeper AI-assisted conversations
1
Objective of Project: Echo Chat:
The Echo Chat Project typically involves creating a chat system that echoes messages back
to users. The objectives can vary based on complexity, but common goals include:
1. Basic Functionality Develop a system that receives user input and returns the same
message (echo functionality).
Ensure real-time message transmission with minimal latency.
2. Technical Implementation
• Implement a backend server (Node.js, Python, etc.) to process messages.
• Use WebSockets or HTTP for communication.
• Create a front-end interface for users to send and receive messages.
2
Introduction to Frontend:
The Frontend Echo Chat Project is a cutting-edge web application designed to facilitate
seamless and interactive communication between users. It serves as the client-side interface
of the larger Echo Chat system, focusing on delivering an intuitive, responsive, and visually
appealing user experience. The primary objective of this frontend development is to create a
real-time chat application that integrates text messaging, voice, and video functionalities
while ensuring efficiency, accessibility, and security.
HTML (Structure): Defines the webpage layout, including forms, buttons, and navigation.
CSS (Styling): Enhances the UI using frameworks like Bootstrap and Tailwind CSS for
responsiveness.
JavaScript (Interactivity): Enables dynamic features like form validation and real-time
updates.
Frontend Frameworks:
• React.js: Component-based, fast rendering.
Introduction to Backend:
The backend of the Echo Chat Project is responsible for handling user authentication,
message storage, real-time data synchronization, and server-side logic. It is developed
3
using scalable and efficient backend technologies to ensure high availability, data security,
and seamless integration with the frontend.
System Requirement
• Software Requirements
4
Front End HTML, CSS, Javascript
Database Mongodb
• Hardware Requirement
Processor Intel Core i5 or Higher Processor
5
Database Design:
Message Table:
User Table:
7
Form Layouts
• Home page
Features:
8
About Us & Contact Us:
Sign Up:
Login Page:
9
Dashboard:
Source Code:
(Frontend)
Index.html:
<!DOCTYPE html>
10
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Buzzline</title>
<!-- Bootstrap 5 CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<!-- Font Awesome CDN -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/6.0.0beta3/css/all.min.css"
/>
<!-- Custom CSS -->
<link rel="stylesheet" href="landing.css" />
</head>
<body class="theme-dark">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-transparent py-3">
<div class="container">
<a class="navbar-brand" href="#">Echo Chat</a>
<button class="navbar-toggler"
type="button" data-bs-
toggle="collapse" data-
bs- target="#navbarNav"
aria- controls="navbarNav" aria-
expanded="false" aria-
label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#features">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
<li class="nav-item">
11
<a class="nav-link" href="#auth">Login / Sign Up</a>
</li>
</ul>
</div>
</div>
</nav>
16
Client.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Buzzline</title>
<!-- Bootstrap 5 CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]
a1/dist/css/bootstrap.min.css" rel="stylesheet"
/>
<!-- Font Awesome CDN -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/6.0.0beta3/css/all.min.css"
/>
<!-- Custom CSS -->
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="theme.css" />
</head>
<body>
<div class="container-fluid h-100">
<div class="row h-100">
<!-- Vertical Navbar -->
<nav id="navbar" class="col-1 navbar d-flex flex-column align- items-center py-
3 contact-nav root"
>
<ul class="nav flex-column" id="nav">
<li class="nav-item my-3">
<a href="#" class="nav-link" id="chatBtn"
><i class="fas fa-comments fa-lg"></i
></a>
</li> <li
class="nav-
17
item my-
3">
19
<button class="input-group-text me-2">
<i class="fas fa-search"></i>
</button>
</div>
<hr />
<div class="contact-main scroll-container">
<div class="contact-list" id="contactList">
<!-- Sample contact with unread messages -->
<div class="contact">
<img
src="../user.png" class="rounded-
circle me-2"
alt="Contact" width="50"
height="50"
/>
<div>
<h6 class="mb-0">John Doe</h6>
<small>Last message...</small>
</div>
<span class="badge badge-unread">2</span> </div> </div>
</div>
</aside>
>
<button class="btn btn-custom me-2" id="backBtn">
<i class="fa-solid fa-arrow-left"></i>
</button>
<div class="d-flex align-items-center">
<img
src="../user.png" class="rounded-
circle me-2"
20
alt="Contact" width="50"
height="50"
/>
<h5 class="mb-0">Contact Name</h5>
</div>
<div class="chat-actions chat-root">
<button class="btn btn-custom me-2" id="voiceCallBtn">
<i class="fas fa-phone"></i>
</button>
<button class="btn btn-custom" id="videoCallBtn">
<i class="fas fa-video"></i>
</button>
</div>
<div class="chat-actions chat-primary">
<!-- Dropdown button for call and video on small screens -->
<div class="dropdown">
<button class="btn btn-custom
dropdown-toggle" type="button"
id="chatActionsDropdown" data-bs-
toggle="dropdown" aria- expanded="false"
>
<i class="fas fa-ellipsis-v"></i>
</button>
<ul
class="dropdown-menu dropdown-menu-end" aria-
labelledby="chatActionsDropdown"
>
<li>
<a class="dropdown-item" href="#"
><i class="fas fa-phone"></i> Call</a
>
</li>
<li>
<a class="dropdown-item" href="#"
><i class="fas fa-video"></i> Video</a
>
21
</li>
</ul>
</div>
</div>
</header>
<!-- Chat Messages -->
<div class="chat-messages p-3 scroll-containe">
<!-- Receiver's Message -->
<div class="msgIn">
<div class="message received mb-3">Hey! How are you?</div>
</div>
<!-- Sender's Message -->
<div class="msgOut">
<div class="message sent mb-3">
I'm good, thank you! How about you? lor
<div class="msg-info">
<span>4.55 am</span>
<span class="fa-stack">
<!-- <i class="fas fa-check fa-stack-1x"></i> -->
<i class="fa-solid fa-check-double"></i>
</span>
</div>
</div>
</div>
</div>
<!-- Chat Footer -->
<div class="chat-footer p-3 bg-white d-flex align-items-center">
<!-- Attachments -->
<div class="attachment-dropdown me-2 dropdown">
<!-- Button to trigger the dropdown -->
<button class="btn-paperclip
dropdown-toggle" type="button"
id="attachmentDropdown" data-bs-
toggle="dropdown" aria-
expanded="false"
>
22
<i class="fas fa-paperclip"></i>
</button>
23
<!-- Send Voice Message -->
<button class="btn-
microphone"
id="btn-microphone" aria-label="Record voice
message"
;
>
<i class="fas fa-microphone"></i>
</button>
</div>
</main>
</div>
</div>
<div class="video-container" id="callScreen">
<video id="localVideo" autoplay muted playsinline></video>
<video id="remoteVideo" autoplay playsinline></video>
24
<!-- Bootstrap JS and Popper -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.
js"></script>
<!-- <script src="http://localhost:3000/socket.io/socket.io.js"></script> -->
<script src="/socket.io/socket.io.js"></script>
<script src="script_02.js"></script>
</body>
</html>
(Backend)
User.Controller.js:
import '../../env.js'
import mongoose from "mongoose"; import UserModel
from './users.schema.js' import jwt from "jsonwebtoken";
import bcrypt from 'bcrypt' import UserRepository from
"./user.repo.js"; import { ApplicationError } from
"../../error/applicationError.js";
});
25
} else { throw new ApplicationError('Error signing
up',400);
}
} catch (err)
{ console.error(err); if (err
instanceof
mongoose.Error.ValidationError) {
return res.status(422).json({
errors:
Object.values(err.errors).map(e =>
e.message),
});
}
next(err);
}
}
26
},
process.env.JWT_SECRETKEY,
{ expiresIn: '5h', // Token expiration
time }
);
// Return token and user info in the response (instead of setting a cookie)
res.status(200).json({ token, // Include the JWT token Name:
user.name, message: 'Login successful'
});
} catch (err)
{ next(err);
}
}
async currentUser(req,res,next){
try { const userId = req.user.userId; const
user = await userRepository.getById(userId); if (!user) {
return res.status(404).json({ message: 'User not found' });
}
});
if (user) {
return res.status(200).json({
Id:user._id,
Name: user.name,
Email: user.email,
MobileNumber:user.mobileNumber,
Gender: user.gender
});
} else { throw new
ApplicationError('User not found', 404);
28
}
} catch (err)
{ next(err);
}
}
try {
}
}
29
}
}
30
User.repo,js:
import UserModel from
"./users.schema.js" export default class
UserRepository{ async
signUp(name,email,hashPassword){
// create instanceof user model
const user = new
UserModel({name:name,email:email,password:hashPassword,
}) const newUser= await
user.save()
return newUser
}
async findByEmail(email)
{ try{
const validUser=await UserModel.findOne({email})
if(validUser){ return validUser;
} else{
return null
} } catch(err)
{ console.log(err)
}
}
async getById(id)
{ try {
const validUser = await UserModel.findById(id);
return validUser || null;
} catch (err)
{ throw err
}
}
31
async getAll() {
try { const users = await UserModel.find();
return users || []; } catch (err)
{ throw err
}
}
}
}
User.routes.js:
import express from 'express' import UserController from
'../../middleware/jwt-auth.middleware.js';
32
userRouter.post('/signup',
(req,res,next)=>{ userContollerObj.signUp(req,res,next)
});
userRouter.post('/signin',
(req,res,next)=>{ userContollerObj.signIn(req,res,next)
});
userRouter.get('/',jwtAuth,
(req,res,next)=>{ userContollerObj.getAll(req,res,next)
});
userRouter.get('/current',jwtAuth,
(req,res,next)=>{ userContollerObj.currentUser(req,res,next)
});
Users.schema.js:
import mongoose from "mongoose"; import
{ ApplicationError } from "../../error/applicationError.js"; const
UserSchema = new mongoose.Schema({ name: { type: String,
required: [true, 'Name is required'], minlength: [3, 'Name must
be at least 3 characters long'],
}, email: { type: String, required: [true, 'Email is required'],
unique: true, match: [/\S+@\S+\.\S+/, 'Please enter a valid email
address'],
},
password: { type: String, required: [true, 'Password is
required'], minlength: [8, 'Password must be at least 8
characters long'], validate: { validator: function (v)
{ return (
/[A-Z]/.test(v) &&
/[a-z]/.test(v) &&
33
/[0-9]/.test(v) &&
/[\W]/.test(v)
);
},
message: 'Password must contain at least one uppercase letter, one lowercase
letter, one number, and one special character',
}, }, contacts:
[{ type:
mongoose.S
chema.Type
s.ObjectId,
ref: 'User'
}], groups: [{ type:
mongoose.Schema.Types.ObjectId, ref:
'Group' }], avatar: { type: String, //
URL to avatar image default: '' },
status: { type: String, default: 'Hey
there! I am using the app!'
}, isOnline:
{ type:
Boolean,
default: false
},
lastSeen:
{ type:
Date
}, socketId: { type: String, // For real-time communication
(WebSocket ID) default: null
},
blockedUsers: [{ type:
mongoose.Schema.Types.ObjectId,
ref: 'User'
}],
// Call history (optional for voice/video)
callHistory: [{ callType: { type:
String, // 'audio' or 'video' required:
true
34
}, callWith: { type: mongoose.Schema.Types.ObjectId, ref:
'User', required: true
},
startTime: {
type: Date,
required: true
},
endTime: {
type: Date
}, status: { type: String, // 'missed',
'answered', 'declined' default: 'answered'
}
}],
}, { timestamps: true });
UserSchema.pre('save', async function (next)
{ const user = this; try {
// Check if the email already exists if (user.isModified('email')) { const
existingUser = await mongoose.models.user.findOne({ email: user.email });
if (existingUser) { throw new ApplicationError('Email already exists', 409);
} }
next(); } catch
(err) {
// Pass the error to the next middleware
next(err);
}
});
Chat.schema.js:
import mongoose from 'mongoose';
35
sender: { type:
mongoose.Schema.Types.ObjectId,
ref: 'user',
required: true,
}, receiver: { type:
mongoose.Schema.Types.ObjectId,
ref: 'user',
required: true,
},
message: {
type: String,
required: true,
},
timestamp: {
type: Date, }, isRead: { type: Boolean,
default: false }, });
36
Server.js
import '../env.js'; import express from 'express'; import cors from 'cors';
import { Server } from 'socket.io'; import http from 'http';
import userRouter from './users/user.routes.js'; import
Message from '../backend/chats/chat.schema.js' import
{ ApplicationError } from '../error/applicationError.js';
const corsOptions =
{ origin: '*',
credentials: true,
};
app.use(cors(corsOptions)); app.options('*',
cors(corsOptions));
app.use(express.json()); app.use(express.urlencoded({
extended: true }));
app.use(express.static('frontend'));
// User routes app.use('/api/users',
userRouter); // app.use('/api/users',
messageRouter);
37
// Create an HTTP server and configure
Socket.io const server = http.createServer(app);
const io = new Server(server, { cors: { origin:
'*', methods: ['GET', 'POST'],
credentials: true,
},
});
// Listen for 'joinRoom' event to allow users to join their unique room
socket.on('joinRoom', (userId, userName) => { socket.join(userId);
io.emit('updateUserStatus', { userId, status: 'online' });
console.log(`User ${userName} joined room ${userId}`);
});
38
message.sender._id.toString() === currentUserId ?
message.receiver : message.sender; const
chatPartnerId = chatPartner._id.toString();
if (!chatUsersMap.has(chatPartnerId)) {
chatUsersMap.set(chatPartnerId, { user:
chatPartner, lastMessage:
message.message, lastTimestamp:
message.timestamp
});
}
});
40
// Handle call initiation socket.on('call-user', (selectedUserId,
currentUserName) => { if
(usersInCall[selectedUserId]) { io.to(socket.id).emit('user-busy'); //
Notify the caller that the user is busy
} else { console.log(`${currentUserName} is calling
${selectedUserId}`); io.to(selectedUserId).emit('incoming-call', { from:
currentUserName });
}
});
Landing.css:
/* General Styles */
body.theme- dark
{ background-color: #1a1a1a;
color: #e0e0e0;
}
.navbar.scrolled { background-color:
42
rgba(0, 0, 0, 0.8); box-shadow: 0 2px 4px
rgba(0, 0, 0, 0.2);
}
.navbar-brand { font-
size: 1.5rem;
}
.nav-link
{ color: #ffffff;
}
.nav-link:hover
{ color: #f39c12;
}
/* Hero Section */
.hero-section
{ height: 80vh;
background: linear-
gradient(160deg,
#1c1c1c, #141414);
.features-section h2
{ color: #f39c12;
}
.features-section i
{ color: #f39c12;
}
.features-section p
{ color: #dcdcdc;
.feature-box.in-view
{ opacity: 1; transform:
translateY(0);
}
44
}
.social-icons a:hover
{ color: #f39c12;
}
:root {
--card-bg: #2b2b2b; /* Dark background for card */
--card-border: #333; /* Darker border color */
--btn-primary-bg: #4a4a4a; /* Dark background for buttons */
--btn-primary-color: #fff; /* White text for buttons
*/ }
body.theme-dark { background-
color: #1a1a1a; color: #e0e0e0;
}
.auth-section { background- color:
#1a1a1a; padding: 100px
0;
}
.nav-tabs .nav-link.active
{ background: var(--card-bg);
color: var(--btn-primary-color);
border- color: var(--card-border);
}
45
.form-control { background-
color: #333; color: #fff;
border: 1px solid #444;
} label{
float: inline-
start;
}
.form-
control::placeholder{ color:
rgb(211, 209, 209);
}
.btn-primary { background-color: var(-- btn-
primary-bg); border-color: var(--btn- primary-bg);
color: var(--btn-primary- color);
}
.form-
control:focus{ outline: none;
background- color: #e0e0e0;
border:
none;
}
.btn-primary:hover { background-
color: #5a5a5a; border-color:
#5a5a5a;
}
/* About Us Section */ .about-section
{ background-color: #222; /* Dark background for About Us section */
padding: 60px 0;
} in-view .about-section h2 { color: #f39c12;
/* Accent color for the heading */ margin-
bottom: 40px;
}
Limitations Of project:
The Echo Chat Project is an advanced chatbot system designed to facilitate conversations,
automate responses, and assist users with various tasks. However, despite its usefulness and
capabilities, it has several limitations that impact its efficiency, scalability, and overall user
experience. Below are some of the key limitations:
While Echo can process and generate responses based on predefined algorithms and trained
data, it struggles with maintaining long-term context. Complex conversations requiring deep
understanding, reasoning, or memory retention over multiple exchanges can lead to irrelevant
or repetitive responses.
Echo lacks genuine emotional intelligence and cannot fully comprehend or replicate human
emotions. It may fail to detect sarcasm, irony, or emotional distress, which could lead to
inappropriate or insensitive responses. This limitation affects its ability to provide human-like
interactions in sensitive discussions.
The chatbot operates based on pre-trained datasets and does not have real-time learning
capabilities. This means that it cannot adapt dynamically to new trends, language changes, or
evolving user preferences unless manually updated by developers.
47
Echo may struggle with ambiguous or vague queries where user intent is unclear. Unlike
human interactions, where contextual cues help in clarifying meaning, Echo relies on direct
inputs and may require repeated attempts to understand and address user requests accurately.
5. Security and Privacy Concerns
Since Echo processes and stores user interactions, there is a risk of data breaches and privacy
violations. Users may be hesitant to share sensitive information due to potential
vulnerabilities in the system’s security infrastructure.
Although Echo provides automated responses, its customization options may be limited.
Users may not be able to tailor responses according to their specific needs or preferences
without significant backend modifications.
Echo may struggle with understanding and accurately processing multiple languages, dialects,
or accents. Speech recognition errors and misinterpretations can affect communication
quality, especially for non-native speakers.
Echo is not designed for complex problem-solving tasks that require human-level reasoning,
critical thinking, or creativity. It performs well with structured queries but struggles when
dealing with abstract concepts or unconventional questions.
Many chatbot systems, including Echo, depend on internet access to retrieve and process
data.
In cases of poor connectivity, delayed or inaccurate responses may hinder the user
experience.
Echo primarily operates through text-based interactions and may have difficulty integrating
with visual or auditory inputs effectively. This limits its applicability in environments where
multimedia communication is essential.
48
Conclusion:
The Echo Chat Project has showcased the immense potential of AI-driven communication in
enhancing user interactions, automating responses, and providing seamless digital
experiences. By integrating natural language processing and machine learning, Echo has
significantly improved response efficiency, making it a valuable tool for businesses, customer
support, and everyday users. Its ability to provide real-time assistance has streamlined various
processes, reducing human effort and increasing accessibility across different sectors.
Despite its successes, Echo faces several challenges that need to be addressed for further
improvements. One of the key limitations is its limited contextual understanding, which can
lead to irrelevant or repetitive responses in complex conversations. Additionally, its inability
to fully comprehend emotions and detect nuances like sarcasm or humor affects the quality of
interactions. Data security and user privacy also remain critical concerns, as chatbots store
and process vast amounts of user information that require stringent security measures.
Looking ahead, the future of Echo is promising, with opportunities to enhance its capabilities
through advanced AI, improved sentiment analysis, and real-time learning. Integrating
emotional intelligence will make it more human-like, while multilingual and multimodal
functionalities will expand its usability across diverse user bases. Strengthening its security
measures will ensure safer interactions, boosting user trust and engagement. Furthermore,
industry-specific customization can make Echo a more specialized and effective tool in areas
like healthcare, finance, and education.
In conclusion, the Echo Chat Project has laid the groundwork for the future of AI-powered
conversational interfaces. While challenges exist, ongoing advancements in artificial
intelligence and machine learning will play a crucial role in overcoming these barriers. With
continuous development and refinement, Echo has the potential to become a more intelligent,
secure, and user-friendly chatbot, revolutionizing digital communication and automation
across multiple domains.
References:
1 Books & Research Papers:
o Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
o Vaswani, A., et al. (2017). "Attention Is All You Need." Advances in Neural
Information Processing Systems (NeurIPS). o Devlin, J., et al. (2019).
"BERT: Pre-training of Deep Bidirectional Transformers for Language
Understanding." NAACL-HLT.
50