# shalinidasaridev/devops-project-04-jenkins-ecr-ec2 architecture

> Architecture diagram of the GitHub repository shalinidasaridev/devops-project-04-jenkins-ecr-ec2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2
- Repository: https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2

## Overview

This repository demonstrates an automated Node.js deployment from GitHub through Jenkins and Docker to AWS ECR and EC2. The deployed Express service listens on port 5000, while the documented EC2 command publishes it on port 80. Pipeline stages beyond the sampled application source are represented from the README; their implementation details are not verified in the excerpts.

Main entry points: [`Jenkinsfile`](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile) (Jenkins), [`Dockerfile`](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Dockerfile) (Docker Image Build), [`server.js`](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/server.js) (Express Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["CI Pipeline"]
  node_jenkins["Jenkins"]
  node_checkout["Source Checkout"]
  node_imagebuild["Docker Image Build"]
end

subgraph group_registry["Image Registry"]
  node_ecrauth["ECR Authentication"]
  node_ecr[("ECR Registry")]
end

subgraph group_deployment["EC2 Deployment"]
  node_sshdeploy["SSH Deployment"]
  node_ec2["EC2 Host"]
  node_imagepull["Pull Image"]
  node_container["Container Restart"]
  node_express["Express Service<br/>[server.js]"]
end

node_developer(("Code Push"))
node_github["GitHub"]

node_developer -->|"pushes code"| node_github
node_github -->|"triggers pipeline"| node_jenkins
node_jenkins -->|"checks out"| node_checkout
node_jenkins -->|"builds image"| node_imagebuild
node_jenkins -->|"authenticates"| node_ecrauth
node_ecrauth -->|"logs in"| node_ecr
node_jenkins -->|"pushes image"| node_ecr
node_jenkins -->|"connects via SSH"| node_sshdeploy
node_sshdeploy -->|"deploys to"| node_ec2
node_ec2 -->|"pulls image"| node_ecr
node_ec2 -->|"restarts container"| node_container
node_container -->|"runs service"| node_express

click node_jenkins "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile"
click node_checkout "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile"
click node_imagebuild "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Dockerfile"
click node_ecrauth "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile"
click node_sshdeploy "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile"
click node_imagepull "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile"
click node_container "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile"
click node_express "https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/server.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_jenkins,node_checkout,node_imagebuild toneBlue
class node_ecrauth,node_ecr toneAmber
class node_sshdeploy,node_ec2,node_imagepull,node_container,node_express toneMint
class node_developer,node_github toneIndigo
```

## Components

### CI Pipeline

- [Jenkins](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile): `Jenkinsfile`
- [Source Checkout](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile): `Jenkinsfile`
- [Docker Image Build](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Dockerfile): `Dockerfile`

### Image Registry

- [ECR Authentication](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile): `Jenkinsfile`
- **ECR Registry**

### EC2 Deployment

- [SSH Deployment](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile): `Jenkinsfile`
- **EC2 Host**
- [Pull Image](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile): `Jenkinsfile`
- [Container Restart](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/Jenkinsfile): `Jenkinsfile`
- [Express Service](https://github.com/shalinidasaridev/devops-project-04-jenkins-ecr-ec2/blob/main/server.js): `server.js`

### Other components

- **Code Push**
- **GitHub**

## Connections

- Code Push → GitHub: pushes code (evidence: `README.md`)
- GitHub → Jenkins: triggers pipeline (evidence: `README.md`)
- Jenkins → Source Checkout: checks out (evidence: `README.md`)
- Jenkins → Docker Image Build: builds image (evidence: `README.md`)
- Jenkins → ECR Authentication: authenticates (evidence: `README.md`)
- ECR Authentication → ECR Registry: logs in (evidence: `README.md`)
- Jenkins → ECR Registry: pushes image (evidence: `README.md`)
- Jenkins → SSH Deployment: connects via SSH (evidence: `README.md`)
- SSH Deployment → EC2 Host: deploys to (evidence: `README.md`)
- EC2 Host → ECR Registry: pulls image (evidence: `README.md`)
- EC2 Host → Container Restart: restarts container (evidence: `README.md`)
- Container Restart → Express Service: runs service (evidence: `README.md`)
