Skip to content

aditya07389/ChatApplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

ChatApplication

A real-time chat application built with Django.

Screenshots of the Application:

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5

How to use ?

  1. Create a superuser(this is the user who will be the customer support).
  2. Register/Signup another user.
  3. Login with credentials of the registered user in one window.
  4. Login with admin credentials in another window.
  5. Test out the chat functionality.

Prerequisites

Make sure you have the following installed:

  • Python 3.8+
  • pip
  • Virtualenv (optional but recommended)

Setup Instructions

  1. Clone the Repository

    git clone <repository-url>
    cd ChatApplication
    cd ChatApp
  2. Create a Virtual Environment

    It's recommended to use a virtual environment to manage dependencies.

    # On macOS/Linux
    python3 -m venv venv
    source venv/bin/activate
    
    # On Windows
    python -m venv venv
    .\venv\Scripts\activate
  3. Install Dependencies

    Install the required packages listed in requirements.txt.

    pip install -r requirements.txt
  4. Apply Migrations

    Run the following commands to set up the database schema:

    python manage.py makemigrations
    python manage.py migrate
  5. Create a Superuser

    To access the Django admin interface, create a superuser account:

    python manage.py createsuperuser
  6. Run the Development Server

    Start the Django development server to test your app locally.

    python manage.py runserver
  7. Access the Application

    Open your browser and go to:

    http://127.0.0.1:8000
    

Additional points :

  1. Database Configuration

    This project uses SQLite as the default database for demonstration purposes. SQLite is suitable for local development but not recommended for production.

    Replacing SQLite for Production

    • For production, consider replacing SQLite with a more robust database, like PostgreSQL or MySQL.
    • Update the DATABASES setting in settings.py with your chosen database configuration.

    Example configuration for PostgreSQL:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'NAME': 'your_db_name',
            'USER': 'your_db_user',
            'PASSWORD': 'your_password',
            'HOST': 'localhost',
            'PORT': '5432',
        }
    }
  2. Channel Layers Configuration

    This project uses Django Channels with an InMemoryChannelLayer for demonstration. The InMemoryChannelLayer is a basic in-memory backend useful for development and testing.

    Replacing InMemoryChannelLayer for Production

    • For production, use Redis as the channel layer backend, which is more reliable for handling real-time events in a distributed system.
    • Update the CHANNEL_LAYERS setting in settings.py:

    Example configuration with Redis:

    CHANNEL_LAYERS = {
        'default': {
            'BACKEND': 'channels_redis.core.RedisChannelLayer',
            'CONFIG': {
                "hosts": [('127.0.0.1', 6379)],
            },
        },
    }

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published