# rhmt80/code-quality-devops architecture

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

- Interactive diagram: https://gitdiagram.com/rhmt80/code-quality-devops
- Repository: https://github.com/rhmt80/code-quality-devops

## Overview

##### Project type and purpose
- This is an open-source Python DevOps/Code-Quality pipeline.
- Its purpose is to automate static analysis (Flake8, Pylint), security scanning (Bandit), unit testing (Pytest) and upload metrics to SonarCloud via a GitHub Actions CI/CD workflow.

##### File structure
- Top-level directories & files:
- `.github/workflows/build.yml` – CI pipeline definition
- `my_module/calculator.py` – core Python module
- `tests/test_calculator.py` – unit tests
- `requirements.txt`, `pyproject.toml`, `pytest.ini`, `.flake8`, `.pylintrc` – dependency & tool configurations
- `sonar-project.properties` – SonarCloud configuration
- No “frontend” or “backend” layers—focus is on code analysis stages and results.

##### README for additional insights
- Workflow steps: checkout → setup Python (3.9/3.10/3.11) → install → lint → format → security scan → test → upload to SonarCloud.
- Artifacts: `junit/` folder for test results, SonarCloud dashboards.

##### Final advice
- Where configuration files live and which step they drive.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer and Repository
    subgraph "Developer"
        Dev["Developer\n(Local IDE & Git CLI)"]:::code
        Repo["GitHub Repository"]:::code
        Readme["README.md"]:::code
    end

    Dev -->|push code| Repo
    Readme -->|guidance| Dev

    %% Source Code
    subgraph "Source Code"
        CoreMod["calculator.py"]:::code
        InitPy["__init__.py"]:::code
        TestFile["test_calculator.py"]:::code
    end

    Repo --> CoreMod
    Repo --> InitPy
    Repo --> TestFile

    %% Configuration Files
    subgraph "Configuration Files"
        Flake8Conf[".flake8"]:::code
        PylintConf[".pylintrc"]:::code
        PytestConf["pytest.ini"]:::code
        PyProject["pyproject.toml"]:::code
        Requirements["requirements.txt"]:::code
        SonarProps["sonar-project.properties"]:::code
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        Runner["GitHub Actions Runner"]:::ci
        Versions["Python Matrix\n(3.9, 3.10, 3.11)"]:::ci
        Linting["Linting\n(Flake8 & Pylint & Black)"]:::analysis
        Security["Security Scan\n(Bandit)"]:::analysis
        Testing["Unit Testing\n(Pytest)"]:::analysis
        UploadArtifacts["Upload Artifacts\n(JUnit XML)"]:::ci
        SonarScanner["SonarCloud Scanner"]:::analysis
    end

    %% External Services
    subgraph "External Services"
        ArtifactsStore["Artifact Store\n(junit/)"]:::external
        SonarCloud["SonarCloud Service"]:::external
    end

    %% Pipeline Flow
    Repo --> Runner
    Runner --> Versions
    Versions --> Linting
    Linting --> Security
    Security --> Testing
    Testing --> UploadArtifacts
    UploadArtifacts --> ArtifactsStore
    UploadArtifacts --> SonarScanner
    SonarScanner --> SonarCloud

    %% Source Code to Steps
    CoreMod --> Linting
    InitPy --> Linting
    CoreMod --> Security
    InitPy --> Security
    CoreMod --> Testing
    InitPy --> Testing
    TestFile --> Testing

    %% Config to Steps
    Flake8Conf --> Linting
    PylintConf --> Linting
    PyProject --> Runner
    Requirements --> Runner
    PytestConf --> Testing
    SonarProps --> SonarScanner

    %% Click Events
    click Runner "https://github.com/rhmt80/code-quality-devops/blob/main/.github/workflows/build.yml"
    click CoreMod "https://github.com/rhmt80/code-quality-devops/blob/main/my_module/calculator.py"
    click InitPy "https://github.com/rhmt80/code-quality-devops/blob/main/my_module/__init__.py"
    click TestFile "https://github.com/rhmt80/code-quality-devops/blob/main/tests/test_calculator.py"
    click Flake8Conf "https://github.com/rhmt80/code-quality-devops/blob/main/.flake8"
    click PylintConf "https://github.com/rhmt80/code-quality-devops/blob/main/.pylintrc"
    click PytestConf "https://github.com/rhmt80/code-quality-devops/blob/main/pytest.ini"
    click PyProject "https://github.com/rhmt80/code-quality-devops/blob/main/pyproject.toml"
    click Requirements "https://github.com/rhmt80/code-quality-devops/blob/main/requirements.txt"
    click SonarProps "https://github.com/rhmt80/code-quality-devops/blob/main/sonar-project.properties"
    click Readme "https://github.com/rhmt80/code-quality-devops/blob/main/README.md"

    %% Styles
    classDef code fill:#cfe2f3,stroke:#0366d6,stroke-width:1px;
    classDef analysis fill:#d5e8d4,stroke:#2e7d32,stroke-width:1px;
    classDef ci fill:#f8cecc,stroke:#c62828,stroke-width:1px;
    classDef external fill:#e1bee7,stroke:#6a1b9a,stroke-width:1px;
```
