Project-1: Starbucks Web Application CI/CD Pipeline

Automated Continuous Integration & Continuous Deployment using Node.js, Jenkins, Docker, and AWS EC2

Real-Time Industry Project | DevOps Pipeline Architecture

🚀 Project Overview & Architecture

This project demonstrates a production-grade Continuous Integration (CI) and Continuous Deployment (CD) pipeline for a high-traffic Node.js application (Starbucks Clone). The workflow seamlessly integrates source control, automated docker containerization, image registry pushing, and automated target deployment.

Starbucks CI/CD Project Architecture Cover
Figure 1: Starbucks Clone Web Application CI/CD Project Overview
Developer (Git)
GitHub Repo
Jenkins CI
Docker Hub
Remote Server / EC2
High-Level CI/CD Delivery Architecture Diagram
Figure 2: High-Level End-to-End CI/CD Pipeline Architecture & Delivery Flow
Real-Time Project Objectives & Key Agendas
Figure 3: Project Agenda & Key Industry Objectives
Step-by-Step CI/CD Implementation Flow
Figure 4: Developer Code Push to Target Deployment Flow
Pipeline Concept: Node.js Code (GitHub) ➔ Jenkins (Build npm + CI) ➔ CD via Jenkins ➔ Docker Hub Registry ➔ Run Container on Remote Machine (Port 3000).

⚡ Why Node.js for Scalable Applications?

Node.js is powered by an asynchronous, non-blocking I/O event-driven model. It efficiently processes thousands of concurrent real-time requests with low overhead compared to legacy thread-per-request backends.

Prerequisites and Technology Stack Overview
Figure 5: Prerequisites & Technology Stack Overview
Why Node.js for Starbucks Architecture
Figure 6: Industry Adoption & Performance Benefits of Node.js

☕ Real-World Industry Adoption

  • Starbucks: Powers mobile ordering systems for millions of simultaneous orders.
  • Netflix: High-volume API gateway & fast application startup times.
  • WhatsApp: Handles billions of real-time messages with ultra-low latency.
  • PayPal: Doubled requests per second while reducing response times.
  • Uber: Real-time matching between drivers and riders.

🛠️ DevOps & Cloud Benefits

  • Non-Blocking I/O: Superior concurrency handling.
  • Unified Language: JavaScript across frontend & backend.
  • NPM Ecosystem: Access to millions of reusable packages.
  • Container-Friendly: Lightweight footprints ideal for Docker & K8s.

🔄 Understanding CI, Continuous Delivery & Continuous Deployment

It is vital to distinguish between the three stages of modern software release automation:

Continuous Integration vs Continuous Delivery vs Continuous Deployment
Figure 7: Conceptual Comparison of CI, Continuous Delivery, and Continuous Deployment
10-Step CI/CD Implementation Roadmap
Figure 8: 10-Step Master Implementation Roadmap

Continuous Delivery

Builds, tests, and deploys automatically up to the Staging environment. Deployment to Production requires a Manual Gate / Approval.

Continuous Deployment

Fully automated pipeline with zero manual intervention. Passes smoke tests and deploys directly to Production automatically upon code push.

Pipeline Stage Flow Comparison
Continuous Integration : Builds ➔ Unit Tests
Continuous Delivery    : Builds ➔ Unit Tests ➔ Acceptance Test ➔ Staging ➔ [MANUAL APPROVAL] ➔ Production ➔ Smoke Tests
Continuous Deployment  : Builds ➔ Unit Tests ➔ Acceptance Test ➔ Staging ➔ [AUTOMATED PUSH] ➔ Production ➔ Smoke Tests

Step 1 AWS EC2 Server Provisioning

Launch an AWS EC2 instance with the following specifications to run Jenkins and Docker workloads:

Step 1 AWS EC2 VM Launch and Security Group Config
Figure 9: Step 1 — Provisioning AWS EC2 Ubuntu Instance & Security Group Port Rules
  • Instance Name: Starbucks cicd
  • Operating System: Ubuntu 22.04 LTS
  • Instance Type: t3.large (2 vCPUs & 8 GB RAM)
  • Storage: 30 GB GP3 EBS Volume

Inbound Security Group Rules

Type Port Range Purpose
Custom TCP 8080 Jenkins Web Dashboard Access
Custom TCP 3000 Starbucks Web Application Container Port
SSH 22 Remote Shell Management

Step 2 Installing Jenkins & Docker on Ubuntu

1. Install Java 17 & Jenkins Server

Step 2 Installing Java 17 and Jenkins on Ubuntu Server
Figure 10: Step 2 — Shell Script for Java 17 JRE and Jenkins Installation
Bash - Jenkins Setup
#!/bin/bash
# Install JRE 17 Headless
sudo apt update && sudo apt install openjdk-17-jre-headless -y

# Download Jenkins GPG Key & Repo
sudo mkdir -p /usr/share/keyrings
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian/jenkins.io-2023.key
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null

# Update & Install Jenkins
sudo apt-get update -y
sudo apt-get install jenkins -y
sudo systemctl enable --now jenkins

2. Install Docker Engine & Set User Permissions

Step 2 Installing Docker Engine and Adding User Privileges
Figure 11: Step 2 — Installing Docker CE & Setting Docker Socket Permissions
Bash - Docker Engine Setup
# Add Docker GPG key & Repository
sudo apt-get update
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker CE & Compose
sudo apt-get update -y
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

# Configure User Privileges
sudo usermod -aG docker ubuntu
sudo chmod 777 /var/run/docker.sock
newgrp docker

# Verify Installation
aws --version
jenkins --version
docker -v

Step 3 Jenkins Unlock, Plugins & Tool Setup

Step 3 Unlocking Jenkins Administrator Password
Figure 12: Step 3 — Unlocking Jenkins Dashboard via Initial Admin Password

Unlock Jenkins by fetching the initial administrator secret:

Terminal Command
cat /var/lib/jenkins/secrets/initialAdminPassword

Required Jenkins Plugins

Installing Required Jenkins Plugins
Figure 13: Step 3 — Installing Plugins & Adding Docker Hub Credentials
Jenkins Credentials Manager Interface
Figure 14: Adding Docker Hub Credentials (ID: docker) in Jenkins System Credentials

Navigate to Manage Jenkins ➔ Plugins ➔ Available Plugins and install:

  • Eclipse Temurin Installer (Java Runtime)
  • NodeJS Plugin (For building frontend/backend npm packages)
  • Docker, Docker Commons, Docker Pipeline, Docker API, docker-build-step
  • Pipeline Stage View Plugin

Jenkins Global Tool Configuration

Configuring Global Tools in Jenkins
Figure 15: Configuring JDK 17, Node 16, and Docker in Manage Jenkins ➔ Tools

Under Manage Jenkins ➔ Tools configure the following auto-installers:

  1. JDK: Name: jdk17 | Install automatically from Adoptium.net (version java17.0.8.1+1).
  2. NodeJS: Name: node16 | Install automatically (version nodejs 16.20.0).
  3. Docker: Name: docker | Install automatically from docker.com.

Docker Hub Credentials Setup

Go to Manage Jenkins ➔ Credentials ➔ System ➔ Global credentials ➔ Add Credentials:

  • Kind: Username with password
  • Username: Docker Hub Username
  • Password: Docker Hub Access Token / Password
  • ID: docker

Step 4 & 5 Setting Up Jenkins CI & CD Jobs

Continuous Integration (CI) Job

Step 4 Creating Jenkins Declarative CI Job
Figure 16: Step 4 — Creating Declarative Pipeline CI Job pointing to GitHub Jenkinsfile

Create a Pipeline job named CI pointing to GitHub Repository: https://github.com/CloudDevOpsHub/Starbucks-Application.git using Declarative Pipeline script from SCM (Jenkinsfile).

Continuous Deployment (CD) Scripted Pipeline

Step 5 Creating Jenkins Scripted CD Job
Figure 17: Step 5 — Creating Scripted Pipeline CD Job for Starbucks App Deployment

Create a Pipeline job named starbucks with Scripted Pipeline code:

Groovy - Scripted CD Pipeline
node {
    stage('Deploy Starbucks App') {
        // Pull latest docker container image & run on target port 3000
        sh '''
            docker stop starbucks || true
            docker rm starbucks || true
            docker run -d --name starbucks -p 3000:3000 vikas4cloud/starbucks:latest
        '''
    }
}

Automating Continuous Deployment

Step 6 Automated Build Triggers for Zero Touch Deployment
Figure 18: Step 6 — Configuring Automated Build Trigger ('Build after other projects are built')
Automated Pipeline Execution Log Dashboard
Figure 19: Verifying Automated Trigger Execution & Successful Image Push

To enable automated trigger, go to the starbucks CD job configuration ➔ Build Triggers ➔ check "Build after other projects are built" ➔ Projects to watch: CI. Now, every successful CI push automatically triggers deployment!

Verifying Running Container & Live Website

Verifying Running Containers on Server
Figure 20: Server Terminal Check (docker ps) Showing Starbucks Container Running
Starbucks Web Application Live on Port 3000
Figure 21: Live Starbucks Web Application Running on EC2 Public IP:3000

🔧 Troubleshooting & Common Pipeline Fixes

Jenkins Pipeline Stage View Troubleshooting NPM Library Error
Figure 22: Jenkins Stage View & NPM Shared Library Error (libatomic.so.1) Fix

Issue: NPM / Node Shared Library Missing Error

Symptom: Jenkins pipeline fails during Install NPM Dependencies stage with error:
node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

Solution: Install npm package directly on the Ubuntu host server:

Fix Command
sudo apt-get install npm -y

❓ Advanced Scenario Questions & Solutions

Advanced DevOps Questions Title Overview
Figure 23: Advanced Real-World Pipeline Scenarios Overview

Q1: How do we handle Private Docker Repositories & Remote Server Deployments?

Scripted Pipeline for Private Docker Repos and Remote SSH Deploy
Figure 24: Scripted Pipeline Solution for Private Registries & Remote SSH Deployments
Groovy Script - Private Registry & Remote SSH Deploy
pipeline {
    agent any
    stages {
        stage("Deploy") {
            steps {
                script {
                    // 1. Docker Login for Private Repositories
                    // sh "docker login -u $DOCKER_USER -p $DOCKER_PASS"
                    
                    // 2. Deploy to Remote Target Server via SSH
                    // sh "ssh root@11.1.11.11 'docker rm -f starbucks || true && docker run -d --name starbucks -p 3000:3000 vikas4cloud/starbucks:latest'"
                    
                    // 3. Local Target Deployment
                    sh '''
                        docker rm -f starbucks || true
                        docker run -d --name starbucks -p 3000:3000 vikas4cloud/starbucks:latest
                    '''
                }
            }
        }
    }
}

Q2: How to deploy to multiple environments (DEV, QA, PROD) using a single pipeline?

Single Pipeline Multi Environment Setup
Figure 25: Multi-Environment (DEV, QA, PROD) Single Pipeline Architecture
Parameterized Jenkins Pipeline Interface
Figure 26: Parameterized Pipeline Configuration ('This project is parameterized')

Use Parameterized Jenkins Pipelines. Enable "This project is parameterized" in job configuration, add a Choice or Boolean Parameter (e.g. DEV, QA, PROD), and execute via Build with Parameters.

💼 Resume Bullet Points & DevOps Engineer Responsibilities

DevOps Engineer Resume Points and Production Responsibilities
Figure 27: High-Impact Resume Bullet Points & Production DevOps Responsibilities

You can add these high-impact bullet points to your resume based on this project:

  • Architected and implemented an end-to-end Automated CI/CD Pipeline using Jenkins and Docker for a Node.js Starbucks web application.
  • Configured Declarative & Scripted Jenkinsfiles with automated build triggers, turning manual delivery into zero-touch Continuous Deployment.
  • Optimized Docker image containerization, reducing build times and ensuring lightweight container execution across cloud environments.
  • Integrated secure Jenkins Credentials Management for Docker Hub registry tokens and SSH keys.
  • Configured Parameterized Pipelines for seamless multi-environment deployments across DEV, QA, and Production environments.
  • Resolved host-level shared library dependencies (libatomic.so.1) and configured Linux security group rules for application isolation.
Cloud DevOps Hub Production CI/CD Starbucks Application Guide