# adarsh275/capstone-project-pes-university architecture

> Architecture diagram of the GitHub repository adarsh275/capstone-project-pes-university, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adarsh275/capstone-project-pes-university
- Repository: https://github.com/adarsh275/capstone-project-pes-university

## Overview

##### Project type and purpose
- This is a cloud-native, microservices-based sample e-commerce application (“EOX Microservice”) built as a capstone project.
- It demonstrates deploying heterogeneous services (Java, Go, .NET, Node, Python) to a Kubernetes cluster on GCP, using Terraform, Helm, Istio, Skaffold, deploystack, and HPA/autoscaling.

##### File structure
- Top-level phases (Phase-1, Phase-2, Phase-3) hold academic deliverables; the real architecture lives in Phase-2 → ISA-1 → WorksOn → “Ecommerce Website.”
- Inside “Ecommerce Website” you see:
- src/ : code for each microservice (adservice, cartservice, checkoutservice, currencyservice, emailservice, frontend, loadgenerator, paymentservice, productcatalogservice, recommendationservice, shippingservice)
- helm-chart/, istio-manifests/, kubernetes-manifests/, kustomize/ : deployment descriptors
- terraform/ : GCP infra (memorystore, AlloyDB/Spanner, IAM)
- cloudbuild.yaml, skaffold.yaml, .github/workflows/ : CI/CD pipelines
- protos/ : gRPC definitions
- Patterns: microservices talking via gRPC/HTTP, service mesh (Istio), Infrastructure-as-Code (Terraform), Continuous Delivery (Skaffold/Cloud Build), Helm/Kustomize for packaging.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% DevOps Layer
    subgraph "DevOps Layer"
        direction TB
        GH["GitHub Actions Workflows"]:::devops
        CB["Cloud Build"]:::devops
        SK["Skaffold"]:::devops
        DS["Deploystack"]:::devops
        TF["Terraform (GCP Infra)"]:::devops
        HC["Helm Charts"]:::devops
        KM["Kubernetes Manifests"]:::devops
        KZ["Kustomize"]:::devops
        IM["Istio Manifests"]:::devops
        PR["gRPC Protobufs"]:::devops
    end

    GH -->|"git push"| CB
    CB -->|"build & deploy"| SK
    DS -->|"provision infra"| TF
    SK -->|push images| Registry
    HC -->|package charts| Registry
    KM -->|apply raw| Registry
    KZ -->|apply overlays| Registry
    IM -->|apply mesh| Registry
    PR -->|generate clients| Registry

    Registry["Container Registry"]:::devops

    Registry -->|"images"| K8sCP

    %% Kubernetes & Service Mesh Layer
    subgraph "Kubernetes Cluster" 
        direction TB
        K8sCP["Kubernetes Control Plane"]:::k8s
        subgraph "Service Mesh"
            direction TB
            IstioIngress["Istio Ingress Gateway"]:::k8s
            Pilot["Pilot"]:::k8s
            Mixer["Mixer"]:::k8s
            Sidecars["Envoy Sidecars"]:::k8s
        end
        HPA["Horizontal Pod Autoscaler"]:::k8s
        MetricsAPI["Metrics API"]:::k8s
    end

    K8sCP --> IstioIngress
    IstioIngress --> fe
    MetricsAPI --> HPA

    %% Application Layer
    subgraph "Ecommerce Namespace" 
        direction TB
        fe["frontend"]:::app
        ad["adservice"]:::app
        cart["cartservice"]:::app
        checkout["checkoutservice"]:::app
        currency["currencyservice"]:::app
        email["emailservice"]:::app
        load["loadgenerator"]:::app
        payment["paymentservice"]:::app
        product["productcatalogservice"]:::app
        rec["recommendationservice"]:::app
        shipping["shippingservice"]:::app
    end

    load -->|"HTTP"| fe

    fe -->|"gRPC/HTTP"| ad
    fe -->|"gRPC/HTTP"| cart
    fe -->|"gRPC/HTTP"| checkout
    fe -->|"gRPC/HTTP"| currency
    fe -->|"gRPC/HTTP"| email
    fe -->|"gRPC/HTTP"| payment
    fe -->|"gRPC/HTTP"| product
    fe -->|"gRPC/HTTP"| rec
    fe -->|"gRPC/HTTP"| shipping

    %% Data Stores Layer
    subgraph "Data Stores & External"
        direction TB
        Redis["Redis/Memorystore"]:::data
        Spanner["AlloyDB/Spanner"]:::data
        SMTP["SMTP Email Service"]:::data
    end

    ad -->|"read/write"| Spanner
    cart -->|"read/write"| Redis
    checkout -->|"read/write"| Spanner
    currency -->|"read/write"| Spanner
    email -->|"send email via"| SMTP
    payment -->|"external call"| SMTP
    product -->|"read/write"| Spanner
    rec -->|"read/write"| Spanner
    shipping -->|"read/write"| Spanner

    %% Observability Layer
    subgraph "Observability"
        direction TB
        OTEL["OpenTelemetry Collector"]:::obs
        OTELKZ["OTEL Kustomize Component"]:::obs
        Prom["Prometheus"]:::obs
        Graf["Grafana"]:::obs
        Logs["Stackdriver Logging"]:::obs
    end

    ad -->|"metrics/logs"| OTEL
    cart -->|"metrics/logs"| OTEL
    checkout -->|"metrics/logs"| OTEL
    currency -->|"metrics/logs"| OTEL
    email -->|"metrics/logs"| OTEL
    payment -->|"metrics/logs"| OTEL
    product -->|"metrics/logs"| OTEL
    rec -->|"metrics/logs"| OTEL
    shipping -->|"metrics/logs"| OTEL
    fe -->|"metrics/logs"| OTEL

    OTEL --> Prom
    OTEL --> Graf
    OTEL --> Logs

    MetricsAPI -->|"metrics"| OTEL

    HPA -->|"scale pods"| ad
    HPA -->|"scale pods"| cart
    HPA -->|"scale pods"| checkout
    HPA -->|"scale pods"| currency
    HPA -->|"scale pods"| email
    HPA -->|"scale pods"| payment
    HPA -->|"scale pods"| product
    HPA -->|"scale pods"| rec
    HPA -->|"scale pods"| shipping
    HPA -->|"scale pods"| fe

    %% Click Events
    click GH "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/.github/workflows"
    click CB "https://github.com/adarsh275/capstone-project-pes-university/blob/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/cloudbuild.yaml"
    click SK "https://github.com/adarsh275/capstone-project-pes-university/blob/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/skaffold.yaml"
    click DS "https://github.com/adarsh275/capstone-project-pes-university/blob/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/.deploystack"
    click TF "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/terraform"
    click HC "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/helm-chart"
    click KM "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/kubernetes-manifests"
    click KZ "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/kustomize"
    click IM "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/istio-manifests"
    click PR "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/protos"
    click OTEL "https://github.com/adarsh275/capstone-project-pes-university/blob/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/helm-chart/templates/opentelemetry-collector.yaml"
    click OTELKZ "https://github.com/adarsh275/capstone-project-pes-university/blob/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/kustomize/components/google-cloud-operations/otel-collector.yaml"
    click Redis "https://github.com/adarsh275/capstone-project-pes-university/blob/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/helm-chart/templates/redis.yaml"
    click Redis "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/kustomize/components/memorystore"
    click Spanner "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/kustomize/components/spanner"
    click ad "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/adservice"
    click cart "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/cartservice"
    click checkout "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/checkoutservice"
    click currency "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/currencyservice"
    click email "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/emailservice"
    click fe "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/frontend"
    click load "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/loadgenerator"
    click payment "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/paymentservice"
    click product "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/productcatalogservice"
    click rec "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/recommendationservice"
    click shipping "https://github.com/adarsh275/capstone-project-pes-university/tree/main/PHASE - 2/ISA - 1/WorksOn/Ecommerce Website/src/shippingservice"

    %% Styles
    classDef devops fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef k8s fill:#d4edda,stroke:#333,stroke-width:1px
    classDef app fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef data fill:#e2d6f3,stroke:#333,stroke-width:1px
    classDef obs fill:#f0f0f0,stroke:#333,stroke-width:1px
```
