Skip to content

TweaXy/devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TweaXy

A social media app that was implemented as a clone for X (Twitter).

This repository is dedicated to the meticulous implementation of our DevOps strategy, specifically focusing on Continuous Integration (CI) and Continuous Deployment (CD). Within these confines, a refined pipeline is designed to optimize development processes and ensure the smooth deployment of our social media application.

📝 Table of Contents

Containerization

Docker Containerization:

  • Docker Compose files are available to simplify the deployment of multi-container applications. You can find them in the docker-compose directory.

  • Docker Hub is used to host Docker images related to this project. You can find and pull the latest images from the Docker Hub repository (username Tweaxy).

Docker Images Built

  • backend (5 versions).
  • frontend (2 versions).
  • jenkins (1 version).
  • chat (1 version)

Cloud-Providers

  1. AWS Services:

    • ec2 for the deployment of the backend apis server.
    • cloudwatch for the backend apis server logs.
    • RDS for the sql database.
    • S3 for cloud storage.
    • Parameter Store for credentials.
  2. Azure Services:

    • virtual Machines for the deployment of the jenkins server, frontend server and chat micro service.

Deployment

Each service is provided with two scripts that act as two stages for deployment:

  • deploy.sh => run on jenkins server
  • service-name.sh => run on the service server(s)

Jenkins-server:

   ./deploy.sh

Dedicated Server:

   ./<servicename>.sh

CI-CD-Pipeline

Overview

This repository utilizes a CI/CD (Continuous Integration/Continuous Deployment) pipeline to automate the build and deployment process for both the frontend and backend components of the project.

CI/CD Setup

We use Jenkins as our CI/CD tool to automate the pipeline. The pipeline is triggered automatically on pull requests, ensuring that changes are thoroughly tested and deployed seamlessly.

Frontend Pipeline

The frontend CI/CD pipeline includes the following steps:

  1. Building: Frontend code is built to be ready for deployment.

  2. Testing: Automated unit tests are run to validate the functionality and reliability of the frontend code.

  3. Deployment: The built artifacts (Docker Image) are deployed to the azure server hrough Docker hub.

Backend Pipeline

The backend CI/CD pipeline follows a similar structure:

  1. Pre-Building: before deploying APIS a local mysql container is initiated to run the unit tests.

  2. Building: Backend code is built to be ready for deployment.

  3. Testing: Automated unit tests are run to validate the functionality and reliability of the frontend code.

  4. Deployment: The built artifacts (Docker Image) are deployed to the AWS/Azure server through Docker hub.

Jenkins Configuration

The Jenkins server is configured to automatically trigger the CI/CD pipeline on pull requests. This ensures that every change is thoroughly validated before being merged into the dev/main branch.

Monitoring

Tools Used

  • Prometheus: An open-source monitoring and alerting toolkit designed for reliability and scalability.

  • Grafana: A popular open-source analytics and monitoring platform that integrates with various data sources, including Prometheus.

Components Monitored

Servers

Prometheus collects and stores metrics from servers, offering insights into CPU usage, memory utilization, disk I/O, and other vital system statistics. node-exporter is used.

Containers

Containerized applications are monitored to track resource usage, container health, and other relevant metrics. cadvisor is used.

Alerts

Alerts are configured to notify the team of any abnormal behavior or critical issues. These alerts are triggered based on predefined thresholds and can be customized as needed.

Grafana Dashboards

Grafana dashboards provide a visual representation of the monitored metrics. You can access Grafana to view historical data, trends, and performance insights. image image image

Environment-Variables

To build this project's backend image, you will need to have the following environment variables file before running the docker build command

.env

Web-server

Nginx is the dedicated web server for frontend, APIs and chat microservice, configured with ssl certificate using certbot.

Logging

AWS Cloudwatch is the dedicated logging driver APIs service.

fluentd is the dedicated logging driver for chat microservice. fluentd exports logs to a mongodb document.

Badges

Docker Jenkins Prometheus Prometheus Fluentd Nginx MySQL AWS Azure

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published