Chat Hub MERN is a sleek and user-friendly real-time chat application. Using cutting-edge web technologies, it enables users to create or join rooms and engage in seamless real-time conversations.
- Secure Authentication: JWT-based authentication system with bcrypt password hashing.
- User Registration: Complete signup process with email verification.
- User Profiles: Customizable user profiles with avatars and status messages.
- Create Room: Generate unique 12-character room codes with UUID for secure room creation.
- Join Room: Easy room access using shared room codes.
- Room Features:
- Real-time participant list
- Room status indicators
- Active user tracking
- Message Features:
- Real-time message delivery with Socket.IO
- Message timestamps using Moment.js
- Read receipts
- Infinite scroll for message history
- UI/UX:
- Material-UI components for modern design
- Responsive layout for all devices
- Framer Motion animations
- Toast notifications for important events
- Core: React.js (v18)
- UI Framework: Material-UI (v6)
- State Management: React Hooks
- Form Handling: React Hook Form with Yup validation
- Routing: React Router DOM (v6)
- Real-time: Socket.IO Client
- Performance: React Virtualized for efficient list rendering
- Runtime: Node.js with Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT, bcrypt
- Real-time: Socket.IO
- API Security: CORS enabled
chat-hub-mern/ ├── client/ │ ├── src/ │ ├── public/ │ └── package.json ├── server/ │ ├── config/ │ ├── controllers/ │ ├── middleware/ │ ├── models/ │ ├── routes/ │ └── server.js └── package.json
- Clone the Repository:
git clone https://github.com/your-username/chat-hub-mern.git cd chat-hub-mern
- Install Dependencies:
# Install server dependencies cd server npm install
cd ../client npm install
- Environment Configuration:
Create a .env file in the server directory with:
MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key PORT=5000 NODE_ENV=development
- Start the Application:
- Development Mode:
# Start server with nodemon cd server npm run dev
cd client npm start
- Production Mode:
# Build client cd client npm run build
cd ../server npm start
- Development Mode:
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginGET /api/auth/profile
- Get user profile
POST /api/rooms
- Create new roomGET /api/rooms/:code
- Join room by codeGET /api/rooms/user
- Get user's rooms
To contribute to this project:
- Fork this repository
- Create a new branch:
git checkout -b feature-name
- Make your changes and commit:
git commit -m "Added new feature"
- Push the changes:
git push origin feature-name
- Create a pull request
- Follow the existing code style and conventions
- Write clear commit messages
- Add appropriate comments and documentation
- Test your changes thoroughly
This project is licensed under the MIT License.
- Material-UI for the beautiful components
- Socket.IO for real-time capabilities
- MongoDB Atlas for database hosting
Chat Hub MERN: Connecting people in real-time like never before!