# yazid0hakimi/azure-automation architecture

> Architecture diagram of the GitHub repository yazid0hakimi/azure-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yazid0hakimi/azure-automation
- Repository: https://github.com/yazid0hakimi/azure-automation

## Overview

##### Project type and purpose
- This is a full-stack, microservices-based application hosted on Azure using a monorepo structure.
- It comprises:
- An Angular frontend (“angular-front/”)
- Spring Boot microservices (discovery, profile, employee-performance, gateway) in “spring-backend/”
- Kubernetes manifests in “k8s/” for deploying services to AKS
- Terraform infrastructure as code (“terraform-infra/”) to provision Azure resources

##### File structure
- Top-level directories correspond to major subsystems: frontend, backend, infra, and kube-configs.
- “spring-backend/” houses multiple Spring Boot modules, each with its own Dockerfile, application properties, controllers, services, repos, DTOs, and feign clients.
- “k8s/” organizes base manifests, overlays (dev, PBD/HPA), FluxCD configs, and monitoring (Grafana dashboards).
- “terraform-infra/” defines reusable Azure modules (AKS, ACR, SQL, key vault, networking, firewall, VM, bastion) and pipelines.

##### README
- Confirms a monorepo for coordinating frontend, backend, infra, and Kubernetes.
- Goal: unified development, testing, deployment across Azure.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["User Browser"]:::external
    end

    %% Edge Layer
    subgraph "Edge Layer"
        direction TB
        Ingress["Kubernetes Ingress Controller"]:::infra
        NGINX["NGINX Reverse Proxy"]:::app
        Angular["Angular Frontend"]:::app
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        Gateway["API Gateway (Spring Cloud Gateway)"]:::app
        Discovery["Service Discovery (Eureka)"]:::app
        Profile["Profile Service"]:::app
        Performance["Employee Performance Service"]:::app
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        SQL1["Azure SQL (Profile)"]:::db
        SQL2["Azure SQL (Performance)"]:::db
        KeyVault["Azure Key Vault"]:::db
    end

    %% Infrastructure Layer
    subgraph "Azure Infrastructure"
        direction TB
        AKS["AKS Cluster"]:::infra
        ACR["Azure Container Registry"]:::infra
        VNet["VNet & Subnets"]:::infra
        Firewall["Azure Firewall"]:::infra
        Bastion["Bastion Host"]:::infra
    end

    %% CI/CD & GitOps
    subgraph "CI/CD & GitOps"
        direction TB
        FrontendCI["Angular Frontend Pipeline"]:::ci
        BackendCI["Spring Backend Pipeline"]:::ci
        TerraformCI["Terraform Pipeline"]:::ci
        FluxCD["FluxCD GitOps"]:::ci
    end

    %% Monitoring
    subgraph "Monitoring"
        direction TB
        Prometheus["Prometheus"]:::monitor
        Grafana["Grafana"]:::monitor
    end

    %% Connections
    Browser -->|HTTP| Ingress
    Ingress --> NGINX
    NGINX --> Angular
    Angular -->|API Calls| Gateway
    Gateway -->|Service Lookup| Discovery
    Gateway -->|Routes| Profile
    Gateway -->|Routes| Performance
    Profile -->|JDBC| SQL1
    Performance -->|JDBC| SQL2
    Profile -->|Secrets| KeyVault
    Performance -->|Secrets| KeyVault
    Profile -->|Metrics| Prometheus
    Performance -->|Metrics| Prometheus
    Prometheus --> Grafana

    FrontendCI -->|build/push| ACR
    BackendCI -->|build/push| ACR
    TerraformCI -->|provisions| AKS
    FluxCD -->|deploys| AKS
    ACR -->|images| AKS

    %% Click Events
    click Angular "https://github.com/yazid0hakimi/azure-automation/tree/main/angular-front/"
    click NGINX "https://github.com/yazid0hakimi/azure-automation/blob/main/angular-front/nginx.config"
    click Ingress "https://github.com/yazid0hakimi/azure-automation/blob/main/k8s/base/ingress.yaml"
    click Gateway "https://github.com/yazid0hakimi/azure-automation/tree/main/spring-backend/gateway-service/"
    click Discovery "https://github.com/yazid0hakimi/azure-automation/tree/main/spring-backend/discovery-service/"
    click Profile "https://github.com/yazid0hakimi/azure-automation/tree/main/spring-backend/profile-service/"
    click Performance "https://github.com/yazid0hakimi/azure-automation/tree/main/spring-backend/employee-performance-service/"
    click FrontendCI "https://github.com/yazid0hakimi/azure-automation/blob/main/angular-front/azure-pipeline.yaml"
    click BackendCI "https://github.com/yazid0hakimi/azure-automation/blob/main/spring-backend/spring-pipeline.yaml"
    click FluxCD "https://github.com/yazid0hakimi/azure-automation/blob/main/k8s/flux/FluxCD-install.yaml"
    click Grafana "https://github.com/yazid0hakimi/azure-automation/blob/main/k8s/monitoring/grafana-values.yaml"
    click TerraformCI "https://github.com/yazid0hakimi/azure-automation/blob/main/terraform-infra/terraform-pipeline.yml"
    click AKS "https://github.com/yazid0hakimi/azure-automation/tree/main/terraform-infra/modules/aks/"
    click ACR "https://github.com/yazid0hakimi/azure-automation/tree/main/terraform-infra/modules/acr/"
    click SQL1 "https://github.com/yazid0hakimi/azure-automation/tree/main/terraform-infra/modules/sql/"
    click KeyVault "https://github.com/yazid0hakimi/azure-automation/tree/main/terraform-infra/modules/keyvault/"
    click VNet "https://github.com/yazid0hakimi/azure-automation/tree/main/terraform-infra/modules/network/"
    click Firewall "https://github.com/yazid0hakimi/azure-automation/tree/main/terraform-infra/modules/firewall/"
    click Bastion "https://github.com/yazid0hakimi/azure-automation/tree/main/terraform-infra/modules/bastion/"

    %% Styles
    classDef app fill:#cfe2f3,stroke:#000,stroke-width:1px
    classDef db fill:#d9ead3,stroke:#000,stroke-width:1px
    classDef infra fill:#fce5cd,stroke:#000,stroke-width:1px
    classDef ci fill:#d9d2e9,stroke:#000,stroke-width:1px
    classDef monitor fill:#f4cccc,stroke:#000,stroke-width:1px
    classDef external fill:#ffffff,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5
```
