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.
- Containerization
- Cloud Providers
- Deployment
- CI/CD Pipeline
- Monitoring
- Environment Variables
- Web Server
- Logging
- Badges
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)
-
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.
-
Azure Services:
- virtual Machines for the deployment of the jenkins server, frontend server and chat micro service.
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
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.
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.
The frontend CI/CD pipeline includes the following steps:
-
Building: Frontend code is built to be ready for deployment.
-
Testing: Automated unit tests are run to validate the functionality and reliability of the frontend code.
-
Deployment: The built artifacts (Docker Image) are deployed to the azure server hrough Docker hub.
The backend CI/CD pipeline follows a similar structure:
-
Pre-Building: before deploying APIS a local mysql container is initiated to run the unit tests.
-
Building: Backend code is built to be ready for deployment.
-
Testing: Automated unit tests are run to validate the functionality and reliability of the frontend code.
-
Deployment: The built artifacts (Docker Image) are deployed to the AWS/Azure server through Docker hub.
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.
-
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.
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.
Containerized applications are monitored to track resource usage, container health, and other relevant metrics.
cadvisor
is used.
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 provide a visual representation of the monitored metrics. You can access Grafana to view historical data, trends, and performance insights.
To build this project's backend image, you will need to have the following environment variables file before running the docker build
command
.env
Nginx
is the dedicated web server for frontend, APIs and chat microservice, configured with ssl certificate using certbot
.
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.