π Authentication β’ π¬ Real-time messaging β’ π’ Online users β’ πΌοΈ Cloudinary uploads
Chatify is a full-stack real-time chat app built with Node.js, Express, MongoDB, React (Vite), and Socket.IO.
- Frontend (Vercel): https://chatify-plum.vercel.app/
- Backend (Render): https://chatify-backend-4qij.onrender.com/
π A production-ready real-time chat app with a scalable MERN backend and low-latency Socket.IO messaging.
- π Cookie-based JWT authentication (signup/login/logout)
- π¬ Real-time chat with Socket.IO
- π’ Online user tracking
- πΌοΈ Profile picture upload via Cloudinary
- π¨ Modern UI (React + Tailwind) with Zustand state management
- Backend: Node.js, Express, MongoDB (Mongoose), JWT (cookie-based), Socket.IO
- Frontend: React, Vite, Zustand, Axios, Tailwind CSS, Socket.IO Client
- Media: Cloudinary (uploads stored in Cloudinary, DB stores image URL)
LIVE_CHAT/
βββ Readme.md
βββ Home.png
βββ Login.png
βββ Backend/ # Express + MongoDB + Socket.IO
β βββ src/
β β βββ app.js # Express app + socket bootstrap
β β βββ controllers/
β β β βββ authController.js
β β β βββ messageController.js
β β βββ routes/
β β β βββ authRoute.js
β β β βββ messageRoute.js
β β βββ middlewares/
β β β βββ authMiddleware.js
β β βββ model/
β β β βββ userModel.js
β β β βββ messageModel.js
β β βββ lib/
β β βββ cloudinary.js
β β βββ socket.js
β β βββ token.js
β βββ package.json
β βββ .env.example
βββ Frontend/
βββ vite-project/ # React (Vite) client
βββ src/
β βββ Pages/
β β βββ HomePage.jsx
β β βββ LoginPage.jsx
β β βββ ProfilePage.jsx
β β βββ SignUpPage.jsx
β βββ components/
β β βββ ChatContainer.jsx
β β βββ ChatHeader.jsx
β β βββ MessageInput.jsx
β β βββ Messages.jsx
β β βββ Navbar.jsx
β β βββ NoChatSelected.jsx
β β βββ Sidebar.jsx
β β βββ UserChatHeader.jsx
β βββ store/
β β βββ authStore.js
β β βββ chatStore.js
β βββ lib/
β β βββ axios.js
β β βββ utils.js
β βββ App.jsx
β βββ main.jsx
βββ public/
βββ vite.config.js
βββ package.json
- Node.js installed
- MongoDB connection string (Atlas or local)
- Cloudinary account
cd Backend
npm installCreate Backend/.env (copy from Backend/.env.example):
copy .env.example .envStart backend:
npm startcd Frontend/vite-project
npm installCreate Frontend/vite-project/.env (copy from .env.example):
copy .env.example .envStart frontend:
npm run dev| Variable | Required | Description |
|---|---|---|
PORT |
β | Server port |
MONGODB_URI |
β | MongoDB connection string |
secretKey |
β | JWT secret used to sign cookies |
CLIENT_URL |
β | Frontend URL allowed by CORS (Vercel domain) |
CLOUDINARY_CLOUD_NAME |
β | Cloudinary cloud name |
CLOUDINARY_API_KEY |
β | Cloudinary API key |
CLOUDINARY_SECRET_KEY |
β | Cloudinary API secret |
| Variable | Required | Description |
|---|---|---|
VITE_API_BASE_URL |
β | Backend API base URL (e.g. http://localhost:5000/api) |
VITE_SOCKET_URL |
β | Backend socket URL (e.g. http://localhost:5000) |
- Deploy
Backend/as a Node service. - Set env vars from
Backend/.envin Render dashboard. - Set
CLIENT_URL= your Vercel frontend domain.
- Deploy
Frontend/vite-project/. - Set
VITE_API_BASE_URLandVITE_SOCKET_URLto your deployed Render backend URLs.
- Fixed CORS issues during deployment
- Managed socket connections across environments
- Handled cookie-based authentication in production
- CORS errors: make sure backend
CLIENT_URLmatches your deployed frontend domain. - Socket not connecting: ensure
VITE_SOCKET_URLpoints to backend. - Uploads failing: verify Cloudinary env vars.
Built by Avinash.

