A real-time private messaging chat application built using the MERN stack (MongoDB, Express, React, Node.js) with WebSocket support.
- Real-Time Messaging: Users can chat back and forth instantly using WebSockets.
- Message History: All messages are saved in the database. When a user logs back in, their entire chat history is visible.
- Offline Message Support: Messages sent while a recipient is offline are saved and retrieved when they come online.
- User Status Tracking: Online and offline users are clearly shown.
- Private Messaging: Chats are private and uniquely stored per sender and recipient, so users only see messages relevant to that specific conversation.
- React
- TailwindCSS β For modern and responsive UI design
- Formik & Yup β For handling and validating login/register forms
- React Redux β For managing global state
- Redux Persist β For storing user data locally, preventing frequent re-logins
- React Router β For routing and navigation between pages
- Node.js
- Express.js
- WebSockets β For real-time bi-directional communication
- MongoDB β To store users and messages
- JSON Web Token (JWT) β For secure authentication
- bcrypt β For hashing passwords
- Passwords are securely hashed using bcrypt before being stored.
- JSON Web Tokens are used to authenticate and protect user sessions.
- Messages are stored with both sender and recipient IDs to ensure chat privacy and conversation history.
- When users reconnect or reload the app, their stored messages are retrieved from MongoDB.
- Offline messages are handled through backend persistence therefore no messages are lost during disconnection.
Feel free to contribute, fork, or customize this project to suit your own needs.