Real Time Chat App Using Django, Channels, JavaScript, Docker, Tailwind CSS and much more..
- Features
- Screenshots
- Tech Stack
- Getting Started
- Deploy
- Bug Reporting
- Feature Request
- Change Log
- License
- Real-time messaging: The app allows users to send and receive messages in real-time, providing a seamless chatting experience.
- Django and Channels: The app is built using the Django web framework and Channels, which extends Django to handle WebSockets and other asynchronous protocols.
- JavaScript: The app uses JavaScript to provide a dynamic and interactive user interface.
- Docker: The app can be containerised using Docker, making it easy to deploy and manage.
- Tailwind CSS: The app uses Tailwind CSS, a utility-first CSS framework, to style the user interface.
Is there anything else you would like to know about this chat app?
- WebSockets - WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection.
- Django - Django makes it easier to build better web apps more quickly and with less code.
- Django Channels - Channels is a project that takes Django and extends its abilities beyond HTTP - to handle WebSockets, chat protocols, IoT protocols, and more.
- Vite - Next Generation Frontend Tooling.
- Tailwind 3 - Rapidly build modern websites without ever leaving your HTML.
- Docker - Docker is a platform designed to help developers build, share, and run modern applications. We handle the tedious setup, so you can focus on the code.
- Postgres DB - The World's Most Advanced Open Source Relational Database.
- Clone the project and make it your own.
mkdir ~/Dev
cd ~/Dev
git clone https://github.com/Arvind-4/Chatapp.git
cd Chatapp
- Create virtual environment and activate it.
python3.9 -m venv .
source bin/activate
Use .\venv\Scripts\activate
if on Windows.
- Install requirements
$(Chatapp) python -m pip install pip --upgrade
$(Chatapp) python -m pip install -r requirements.txt
- Open VS Code
code .
- Create
.env
file:
Add Your Credentials .env
from .env.sample
:
PYTHON_VERSION=
DJANGO_PG_PASSWORD=iz-MAIesYif5c8d53pEnAg
DJANGO_PG_HOST=db
DJANGO_PG_USER=admin
DJANGO_PG_DATABASE=chatdb
DJANGO_PG_PORT=5432
DJANGO_REDIS_HOST=redis
DJANGO_REDIS_PORT=6379
DJANGO_SUPERUSER_EMAIL=
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_PASSWORD=-_cYnxeqvWQKhCUe_AJn8Q
DJANGO_SECRET_KEY=P_wXmuyfulz3qZTe3bAmRw5d0-9maJ5PIIVDMjMIm1gw
DJANGO_ADMIN_URL=admin/
DJANGO_DEBUG=1
DJANGO_ALLOWED_HOSTS=*
DJANGO_REDIS_AVAILABLE=0
DJANGO_HTTPS_SECURITY=0
DJANGO_LIVE=0
POSTGRES_PASSWORD=iz-MAIesYif5c8d53pEnAg
POSTGRES_USER=admin
POSTGRES_DB=chatdb
Replace your SECRET_KEY
with a new one using the code Below.
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
Or
bash commands/secret.sh
- Build and Start the Docker File:
Below will start a Docker Instance on your local machine to match the .env
from the previous step.
docker compose -f docker-compose.selfhost.yaml build
Start the Docker Build Image:
docker compose -f docker-compose.selfhost.yaml up
- Run Django Commands & Migrations and Create Superuser
cd ~/Dev/Chatapp
source bin/activate
$(Chatapp) python manage.py makemigrations
$(Chatapp) python manage.py migrate
$(Chatapp) python manage.py createsuperuser
Run the server:
$(Chatapp) python manage.py runserver
- Install & Build the Front end.
Install the Required Dependencies
npm run bootstrap
Build the Front end for Production
npm run production
Click the Button to Deploy to Render.
OR
Self Host using Docker, Docker Compose in a VM :)
Feel free to open an issue on GitHub if you find any bug.
- Feel free to Open an issue on GitHub to request any additional features you might need for your use case.
- Connect with me on LinkedIn. I'd love ❤️️ to hear from you.
Check here for change logs.
This software is open source, licensed under the MIT License.