Chat App

Built with

React.jsZustandAxiosDaisyUITailwind CSSSocket.IO ClientNode.jsExpress.jsMongoDBMongooseSocket.IOJWTMulterImageKit

๐Ÿ’ฌ MERN Chat App

A real-time full-stack chat application built with the MERN Stack, Socket.IO, JWT (Cookies), ImageKit, and styled beautifully using DaisyUI + Tailwind CSS.


๐Ÿš€ Features

  • ๐Ÿ” JWT Authentication with HTTP-only cookies
  • โšก Real-time Messaging using Socket.IO
  • ๐Ÿ’ฌ Send Text, Images, and Files
  • ๐Ÿ–ผ๏ธ Upload optimized images via ImageKit
  • ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ One-to-One chat functionality
  • ๐ŸŒ™ Fully responsive with DaisyUI components (modals, chat bubbles, alerts, etc.)
  • ๐Ÿงพ Persistent login using cookie-based auth
  • ๐Ÿ”Œ Socket reconnect handling and session recovery

๐Ÿ› ๏ธ Tech Stack

๐Ÿงฉ Frontend

  • React.js
  • DaisyUI (built on Tailwind CSS)
  • Axios with withCredentials: true
  • Socket.IO Client
  • React Router DOM
  • Zustand

โš™๏ธ Backend

  • Node.js + Express.js
  • MongoDB with Mongoose
  • Socket.IO for WebSocket support
  • JWT for authentication
  • Multer for file uploads
  • ImageKit SDK for image CDN/hosting

๐ŸŽจ UI Design with DaisyUI

Key components:

  • ๐Ÿ’ฌ chat, chat-bubble โ€“ message UI
  • ๐Ÿ“ค modal โ€“ for file/image uploads
  • ๐Ÿ”˜ button, input, textarea โ€“ forms and inputs
  • ๐ŸŒ“ theme โ€“ supports dark/light modes
  • ๐Ÿ”” alert, toast โ€“ feedback components

DaisyUI themes are easy to switch (e.g. light, dark, cupcake, retro, etc.)


๐Ÿ“ Message Types

TypeDescription
TextPlain messages with emoji support ๐Ÿ˜„
ImageUploaded via ImageKit CDN
FileAny document (PDF, DOCX, etc.)

๐Ÿ”„ Real-Time Messaging

  • Socket connection on login
  • Instant message delivery
  • Socket disconnects on logout

๐Ÿง  Authentication Flow

  1. Login/Register โ†’ Sets JWT in HTTP-only cookie
  2. Frontend sends requests with cookies (withCredentials: true)
  3. Backend Middleware verifies token
  4. Logout โ†’ clears the cookie and disconnects socket