A modern, feature-rich realtime chat application built with the MERN stack (MongoDB, Express.js, React, Node.js) and Socket.IO.
-
🔐 User Authentication
- Secure signup and login
- JWT-based authentication
- Protected routes
-
💬 Real-time Messaging
- Instant message delivery
- Online/offline user status
- Message timestamps
- Image sharing support
- Read receipts
-
👤 User Profile
- Customizable profile pictures
- Profile information management
- Cloudinary integration for image storage
-
🎨 Customizable Themes
- 30+ built-in themes
- Live theme preview
- Persistent theme preferences
-
📱 Responsive Design
- Mobile-friendly interface
- Adaptive layout
- Smooth transitions
- React.js
- Zustand (State Management)
- TailwindCSS + DaisyUI
- Socket.IO Client
- React Router DOM
- Axios
- React Hot Toast
- Node.js
- Express.js
- MongoDB with Mongoose
- Socket.IO
- JWT Authentication
- Cloudinary
- CORS
- Cookie Parser
- Node.js (v14 or higher)
- MongoDB
- npm or yarn
- Cloudinary account
- Clone the repository
git clone https://github.com/yourusername/Realtime-Chat-App.git
cd Realtime-Chat-App- Install dependencies
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm install- Environment Variables
Create a .env file in the backend directory:
PORT=YOUR_PORT
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
NODE_ENV=development
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret- Run the application
Development mode:
# Run backend
cd backend
npm run dev
# Run frontend (in a new terminal)
cd frontend
npm run devProduction mode:
# Build and start
npm run build
npm start- Secure password hashing with bcrypt
- JWT token-based authentication
- Protected API routes
- Persistent login sessions
- Socket.IO for real-time message delivery
- Online user tracking
- Typing indicators
- Message status updates
- Image upload support
- Cloudinary integration for media storage
- Preview before sending
- Multiple file formats supported
- Clean and modern design
- Responsive layout
- Loading skeletons
- Toast notifications
- Error handling
- POST
/api/auth/signup- Create new user - POST
/api/auth/login- User login - POST
/api/auth/logout- User logout - PUT
/api/auth/update-profile- Update user profile - GET
/api/auth/check- Check authentication status
- GET
/api/messages/users- Get all users for sidebar - GET
/api/messages/:id- Get messages with specific user - POST
/api/messages/send/:id- Send message to user
- Fork the repository
- Create your feature branch (`git checkout -b feature/AmazingFeature`)
- Commit your changes (`git commit -m 'Add some AmazingFeature'`)
- Push to the branch (`git push origin feature/AmazingFeature`)
- Open a Pull Request
This project is licensed under the ISC License.
- Socket.IO for real-time communication
- Cloudinary for image hosting
- DaisyUI for UI components
- All contributors and supporters