A real-time chat application built using the MERN Stack (MongoDB, Express, React, Node.js) with Socket.IO for live messaging. The app supports user authentication, real-time messaging, and image upload via Cloudinary.
/chat-app
│
├── frontend # React + Vite frontend
└── backend # Node.js + Express + MongoDB + Socket.IO backend
- Realtime messaging with Socket.IO
- User authentication using JWT
- Cloud-based image uploads (Cloudinary)
- Fully separated client and server setup
git clone https://github.com/minhtrannguyen-git/chat-app.git
cd chat-app
cd backend
npm install
cd ../frontend
npm install
Make sure both the backend and frontend are running in separate terminals.
cd backend
npm run dev
cd frontend
npm run dev
Create a .env
file and add the following:
PORT=5001
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
NODE_ENV=development
FRONT_END_URL=http://localhost:5173
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
Create a .env
file and add the following:
VITE_BACKEND_SOCKET_URL=http://localhost:5001
