A modern WhatsApp/Telegram-inspired real-time messaging application built using the MERN Stack, Socket.io, and AES-256 encryption for secure communication.
NexusChat delivers a fast, secure, and responsive messaging experience with real-time communication, encrypted chats, media sharing, typing indicators, reactions, and advanced messaging features.
- Real-time bidirectional messaging
- Instant message delivery
- Typing indicator
- Date separators
- Last seen status
- Online/offline presence
- Read receipts
- ✓ Sent
- ✓✓ Delivered
- 🔵✓✓ Read
- AES-256-CBC message encryption using CryptoJS
- Random IV generation for every message
- Shared key derivation using SHA-256
- JWT Authentication with httpOnly cookies
- Encrypted message storage in MongoDB
- Server never stores plaintext messages
- Emoji reactions
- Edit messages
- Delete for me
- Delete for everyone
- WhatsApp + Telegram inspired dark UI
- Responsive mobile-friendly design
Supports sharing:
- Images
- Videos
- Audio files
- PDFs
- Documents
Additional media features:
- Image preview lightbox
- File attachment handling
- Profile picture upload
| Category | Technology |
|---|---|
| Frontend | React 18, Vite |
| State Management | Zustand |
| Backend | Node.js, Express.js |
| Database | MongoDB, Mongoose |
| Real-Time Communication | Socket.io |
| Authentication | JWT + Cookies |
| Encryption | CryptoJS (AES-256) |
| File Uploads | Multer |
| HTTP Client | Axios |
| Styling | Pure CSS |
NexusChat/
│
├── backend/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── socket/
│ ├── uploads/
│ └── server.js
│
├── frontend/
│ ├── src/
│ ├── public/
│ └── vite.config.js
│
└── README.mdMake sure these are installed:
- Node.js v18+
- MongoDB (Local or Atlas)
- Git
cd backend
npm installCreate .env file inside backend folder:
PORT=5000
MONGO_URI=mongodb://127.0.0.1:27017/nexuschat
JWT_SECRET=your_super_secret_key
NODE_ENV=developmentCreate uploads directory:
mkdir uploadsRun backend server:
npm run devcd frontend
npm install
npm run devFrontend runs on:
http://localhost:5173NexusChat uses secure client-side encryption flow:
- Shared secret generated using SHA-256
- AES-256 encryption performed before sending
- Random IV generated per message
- Only encrypted ciphertext stored in database
- Receiver decrypts message locally
- Server never accesses plaintext data
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
Register user |
| POST | /api/auth/login |
Login user |
| POST | /api/auth/logout |
Logout user |
| GET | /api/users |
Fetch all users |
| GET | /api/messages/:id |
Fetch messages |
| POST | /api/messages/send/:id |
Send message |
| Event | Purpose |
|---|---|
newMessage |
Receive new messages |
typing |
Typing indicator |
stopTyping |
Stop typing event |
messageEdited |
Edit message |
messageDeleted |
Delete message |
messageReaction |
Emoji reactions |
messagesRead |
Read receipts |
getOnlineUsers |
Online users list |
| Service | Platform |
|---|---|
| Frontend | Vercel / Netlify |
| Backend | Render / Railway |
| Database | MongoDB Atlas |
- 📹 Voice & Video Calling
- 👥 Group Chats
- 🔔 Push Notifications
- 🤖 AI Chatbot Integration
- 🌐 Multi-language Support
- ☁️ Cloud Media Storage
- 📱 PWA Mobile Support
M Pavan
MCA Student
Full Stack MERN Developer
✅ Production-Ready Real-Time MERN Chat Application
This project is developed for educational and portfolio purposes.