Real-Time Chat App is a full-stack messaging application that allows users to communicate instantly with each other through real-time messaging.
The system provides secure authentication, real-time communication, and user presence detection so that users can see who is online and exchange messages instantly.
The application is built using the MERN Stack and utilizes WebSockets for real-time communication.
This project demonstrates modern full-stack development practices, including REST APIs, real-time sockets, state management, and modular architecture.
A video demonstration of the project is available on YouTube.
The Real-Time Chat App allows users to sign up, log in, and communicate with other users in real time.
The system is built using:
- MongoDB
- Express.js
- React
- Node.js
- Socket.IO
It provides a fast and interactive chat experience where users can send and receive messages instantly without refreshing the page.
- User Signup
- User Login
- Secure password handling
- Authentication middleware
- Protected routes for authenticated users
The application supports instant communication between users.
Users can:
- Send messages instantly
- Receive messages in real time
- View conversation history
- Chat with multiple users
- Automatically update chat interface without refreshing
Real-time functionality is implemented using Socket.IO.
Users can see which users are currently online.
Features include:
- Live user presence detection
- Dynamic online user list
- Real-time updates when users connect or disconnect
The system provides notifications when:
- A new message is received
- A message arrives from another user
- A user sends a message while another conversation is open
The frontend is built using React with Vite for fast development and optimized builds.
Frontend features include:
- Modern UI components
- Responsive layout
- Dynamic chat interface
- State management using Redux Toolkit
- React
- Tailwind CSS
- Daiusy UI
- Redux Toolkit
- Axios
- Vite
- CSS
- Node.js
- Express.js
- MongoDB
- Mongoose
- Socket.IO
- JWT Authentication
- Bcrypt Js
- MongoDB
- Mongoose
Follow the steps below to run the project on your local machine.
git clone https://github.com/yourusername/real-time-chat-app.gitNavigate into the project folder:
cd Real-Time-Chat-APP__MERNNavigate to the Server folder:
cd ServerInstall dependencies:
npm installRename the environment file:
env → .env
Start the backend server:
npm run devOpen another terminal and navigate to the Client folder:
cd ClientInstall dependencies:
npm installRename the environment file:
env → .env
Start the frontend development server:
npm run devOnce both servers are running, open the application in your browser:
http://localhost:5173
- Users create an account using Signup.
- Users log in to access the chat dashboard.
- The application connects to the server using Socket.IO.
- Online users are detected and displayed.
- Users can select another user and start chatting.
- Messages are sent and received instantly in real time.
The main goal of this project is to:
- Learn full-stack MERN development
- Implement real-time communication using WebSockets
- Understand REST APIs and authentication
- Practice state management with Redux
- Build scalable client-server architecture
If you find this project helpful, consider giving it a ⭐ on GitHub.
Real-Time-Chat-APP__MERN/
├── Client/
│ ├── public/
│ │ ├── vite.svg
│ ├── src/
│ │ ├── Components/
│ │ │ ├── ChatSidebar.jsx
│ │ │ ├── Message.jsx
│ │ │ ├── MessageContainer.jsx
│ │ │ ├── ProtectedRoute.jsx
│ │ │ ├── User.jsx
│ │ ├── pages/
│ │ │ ├── Auth/
│ │ │ │ ├── Login.jsx
│ │ │ │ ├── Signup.jsx
│ │ │ ├── Home/
│ │ │ │ ├── Chat.jsx
│ │ ├── store/
│ │ │ ├── features/
│ │ │ │ ├── message/
│ │ │ │ ├── socket/
│ │ │ │ ├── user/
│ │ │ ├── store.js
│ │ ├── utilities/
│ │ │ ├── axiosInstance.js
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ ├── index.css
│ ├── package.json
│ ├── vite.config.js
│
└── Server/
├── config/
│ ├── connect.db.js
├── controllers/
│ ├── message.controller.js
│ ├── user.controller.js
├── middlewares/
│ ├── auth.middleware.js
│ ├── error.middleware.js
├── models/
│ ├── conversation.model.js
│ ├── message.model.js
│ ├── user.model.js
├── routes/
│ ├── message.route.js
│ ├── user.route.js
├── socket/
│ ├── socket.js
├── utilities/
│ ├── asyncHandler.utility.js
│ ├── errorHandler.utility.js
├── index.js
├── package.json