Skip to content

Our project is a chat application built using Python, Django, Django Channels, WebSocket, Tailwind CSS, JavaScript, and SQLite3. It aims to provide a seamless and secure messaging experience for users across different platforms.

Notifications You must be signed in to change notification settings

praks7v/chat-app

Repository files navigation

Chat App

Our project is a chat application built using Python, Django, Django Channels, WebSocket, Tailwind CSS, JavaScript, and SQLite3. It aims to provide a seamless and secure messaging experience for users across different platforms.

Key Features:

  • Real-time messaging using Django Channels and WebSocket.
  • Responsive and sleek user interface crafted with Tailwind CSS and JavaScript.
  • Data management powered by Postgresql for efficient storage and retrieval.
  • Emphasis on security with end-to-end encryption and robust authentication mechanisms.

Objective:

Our goal is to deliver a feature-rich and user-friendly chat application that prioritizes privacy and usability, empowering individuals and businesses to communicate effectively in today's digital landscape.

Getting Started

These instructions will help you set up a local development environment.

Prerequisites

  • Be using Linux, WSL or MacOS, with bash, make etc.
  • Python 3.x - for running locally, linting, running tests etc.

Clone the repo

git clone https://github.com/praks7v/chat-app.git

1. Run locally

cd chatapp
make venv
make install
make makemigrations
make migrate
make run

Usage

Visit http://localhost:8000 to access the application.

2. Create a Docker Image and Run Docker Container

To build the Docker image run the following command:

docker build . -t chatapp-web:latest -f docker/Dockerfile

To build the Docker image using docker compose:

docker compose -f docker/docker-compose.yaml build

To run the Docker container, use the following command:

docker run -p 8000:8000 chatapp-web:latest

To run the Docker container using docker compose, use the following command:

docker compose -f docker/docker-compose.yaml up

This command maps port 8000 in the container to port 8000 on your host machine. You can access the application by navigating to http://localhost:8000.

3. Create a Jenkins Pipeline

  • Follow the Jenkins official documentation for Jenkins Installation.
  • To run sonarqube docker iamge, use the following command:
docker run -d --name sonarqube -p 9000:9000 sonarqube:lts-community

To access the sonarqube on browser http://localhost:9000/.

  • Configure Jenkins:
    • Open Jenkins and navigate to the "New Item" page.
    • Create a new Pipeline job and configure it to use the Jenkinsfile from the repository.
    • Plugins to install:
      • docker plugins
      • OWASP Dependency-Check Plugin
      • Pipeline
      • SonarQube Scanner for Jenkins
    • Configure tools:
      • Docker
      • OWASP Dependency-Check
      • SonarQube
    • System configure:
      • Sonarqube

4. Deploy Application on Minikube Cluster

  • Follow the Minikube official documentation for Minikube Installation.

    Start Minikube:

    minikube start
    

    Verify Minikube Status:

    minikube status
    

    Minikube comes with an Ingress addon which you need to enable:

    minikube addons enable ingress
    

    Activate Minikube docker environment:

    eval $(minikube docker-env)
    

    Add an entry to your /etc/hosts file to map chatapp.com to the Minikube IP:

    echo "$(minikube ip) chatapp.com" | sudo tee -a /etc/hosts
    

    Build Docker image:

    docker compose build . -f docker/docker-compose.yaml
    

    Apply Kubernetes configurations:

    kubectl apply -f argocd/manifests
    

    Check the status of Deployments

    kubectl get all
    

    Access the applicaton on web:

    http://chatapp.com
    

    Create a Superuser into the container

    docker exec -it  <container_name_or_id> python manage.py createsuperuser
    kubectl exec -it -n chatapp <conatainer_name_or_id> python manage.py createsuperuser
    

Login to Django admin and add chat_rooms

http://localhost:8000/admin

5. Deploy ArgoCD for Contineuos Delivery

Installing ArgoCD

  • Using kubectl

Create the Argo CD namespace:

kubectl create namespace argocd

Install Argo CD components:

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Accessing the Argo CD API Server:

To access the Argo CD API server, use port forwarding:

kubectl port-forward svc/argocd-server -n argocd 8080:443

Open your browser and navigate to https://localhost:8080.

Logging into Argo CD to get the Initial Admin Password:

The initial password for the admin account is auto-generated and stored in a Kubernetes secret. To retrieve it, run:

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

Open the Web UI: Navigate to https://localhost:8080 in your browser.

Login: Use admin as the username and the password retrieved earlier.

Deploying Applications with ArgoCD:

kubectl apply -f argocd/application.yaml

Open the Web UI: Navigate to https://localhost:8080 in your browser and check the status of application.


Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

About

Our project is a chat application built using Python, Django, Django Channels, WebSocket, Tailwind CSS, JavaScript, and SQLite3. It aims to provide a seamless and secure messaging experience for users across different platforms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages