This is a full-stack real-time chat application built with the MERN stack (MongoDB, Express, React, Node.js) and Socket.io.
- User authentication (login/signup)
- Real-time messaging with Socket.io
- Online user status
- User profiles and profile updates
- Image uploads with Cloudinary
Frontend:
- React
- Socket.io-client
- Axios
- React Router
- Tailwind CSS
Backend:
- Node.js
- Express
- MongoDB
- Socket.io
- JWT for authentication
- Cloudinary for image storage
- Node.js (v14 or later)
- npm
- MongoDB Atlas account or local MongoDB installation
-
Clone the repository:
git clone https://github.com/your-username/chat-app.git cd chat-app -
Install server dependencies:
cd server npm install -
Install client dependencies:
cd ../client npm install
Create a .env file in the server directory and add the following environment variables:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
# Cloudinary credentials
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
Create a .env file in the client directory and add the following environment variable:
VITE_BACKEND_URL=http://localhost:5000
-
Start the server:
cd server npm start -
Start the client:
cd ../client npm run dev
The application will be available at http://localhost:3000.