A real-time chat application with user authentication, online presence indicators, and file sharing capabilities.
- Real-time Messaging: Instant communication between users
- User Authentication: Secure login and registration system
- Online Status: See which users are currently online
- Message History: Access previous conversations
- File Sharing: Send and receive images
- Responsive Design: Works on desktop and mobile devices
- React.js
- Tailwind CSS for styling
- Axios for API requests
- WebSockets for real-time communication
- Node.js with Express
- MongoDB with Mongoose
- JWT for authentication
- WebSocket server (ws)
- ImageKit for file storage
├── Frontend/
│ ├── src/
│ │ ├── Components/
│ │ │ ├── AuthForm.jsx # Login/Register form
│ │ │ ├── Avatar.jsx # User avatar component
│ │ │ ├── Chat.jsx # Main chat interface
│ │ │ ├── Contact.jsx # Contact list item
│ │ │ └── Logo.jsx # App logo component
│ │ ├── Context/
│ │ │ └── userContext.jsx # User authentication context
│ │ ├── Routes/
│ │ │ └── Routes.jsx # Application routing
│ │ ├── Utility/
│ │ │ └── apiRequest.js # Axios configuration
│ │ ├── App.jsx # Root component
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Global styles
│
├── Backend/
│ ├── db/
│ │ └── db.js # Database connection
│ ├── models/
│ │ ├── message.model.js # Message schema
│ │ └── user.model.js # User schema
│ └── index.js # Server entry point
- Node.js (v14+)
- MongoDB
- ImageKit account (for file storage)
VITE_API_ENDPOINT=http://localhost:3000
MONGO_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:5173
IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key
IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key
IMAGEKIT_URL_ENDPOINT=your_imagekit_url_endpoint
-
Clone the repository
git clone https://github.com/yourusername/koowal-chat.git cd koowal-chat -
Install backend dependencies
cd Backend npm install -
Install frontend dependencies
cd ../Frontend npm install -
Start the backend server
cd ../Backend npm start -
Start the frontend development server
cd ../Frontend npm run dev -
Access the application at
http://localhost:5173
- Register or Login: Create a new account or login with existing credentials
- Select a Contact: Click on a user from the sidebar to start chatting
- Send Messages: Type in the input field and press send
- Share Files: Click the attachment icon to upload and send images
The backend is configured to be deployed on platforms like Render, with the WebSocket server attached to the same HTTP server.
The frontend can be deployed on Netlify, Vercel, or any static site hosting service.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
