/dj-chat

A Django and htmx project. A fully functional chat app contains group and private or one-on-one chat using websockets and channels.

Primary LanguagePythonMIT LicenseMIT

dj-chat | A django and htmx chat application

Fully functional chat app built with django and htmx with the power of websockets and channels. The app also uses other production-level packages, such as:- channels, redis, django-allauth, django-crispy-forms, django-select2, etc.

The main goal of this project is to show how django and htmx can be used to build a fully functional high quality application. Bootstrap5 is used to design the UI with custom styles.

Screenshot 2023-08-10 155117

Current features:

  • Private Messaging System: Users can engage in private one-on-one chat conversations, known as threads.
  • Group Chat and Discussion Rooms: The application supports group chat functionality, allowing users to participate in discussion rooms centered around specific topics.
  • User Authentication and Management: Users can log in, log out, sign up, and manage(reset/change) their passwords.
  • Chat History Management: Users can clear the chat history within a room, providing them with control over their chat environment.
  • Chat Deletion: Users have the ability to delete entire chat conversations, offering a way to remove outdated or irrelevant discussions.
  • Sorting Options: The discussions can be sorted based on trending topics, newest additions, or oldest discussions, enabling users to find relevant conversations efficiently.
  • Pagination and Infinite Scrolling: The application utilizes pagination with infinite scrolling, allowing users to navigate through discussions seamlessly without page reloads. Messages inside private rooms are fetched automatically on the user scrolls up.
  • Recent Room Display: Users can easily view their recent chat rooms, making it convenient to access frequently visited discussions.
  • Multicast Messaging: Users can send messages to multiple recipients simultaneously.
  • Dynamic Room Creation and Update: Users can create and update discussion rooms in real-time without the need to navigate away from the current page.
  • Real-time Discussion Search: The application performs live discussion searches as users type, eliminating the need for page reloads and providing instant results.
  • Invitation Functionality: Users can invite others to join a discussion room without interrupting their ongoing participation in the conversation.
  • Message Notifications: Users have the option to mute or unmute message notifications, controlling their visibility and managing distractions.

Prerequisites:

The following programs are required to run the project

Installation

  • First Clone the repo with git clone https://github.com/adilmohak/dj-chat.git

  • Create and activate a python virtual environment

  • pip install -r requirements.txt

  • Create a .env file inside the root directory (Same directory where manage.py is located)

  • Inside your .env file put the following variables

DB_NAME=[NAME_OF_YOUR_DB]
DB_USER=[DB_USERNAME]
DB_PASSWORD=[DB_PASSWORD]
DB_HOST=localhost
DB_PORT=[DB_PORT]
  • python manage.py makemigrations

  • python manage.py migrate

  • redis-server

The above command will start the redis server

Connect with me

linkedin github stackoverflow facebook

Show your support by ⭐️ this project