A full-stack real-time chat app with a premium modern UI, built with React, Node.js, Socket.io, and MongoDB.
| Feature | Status |
|---|---|
| Real-Time Messaging (Socket.io) | β |
| One-to-One Private Chat | β |
| Group Chat (Create / Manage) | β |
| JWT Authentication (Login / Register) | β |
| Online / Offline Presence Indicators | β |
| Typing Indicators | β |
| Read Receipts (Mark as Read) | β |
| Message Reactions (Emoji) | β |
| File Sharing (Image, Video, Audio, Document) | β |
| Drag & Drop File Upload | β |
| Image Lightbox (Zoom, Rotate, Download) | β |
| Message Search within Chat | β |
| Dark / Light Theme Toggle | β |
| Custom Avatar Upload | β |
| User Profile Modal | β |
| Responsive Collapsible Sidebar | β |
| Docker Ready | β |
| Layer | Technology |
|---|---|
| Frontend | React 18 (Vite), React Router v6 |
| Backend | Node.js, Express |
| Real-Time | Socket.io |
| Database | MongoDB (Mongoose ODM) |
| Auth | JWT + bcryptjs |
| File Uploads | Multer (local storage, up to 100MB) |
| Styling | Vanilla CSS (Design tokens, glassmorphism) |
| DevOps | Docker + Docker Compose |
| Scaling | Redis + @socket.io/redis-adapter |
Chat/
βββ client/ # React Frontend
β βββ src/
β βββ components/
β β βββ Authentication/ # Login, Signup, ProfileModal
β β βββ Chat/ # SingleChat, ChatList, SideDrawer
β βββ Context/ # ChatProvider (global state)
β βββ Pages/ # HomePage, ChatPage
β βββ App.css # Global design system
βββ server/ # Node.js Backend
β βββ config/ # DB + Redis config
β βββ middleware/ # auth.js, upload.js
β βββ models/ # User, Chat, Message
β βββ routes/ # auth, chat, message, user
β βββ socket/ # Socket.io event handlers
β βββ server.js
βββ doc/ # Project documentation
βββ docker-compose.yml
βββ README.md
- Node.js v18+
- MongoDB (local or Atlas)
- Redis (optional for local dev)
- Docker (optional)
- Clone the repository
- Install Server Dependencies
cd server npm install - Install Client Dependencies
cd client npm install
- Start the Backend
cd server npm run dev - Start the Frontend
Frontend runs on:
cd client npm run devhttp://localhost:5173
Backend runs on:http://localhost:5000
docker-compose up -d --buildCreate a .env file in the server directory:
PORT=5000
MONGO_URI=mongodb://localhost:27017/chat_app
JWT_SECRET=your_secret_key_here
REDIS_URL=redis://localhost:6379
CLIENT_URL=http://localhost:5173| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user |
| POST | /api/auth/login |
Login and get JWT |
| GET | /api/user |
Search users |
| PUT | /api/user/profile |
Update avatar |
| POST | /api/chat |
Access/create 1-to-1 chat |
| GET | /api/chat |
Fetch all chats |
| POST | /api/chat/group |
Create group chat |
| PUT | /api/chat/rename |
Rename group |
| PUT | /api/chat/groupadd |
Add user to group |
| PUT | /api/chat/groupremove |
Remove user from group |
| GET | /api/message/:chatId |
Fetch messages |
| POST | /api/message |
Send message (with optional file) |
| PUT | /api/message/:chatId/read |
Mark messages as read |
| POST | /api/message/reaction |
Add/remove emoji reaction |
| Event | Direction | Description |
|---|---|---|
setup |
Client β Server | Register user, join personal room |
join chat |
Client β Server | Join a chat room |
new message |
Client β Server | Broadcast new message |
message recieved |
Server β Client | Receive new message |
typing |
Client β Server | User is typing |
stop typing |
Client β Server | User stopped typing |
read_message |
Client β Server | Mark chat as read |
message_read_update |
Server β Client | Sync read status |
message_reaction |
Client β Server | Send emoji reaction |
reaction_update |
Server β Client | Sync reaction changes |
user_online |
Server β Client | User came online |
user_offline |
Server β Client | User went offline |
- Password hashing with bcrypt
- JWT token-based route protection
- Auth guard β unauthenticated users are redirected to login
- File type validation (MIME type + extension)
- 100MB file size limit enforced server-side
- CORS restriction to trusted origin
Sandip Tawhare β Full Stack Developer
Give it a star β and feel free to fork!