A full-stack real-time chat application built with React + Vite and Express.js, powered by Socket.io for instant communication and WebRTC for peer-to-peer calls.
🧪 Test Credentials:
- Username:
alice - Password:
password123
- Frontend: React + Vite (UI + state management)
- Backend: Express.js + Socket.io (API + real-time events)
- Database: MongoDB (encrypted message storage)
- Media Storage: Cloudinary
- Realtime: WebSockets (Socket.io)
- Calling: WebRTC (with Socket.io signaling)
- Caching: IndexedDB (stale-while-revalidate)
- Stale-while-revalidate caching with IndexedDB for instant chat loads
- Real-time message lifecycle (sent → delivered → read)
- WebRTC-based peer-to-peer video & voice calls
- AES-256 encryption for messages at rest
- Rate limiting & security via Helmet + express-rate-limit
- JWT-based login/signup
- Password hashing with bcrypt
- AES-256 encrypted message storage
- Rate limiting & abuse protection
- Real-time 1-on-1 and group chats
- Message reactions and emojis
- Reply to messages (quoted replies)
- Edit messages with
(edited)indicator - Delete for everyone
- Message forwarding
- Read receipts (✔️ sent / ✔️✔️ read)
- Typing indicators
- Unread message tracking
- In-chat search functionality
- Drag & drop image/video uploads
- Upload progress indicators
- Cloudinary media storage
- WebRTC 1-on-1 video calls
- Audio-only voice calls
- Call logs (missed/completed)
- Magic Reply (Google Gemini API)
- Tone-based smart suggestions
- Create/manage groups
- Admin roles & permissions
- System messages (join/leave updates)
- Custom avatars
- Public/Private profile toggle
- Offline-first chat loading (IndexedDB caching)
- Smooth mobile + desktop experience
- Resizable sidebar layout
- Dark/Light theme + custom colors
- Zustand for global state
- Mantine UI for modern design
mern-chat-app/
├── backend/
│ ├── controllers/
│ ├── db/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── socket/
│ ├── utils/
│ └── server.js
└── frontend/
├── public/
└── src/
├── components/
├── context/
├── hooks/
├── pages/
├── utils/
├── zustand/
├── App.jsx
└── main.jsx
Frontend: React, Mantine UI, Zustand, Socket.io-client, idb, react-router-dom
Backend: Express.js, Socket.io, MongoDB, JWT, bcryptjs, Cloudinary, Gemini API
- Bun installed
- MongoDB database
cd frontend
bun install
cd ../backend
bun installPORT=5000
MONGO_DB_URI=
JWT_SECRET=
NODE_ENV=development
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
ENCRYPTION_KEY=
GEMINI_API_KEY=cd backend
bun run seedcd backend
bun run devcd frontend
bun run dev- Create an account or log in
- Start real-time conversations with users
- Send text, emojis, media, and voice messages
- Track delivery and read status
- Make video or voice calls
- Manage groups and participants
- Use AI-powered reply suggestions
- Search and revisit past messages
- Customize UI (theme, layout, profile)

