This is a real-time chat application built using Django Channels for the backend and React for the frontend. The app supports WebSocket-based real-time messaging and uses Tailwind CSS for styling.
Clone the repository:
git clone <repository_url>
cd <repository_folder>
Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install the dependencies:
pip install -r requirements.txt
Apply migrations:
python manage.py migrate
Run the development server:
python manage.py runserver
Ensure the WebSocket endpoint is running at:
ws://127.0.0.1:8000/ws/chat/<room_name>/
### Frontend Setup
1. Navigate to the `frontend` folder:
```bash
cd frontend
Install dependencies:
npm install
Start the React development server:
npm start
Access the frontend at http://localhost:3000.
backend/
├── chatapp/ # Django project settings
├── chat/ # Chat app for handling WebSocket logic
├── manage.py # Django entry point
└── requirements.txt# Python dependencies
frontend/
├── public/ # Static files
├── src/ # React components and styles
│ ├── components/ # Chatroom and MessageInput components
│ └── App.js # Main app entry point
├── tailwind.config.js # Tailwind configuration
└── package.json # Node.js dependencies
The frontend is styled using Tailwind CSS. Tailwind classes are used for a clean, responsive, and modern UI. You can customize the design by modifying the tailwind.config.js
file and updating component class names.
git checkout -b feature-name
git commit -m "Add feature-name"
git push origin feature-name
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding!