A modern full-stack real-time chat application built with the MERN stack and Socket.IO.
The application provides secure authentication, real-time messaging, persistent chat history, file and image sharing, message reactions, reply functionality, online user tracking, and a responsive modern interface.
Built to demonstrate practical full-stack development, real-time communication, REST API integration, authentication, database management, and production deployment.
Frontend: https://gleaming-fairy-e0fcdc.netlify.app/
- π JWT-based user authentication
- π Password hashing with bcrypt
- π€ User-based chat experience
- π¬ Instant real-time messaging with Socket.IO
- π’ Online user tracking
- β¨οΈ Live typing indicators
- π₯ Chat rooms
- π Real-time message updates
- β©οΈ Reply to messages
- β€οΈ Message reactions
- ποΈ Delete messages
- π File sharing
- πΌοΈ Image sharing
- πΎ Persistent chat history
- π Dark and light themes
- π± Responsive design
- β¨ Smooth animations
- π¨ Modern interface with Tailwind CSS
- β‘ Real-time UI updates
- React.js β User interface
- Vite β Development and build tooling
- Tailwind CSS β Styling and responsive design
- Framer Motion β UI animations
- Socket.IO Client β Real-time communication
- Node.js β Server-side runtime
- Express.js β REST API and backend framework
- Socket.IO β Real-time bidirectional communication
- MongoDB Atlas β Database
- Mongoose β MongoDB object modeling
- JWT β Authentication
- bcryptjs β Password hashing
- Netlify β Frontend deployment
- Render β Backend deployment
- MongoDB Atlas β Database hosting
ββββββββββββββββββββ
β React β
β Frontend β
ββββββββββ¬ββββββββββ
β
βββββββββββββ΄ββββββββββββ
β β
REST API Socket.IO
β β
βββββββββββββ¬ββββββββββββ
β
ββββββββββΌββββββββββ
β Express β
β + Node.js β
ββββββββββ¬ββββββββββ
β
ββββββββββΌββββββββββ
β MongoDB β
β Atlas β
ββββββββββββββββββββ
The frontend communicates with the backend through REST APIs for application operations, while Socket.IO handles real-time events such as messages, typing indicators, and online user updates.
User sends message
β
React emits Socket.IO event
β
Socket.IO server receives event
β
Message is processed
β
Message is stored in MongoDB
β
Server emits message to connected users
β
React UI updates instantly
This architecture allows users to communicate without manually refreshing the page.
Chat-App/
β
βββ Frontend/
β βββ src/
β β βββ assets/
β β βββ components/
β β βββ pages/
β β βββ ...
β βββ public/
β βββ package.json
β
βββ Backend/
β βββ models/
β βββ routes/
β βββ middleware/
β βββ uploads/
β βββ index.js
β βββ package.json
β
βββ README.md
gh repo clone Abdullah-Asim-dev/websocket-appOr:
git clone https://github.com/Abdullah-Asim-dev/websocket-app.gitcd Frontend
npm install
npm run devOpen a new terminal:
cd Backend
npm install
npm startCreate a .env file inside the Backend directory:
PORT=7777
MONGO_URI=your_mongodb_connection_string
FRONTEND_URL=http://localhost:5173Create a .env file inside the Frontend directory:
VITE_BACKEND_URL=http://localhost:7777For production, configure the frontend and backend environment variables with your deployed application URLs.
Security: Never commit
.envfiles, database credentials, JWT secrets, or API keys to a public repository.
User Registration / Login
β
Express API
β
Credentials Check
β
JWT Generated
β
Authenticated User
β
Protected Chat Features
JWT is used to authenticate users and protect application functionality, while bcrypt is used to securely hash passwords.
Socket.IO powers the application's real-time communication layer.
The project uses real-time events for features such as:
- New messages
- Typing indicators
- Online/offline user status
- Message updates
- Real-time UI synchronization
This provides a more responsive experience compared with traditional request-and-refresh communication.
The React application is deployed on Netlify.
Live Demo: https://gleaming-fairy-e0fcdc.netlify.app/
The Node.js and Express backend is deployed on Render.
The application uses MongoDB Atlas for persistent data storage.
- Full-stack MERN application
- Real-time communication using Socket.IO
- JWT authentication and protected functionality
- MongoDB database integration
- Persistent chat history
- File and image sharing
- Real-time online user tracking
- Typing indicators
- Responsive modern UI
- Production deployment with separate frontend and backend services
Abdullah Asim
MERN Stack Developer | React Developer
- GitHub: https://github.com/Abdullah-Asim-dev
- LinkedIn: https://www.linkedin.com/in/abdullah-asim-dev/
This project was built for learning, development, and portfolio purposes.