# londheshubham153/springboot-bankapp architecture

> Architecture diagram of the GitHub repository londheshubham153/springboot-bankapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/londheshubham153/springboot-bankapp
- Repository: https://github.com/londheshubham153/springboot-bankapp

## Overview

##### Project Type and Purpose
- This project is a full-stack, multi-tier bank application written in Java using Spring Boot. The application is containerized and delivered using a DevSecOps pipeline on AWS EKS.
- The README clearly indicates an end-to-end deployment scenario with continuous integration (CI) using Jenkins, static analysis/scans using SonarQube, OWASP, Trivy, and continuous deployment (CD) using ArgoCD, all integrated on a Kubernetes (EKS) environment. In addition, monitoring via Helm charts deploying Prometheus and Grafana is covered.

##### File Structure
- The top-level directories indicate several layers:
- Backend code: The “src” folder holds your Spring Boot source code (controllers, models, repositories, services, configurations, static resources, and templates).
- CI/CD Infrastructure: Files such as Jenkinsfile, GitOps folder, and Groovy scripts in the “vars” directory show automation scripts for building, scanning, and deploying the application.
- Containerization & Deployment: Dockerfile, docker-compose.yml, and the “helm” and “kubernetes” folders include configurations for container orchestration and Kubernetes resources.
- Configuration and Environment: The environment file (.env) and Maven build files (pom.xml, mvnw) indicate how the application is built and configured.
- The structure reflects a microcosm of a CI/CD pipeline that integrates code building, automated security scans, packaging into Docker containers, and deployment on a managed Kubernetes cluster.

##### Key Architectural Components
a. Source Control and Code Repository:
- GitHub as the source code repository.
- Where developers commit and manage code.

b. Continuous Integration (CI) Layer:
- Jenkins (with its variants: a top-level Jenkinsfile and additional groovy scripts under “vars”) is responsible for building the code (using Maven), running unit tests, and triggering static analysis (SonarQube, OWASP dependency checks, Trivy scans).

c. Containerization:
- The Dockerfile and docker-compose.yml are the building blocks for containerizing the application.
- A “Docker Registry” (public or private) where updated images are pushed after a successful build.

d. Continuous Deployment (CD) Layer:
- ArgoCD is used for the GitOps-driven deployment to Kubernetes (AWS EKS).
- Helm charts and Kubernetes manifests (in the “helm” and “kubernetes” directories) which define how the bank application and related services (such as MySQL for persistence) are deployed.

e. AWS EKS (Kubernetes Cluster):
- Within the cluster, show separate components for the BankApp application, MySQL database (with StatefulSets, persistent volumes), and supporting components like ConfigMaps, secrets, and custom services.

f. Monitoring and Infrastructure Management:
- Prometheus and Grafana (deployed via Helm) as monitoring tools.
- Other infrastructure components such as Ingress Controllers and additional security configuration managed by Kubernetes resources.

g. External Tools and Integrations:
- Other tools indicated in the README such as SonarQube (for quality scans), OWASP (dependency vulnerability checks), and Trivy (container scanning). Show how they feed back into the CI process.
- Email Notification services as configured in Jenkins (with SMTP/Gmail integration) and show how notifications are sent to stakeholders.

##### Relationships and Data Flow
- Monitoring flow with Prometheus scraping metrics from the cluster and Grafana visualizing the dashboards.
- Optionally, show a loop back from deployment feedback (logs/alerts) to the CI tool for continuous improvement.

##### Architectural Patterns and Design Principles
- The architecture is modular and layered – clearly separating code development, CI/CD automation, containerization, deployment, and monitoring.
- It leverages GitOps practices, where declarative deployment manifests (Helm charts, Kubernetes YAML files) drive cluster state.
- The system follows best practices for DevSecOps by integrating security scanning (OWASP and Trivy) and quality checks (SonarQube) directly into the pipeline.
- Resilience through the use of Kubernetes constructs (e.g., StatefulSets, persistent volumes) and scalability (Horizontal Pod Autoscaler, VPA templates available).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Code Repository and Files
    A["GitHub Repository"]:::source
    subgraph "Source Code"
        B["Backend Code (Spring Boot)"]:::source
        C["Frontend Templates"]:::source
        D["Frontend Static Resources"]:::source
        E["Configuration & Build Tools"]:::source
    end

    %% Continuous Integration (CI) Layer
    F["Jenkins (CI/CD Server)"]:::ci
    subgraph "CI Pipeline"
        G["Jenkinsfile"]:::ci
        H["Groovy Scripts"]:::ci
        I["SonarQube"]:::ci
        J["OWASP_Dependency"]:::ci
        K["Trivy_Scan"]:::ci
        L["Email_Notifications"]:::ci
    end

    %% Containerization
    subgraph "Containerization"
        M["Dockerfile"]:::container
        N["docker-compose.yml"]:::container
        O["Docker Registry"]:::container
    end

    %% Continuous Deployment (CD) & Deployment Configurations
    subgraph "Deployment Config"
        Q["GitOps Configuration"]:::deployment
        R["Kubernetes Manifests"]:::deployment
        S["Helm Charts"]:::deployment
    end
    P["ArgoCD (CD Tool)"]:::deployment

    %% AWS EKS Cluster
    subgraph "AWS EKS Cluster"
        T["AWS EKS Cluster"]:::eks
        U["BankApp Service"]:::eks
        V["MySQL Database"]:::eks
    end

    %% Monitoring Tools
    subgraph "Monitoring"
        W["Prometheus"]:::monitoring
        X["Grafana"]:::monitoring
    end

    %% Data Flow Connections
    A --> B
    A --> C
    A --> D
    A --> E
    A -->|"commit"| F

    F -->|"executes"| G
    F -->|"executes"| H
    F -->|"triggers"| I
    F -->|"triggers"| J
    F -->|"triggers"| K
    F -->|"notifies"| L

    F -->|"builds"| M
    F -->|"builds"| N
    M --> O
    N --> O

    Q --> P
    R --> P
    S --> P
    O --> P

    P -->|"deploys to"| T
    T --> U
    T --> V

    T -->|"monitor"| W
    T -->|"visualize"| X

    %% Styles
    classDef source fill:#ffcccc,stroke:#333,stroke-width:2px;
    classDef ci fill:#ffe6cc,stroke:#333,stroke-width:2px;
    classDef container fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef deployment fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef eks fill:#e6ccff,stroke:#333,stroke-width:2px;
    classDef monitoring fill:#ffffcc,stroke:#333,stroke-width:2px;

    %% Click Events for Component Mapping
    click B "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/src/main/java/com/example/bankapp"
    click C "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/src/main/resources/templates"
    click D "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/src/main/resources/static"
    click G "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/Jenkinsfile"
    click H "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/vars/"
    click M "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/Dockerfile"
    click N "https://github.com/londheshubham153/springboot-bankapp/blob/DevOps/docker-compose.yml"
    click Q "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/GitOps/"
    click R "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/kubernetes/"
    click S "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/helm/bankapp"
    click V "https://github.com/londheshubham153/springboot-bankapp/blob/DevOps/kubernetes/mysql-deployment.yml"
    click E "https://github.com/londheshubham153/springboot-bankapp/blob/DevOps/.env"
    click E "https://github.com/londheshubham153/springboot-bankapp/blob/DevOps/pom.xml"
    click E "https://github.com/londheshubham153/springboot-bankapp/tree/DevOps/mvnw"
```
