Skip to content

shadyosama9/Zoom-Clone-App

 
 

Repository files navigation


Project Banner
typescript nextdotjs tailwindcss

A Zoom Clone

  1. 🤖 Introduction
  2. ⚙️ Tech Stack
  3. 🤸 Quick Start
  4. 🔧 CI/CD Pipeline
  5. 🔍 Monitoring

This repository is part of a collection of three repositories that follow GitOps principles to deploy a Zoom clone application to an AWS EKS cluster. The application was originally created by Adrian Hajdin.

The other repositories in this collection are:

This repository includes the Dockerfile and Jenkinsfile, which are used to containerize the application and set up the CI/CD pipeline.

  • Next.js
  • TypeScript
  • Clerk
  • getstream
  • shadcn
  • Tailwind CSS
  • Docker
  • Jenkins
  • Splunk

Follow these steps to set up the project locally on your machine.

Prerequisites

Make sure you have the following installed on your machine:


Cloning the Repository

git clone <repo-url>
cd <repo-url>

Installation

Install the project dependencies using npm:

npm install

Set Up Environment Variables

Create a new file named .env in the root of your project and add the following content:

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=

NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

NEXT_PUBLIC_STREAM_API_KEY=
STREAM_SECRET_KEY=

Replace the placeholder values with your actual Clerk & getstream credentials. You can obtain these credentials by signing up on the Clerk website and getstream website


Running the Project

npm run dev

Open http://localhost:3000 in your browser to view the project.


Running the Project with Docker Locally

Prerequisites

Make sure you have Docker installed on your machine. You can download and install Docker from the official


Set Up Environment Variables

Create a new file named .env in the root of your project and add the same content as mentioned above.


Building the Docker Image

docker build -t <image-name> .

Replace <image-name> with a name of your choice for the Docker image.


Running the Docker Container

docker run -p 3000:3000 <image-name>

This command will start the app, making it accessible at http://localhost:3000 in your browser.


Jenkins is used with a declarative approach to establish the CI/CD pipeline for the application.

Prerequisites


Jenkins And Dependencies Installation

  • Login to the Jenkins EC2 machine.
  • Run the following command to update the package list:
sudo apt update
  • Install JDK:
sudo apt install openjdk-21-jdk
sudo usermod -aG docker jenkins

Jenkins Set Up

Replace <ec2-public-ip> with the public ip of jenkins ec2 machine.



Jenkins Login Page

  • To get the admin password run:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  • Install the suggested plugins

Additional Plugins Used For The Pipeline

  • SonarQube Scanner for Jenkins
  • OWASP Dependency-Check Plugin
  • Docker
  • Docker Pipeline
  • Docker API Plugin
  • Docker Commons Plugin
  • Pipeline: Stage View Plugin
  • NodeJS Plugin
  • Splunk Plugin

Pipeline Stages

  1. Create Or Update .env File
    Checks for the existence of the .env file; if not present, it creates one from a credentialed secret file. If it exists, it updates it if the content has changed.

  2. Sonar Cloud Analysis
    Runs SonarQube analysis on the project using the specified configuration to ensure code quality and detect issues.

  3. Install Dependencies For Check
    Installs the necessary Node.js dependencies required for running the OWASP Dependency-Check analysis.

  4. Running Dependency Check
    Executes OWASP Dependency-Check to analyze the project for vulnerabilities and publishes the report.

  5. Running Trivy Analysis
    Performs a security scan of the filesystem using Trivy and saves the output to a file.

  6. Building Docker Image
    Builds a Docker image for the application using the specified Docker registry and tags it with the build number.

  7. Running Trivy On Docker
    Runs a Trivy scan on the newly built Docker image to identify any vulnerabilities.

  8. Uploading To DockerHub
    Pushes the built Docker image to Docker Hub using the specified credentials.

  9. CleanUp
    Cleans up the Docker environment by pruning unused Docker objects and removing node_modules.

  10. Pushing Image Version To K8s Repo
    Clones the Kubernetes repository, updates the image tag in the deployment file with the current build number, and pushes the changes back to GitHub.

Note: Make sure to change the environment values and crediential ids in the pipeline to yours


Splunk is utilized to monitor the Jenkins server.

Prerequisites


Splunk Installation

  1. Connect to your ec2 machine.
  2. Download Splunk using the wget command:
     wget -O splunk-9.1.1-64e843ea36b1-linux-2.6-amd64.deb "https://download.splunk.com/products/splunk/releases/9.1.1/linux/splunk-9.1.1-64e843ea36b1-linux-2.6-amd64.deb"
    
  3. Install Splunk:
    sudo dpkg -i splunk-9.1.1-64e843ea36b1-linux-2.6-amd64.deb
    
  4. Enable Splunk to start on boot:
    sudo /opt/splunk/bin/splunk enable boot-start
    
  5. Start Splunk:
    sudo /opt/splunk/bin/splunk start
    
  • Once the installation is complete, you can access it at http://<ec2-public-ip>:8000. Replace <ec2-public-ip> with the public ip of splunk ec2 machine.

Intergate Splunk With Jenkins

  1. In Splunk Dashboard, click on AppsFind more apps.

  2. Search for Jenkins in the search bar.

  3. Click on the Splunk app for Jenkins and install it.

  4. Provide your Splunk Account credentials.

  5. Click on Agree and install.

  6. Click on Go home.

  7. Verify that Jenkins has been added on the homepage of Splunk.

  8. Go to Settings > Data Inputs in the Splunk web interface.

  9. Click on HTTP Event Collector.

  10. Click on Global Settings.

  11. Set All tokens to enabled.

  12. Uncheck SSL enable.

  13. Use 8088 port and click on Save.

  14. Click on New token.

  15. Provide a name and click Next.

  16. Click on Review.

  17. Click on Submit.

  18. Click on Start searching.

  19. Copy your token and keep it safe.

  20. Go to Settings > Data Inputs in the Splunk web interface.

  21. Click on the HTTP Event Collector.

  22. Copy your token again and keep it safe.

  23. Go to the Jenkins dashboard.

  24. Click on Manage JenkinsPluginsAvailable plugins.

  25. Search for Splunk and install it.

  26. Click on Manage JenkinsSystem.

  27. Enable HTTP input host as SPLUNK PUBLIC IP.

  28. Input the HTTP token that you generated in Splunk.

  29. Add Jenkins IP and apply.

  30. In the Jenkins dashboard under Splunk, click on Test connection.

  31. Restart your Splunk machine:

  32. Restart Jenkins and log in again using:

  33. Go to Splunk and click on the Jenkins app to view monitoring output.



Splunk Page

About

Deploy a robust, enterprise-grade video conferencing application using GitOps principles with Docker, Jenkins, and Kubernetes on AWS EKS for scalable and reliable performance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 97.1%
  • CSS 2.2%
  • Other 0.7%