How kameshpudi/devsecops-demo works
Project Type and Purpose
• This is a single-page web application (SPA) built with React & TypeScript that implements a Tic Tac Toe game, complete with score tracking and game history.
• It includes a full DevSecOps pipeline: Docker containerization, GitHub Actions CI/CD, and Kubernetes deployment manifests.
Main Components
a. Developer Workspace & Source Code
• Code repository (GitHub) containing:
• src/ (React components, gameLogic utils)
• Configuration files (tsconfig, eslint, tailwind, Vite)
• README, Dockerfile, Kubernetes manifests, GitHub Actions workflows.
b. CI/CD Pipeline (GitHub Actions)
• Steps: checkout → install deps → lint/tests → build Docker image → push to container registry → deploy to Kubernetes cluster.
c. Container Registry
• Docker Hub or GitHub Container Registry (holds the built image).
d. Kubernetes Cluster
• Ingress Controller (manages HTTP/S routing)
• Service (ClusterIP service for the tic-tac-toe pods)
• Deployment (Pod template running the Docker image)
e. End-User Browser
• The user’s browser accessing the application via the Ingress endpoint.
Relationships and Data Flows
• Developer → Git push → triggers GitHub Actions.
• GitHub Actions → builds Docker image → pushes to registry → applies Kubernetes manifests (kubectl).
• Kubernetes Ingress → routes HTTP requests from the user’s browser to the Service.
• Service → load-balances traffic to Pods running the React app.
Architectural Patterns & Design Principles
• SPA Architecture: clear separation of UI (components/Board, Square, ScoreBoard, GameHistory) and logic (utils/gameLogic).
• Infrastructure as Code: Dockerfile + Kubernetes YAML in kubernetes/*.yaml.
• GitOps/CICD: declarative workflows in .github/workflows/ci-cd.yml.
• Container-based/Immutable infrastructure for repeatable deployments.
• Layer 1: Developer Onboarding
• GitHub Repo
• src/, Dockerfile, kubernetes/, workflows.
• Layer 2: CI/CD (GitHub Actions)
• Step 1: Checkout & Install
• Step 2: ESLint + unit tests (gameLogic.test.ts)
• Step 3: Build app (Vite → dist/)
• Step 4: Docker build & push
• Step 5: kubectl apply to Kubernetes
• Layer 3: Container Registry
• Image: devsecops-demo:latest
• Layer 4: Kubernetes Deployment
• Deployment → ReplicaSet → Pods (running built image)
• Service (ClusterIP)
• Ingress (Hostname routing)
• Layer 5: End User
• Browser GET / → Ingress → Service → Pod → static assets → Browser displays React app