# aliouimohamedamine/devops-microservices architecture

> Architecture diagram of the GitHub repository aliouimohamedamine/devops-microservices, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aliouimohamedamine/devops-microservices
- Repository: https://github.com/aliouimohamedamine/devops-microservices

## Overview

##### Project type and purpose
- This is a full-stack, microservice-based e-commerce “Astronomy Shop” demo application, originally from the OpenTelemetry team, extended here with a complete DevOps pipeline.
- It includes 12+ back end microservices, a React web front end, a React-Native mobile front end, supporting infrastructure (Kafka, Envoy, feature‐flagging via FlagD), plus observability (OpenTelemetry, Prometheus, Grafana), all deployable locally (Docker Compose) or to AWS EKS using Terraform and ArgoCD.

##### File structure
- Top-level “src” directory holds directories for each microservice (accounting, ad, cart, checkout, currency, email, fraud-detection, image-provider, load-generator, payment, product-catalog, quote, recommendation, shipping, frontend, frontend-proxy, flagd-ui, flagd, react-native-app, kafka, otel-collector, prometheus, grafana).
- “eks” holds Terraform code for provisioning AWS VPC and EKS cluster modules.
- “kubernetes” holds YAML manifests for deploying each service into K8s.
- CI/CD config lives under “.github/workflows/ci.yaml” and likely ArgoCD Helm charts under “charts” (per README).
- “docker-compose.yml” for local multi-container startup.

##### README for additional insights
- Highlights: full CI/CD (GitHub Actions + ArgoCD), IaC (Terraform), containerization (Docker), orchestration (Kubernetes/EKS), monitoring (Prometheus + Grafana).
- Key use-cases: local dev via Docker Compose; Kubernetes cluster deployment; AWS Terraform apply.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "CI/CD Layer"
        GH["GitHub Actions"]:::ci
        ARGO["ArgoCD"]:::ci
    end

    subgraph "Infrastructure Layer"
        TF_MAIN["Terraform Main"]:::infra
        TF_VPC["Terraform VPC Module"]:::infra
        TF_EKS["Terraform EKS Module"]:::infra
        TF_BACKEND["Terraform Backend"]:::infra
        DOCKER["Docker Compose"]:::infra
        K8S_MAN["Kubernetes Manifests"]:::infra
    end

    subgraph "Kubernetes Cluster"
        subgraph "EKS"
            subgraph "Ingress & API Gateway"
                ENVOY["Envoy (frontend-proxy)"]:::gateway
            end
            subgraph "Application Services"
                FE["Next.js Frontend"]:::frontend
                MFE["React-Native Mobile App"]:::frontend
                acct["accounting"]:::service
                ad["ad"]:::service
                cart["cart"]:::service
                checkout["checkout"]:::service
                currency["currency"]:::service
                email["email"]:::service
                fraud["fraud-detection"]:::service
                payment["payment"]:::service
                product["product-catalog"]:::service
                quote["quote"]:::service
                rec["recommendation"]:::service
                shipping["shipping"]:::service
                img["image-provider"]:::service
                load["load-generator"]:::service
                flagd["FlagD"]:::service
                flagdui["FlagD UI"]:::frontend
            end
            subgraph "Messaging"
                KAFKA["Kafka Cluster"]:::messaging
            end
            subgraph "Observability"
                OTEL["OpenTelemetry Collector"]:::obs
                PROM["Prometheus"]:::obs
                GRAF["Grafana"]:::obs
            end
        end
    end

    GH --> ARGO
    ARGO --> TF_MAIN
    ARGO --> TF_VPC
    ARGO --> TF_EKS
    ARGO --> TF_BACKEND
    ARGO --> DOCKER
    ARGO --> K8S_MAN

    TF_MAIN -->|"provisions"| ENVOY
    TF_MAIN -->|"provisions"| acct

    FE -->|"HTTP/gRPC"| ENVOY
    MFE -->|"HTTP/gRPC"| ENVOY
    load -->|"traffic"| FE

    ENVOY -->|"routes"| acct
    ENVOY -->|"routes"| ad
    ENVOY -->|"routes"| cart
    ENVOY -->|"routes"| checkout
    ENVOY -->|"routes"| currency
    ENVOY -->|"routes"| email
    ENVOY -->|"routes"| fraud
    ENVOY -->|"routes"| payment
    ENVOY -->|"routes"| product
    ENVOY -->|"routes"| quote
    ENVOY -->|"routes"| rec
    ENVOY -->|"routes"| shipping
    ENVOY -->|"routes"| img
    ENVOY -->|"routes"| load

    checkout -->|"publishOrder"| KAFKA
    KAFKA -->|"subscribe"| shipping

    FE -->|"requestsFlags"| flagd
    MFE -->|"requestsFlags"| flagd
    acct -->|"requestsFlags"| flagd
    ad -->|"requestsFlags"| flagd
    cart -->|"requestsFlags"| flagd
    checkout -->|"requestsFlags"| flagd
    currency -->|"requestsFlags"| flagd
    email -->|"requestsFlags"| flagd
    fraud -->|"requestsFlags"| flagd
    payment -->|"requestsFlags"| flagd
    product -->|"requestsFlags"| flagd
    quote -->|"requestsFlags"| flagd
    rec -->|"requestsFlags"| flagd
    shipping -->|"requestsFlags"| flagd
    img -->|"requestsFlags"| flagd

    FE -->|"OTLP"| OTEL
    MFE -->|"OTLP"| OTEL
    ENVOY -->|"OTLP"| OTEL
    acct -->|"OTLP"| OTEL
    ad -->|"OTLP"| OTEL
    cart -->|"OTLP"| OTEL
    checkout -->|"OTLP"| OTEL
    currency -->|"OTLP"| OTEL
    email -->|"OTLP"| OTEL
    fraud -->|"OTLP"| OTEL
    payment -->|"OTLP"| OTEL
    product -->|"OTLP"| OTEL
    quote -->|"OTLP"| OTEL
    rec -->|"OTLP"| OTEL
    shipping -->|"OTLP"| OTEL
    img -->|"OTLP"| OTEL
    load -->|"OTLP"| OTEL
    flagd -->|"OTLP"| OTEL
    flagdui -->|"OTLP"| OTEL

    OTEL -->|"metrics/traces"| PROM
    OTEL -->|"metrics/traces"| GRAF
    PROM -->|"scrapes"| GRAF

    classDef ci fill:#f9f,stroke:#333,stroke-width:1px
    classDef infra fill:#f96,stroke:#333,stroke-width:1px
    classDef gateway fill:#6cf,stroke:#333,stroke-width:1px
    classDef frontend fill:#9cf,stroke:#333,stroke-width:1px
    classDef service fill:#afa,stroke:#333,stroke-width:1px
    classDef messaging fill:#fc9,stroke:#333,stroke-width:1px
    classDef obs fill:#c9f,stroke:#333,stroke-width:1px

    click GH "https://github.com/aliouimohamedamine/devops-microservices/blob/main/.github/workflows/ci.yaml"
    click TF_MAIN "https://github.com/aliouimohamedamine/devops-microservices/blob/main/eks/main.tf"
    click TF_VPC "https://github.com/aliouimohamedamine/devops-microservices/tree/main/eks/modules/vpc"
    click TF_EKS "https://github.com/aliouimohamedamine/devops-microservices/tree/main/eks/modules/eks"
    click TF_BACKEND "https://github.com/aliouimohamedamine/devops-microservices/blob/main/eks/backend/main.tf"
    click DOCKER "https://github.com/aliouimohamedamine/devops-microservices/blob/main/docker-compose.yml"
    click K8S_MAN "https://github.com/aliouimohamedamine/devops-microservices/tree/main/kubernetes/"
    click ENVOY "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/frontend-proxy/"
    click FE "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/frontend/"
    click MFE "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/react-native-app/"
    click flagd "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/flagd/"
    click flagdui "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/flagd-ui/"
    click OTEL "https://github.com/aliouimohamedamine/devops-microservices/blob/main/src/otel-collector/otelcol-config.yml"
    click PROM "https://github.com/aliouimohamedamine/devops-microservices/blob/main/src/prometheus/prometheus-config.yaml"
    click GRAF "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/grafana/"
    click KAFKA "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/kafka/"
    click load "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/load-generator/"
    click img "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/image-provider/"
    click acct "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/accounting/"
    click ad "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/ad/"
    click cart "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/cart/"
    click checkout "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/checkout/"
    click currency "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/currency/"
    click email "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/email/"
    click fraud "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/fraud-detection/"
    click payment "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/payment/"
    click product "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/product-catalog/"
    click quote "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/quote/"
    click rec "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/recommendation/"
    click shipping "https://github.com/aliouimohamedamine/devops-microservices/tree/main/src/shipping/"
```
