# sap/abap-atc-cr-cv-s4hc architecture

> Architecture diagram of the GitHub repository sap/abap-atc-cr-cv-s4hc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sap/abap-atc-cr-cv-s4hc
- Repository: https://github.com/sap/abap-atc-cr-cv-s4hc

## Overview

##### Project type and purpose
- This is a hybrid “data‐repository + static‐site viewer” project.
- It stores SAP S/4HANA Cloud released/not‐released API metadata (CSV and JSON files), provides a Node.js script to generate JSON from CSV, and offers a React-based “Cloudification API Viewer” UI.
- It also supplies raw JSON endpoints consumed by the ABAP Test Cockpit (ATC) check in SAP systems.

##### File structure
- Top-level:
- .github/workflows/ci.yml → CI/CD pipeline
- scripts/ → data-generation script (generateContents.js)
- src/ → raw CSV & JSON data files (objectReleaseInfo*.json/csv, objectClassifications*.json/csv)
- test/ → test fixtures for validation
- viewer/ → React single-page application + Cypress E2E tests
- Patterns & concerns:
- Separation of data files vs. viewer code
- CI pipeline builds & tests both data integrity and viewer, then deploys static site to GitHub Pages
- Use of raw.githubusercontent.com URLs for consumption by external ATC checks

##### Main components and their interactions
a. Data Generation Component (Node.js script)
- Input: CSV files under src/
- Output: JSON files under src/
- Lives in scripts/generateContents.js
b. Data Store (Git repository)
- Stores all CSV & JSON artifacts
- Source of truth for SAP released API metadata
c. CI/CD Pipeline (GitHub Actions)
- Runs lint, unit tests (if any), data-validation tests (test/), builds viewer, runs Cypress E2E
- Deploys viewer to GitHub Pages; ensures JSON files stay in sync
d. Viewer (React SPA)
- Served as static assets (HTML/CSS/JS)
- Fetches JSON from raw.githubusercontent.com based on query param “version”
- Renders tables, filters, tabs, and detail popovers
e. External Consumers
- ABAP Test Cockpit (SAP BTP) reads the JSON endpoints directly via HTTP
- Other tools/spreadsheets can consume CSV or JSON offline

##### Architectural patterns and design principles
- Layered architecture:
- Data-layer (CSV/JSON files)
- Transformation layer (scripts)
- Presentation layer (React viewer)
- Integration layer (CI/CD, hosting, external ATC check)
- Single Responsibility: each directory holds one concern
- Static-site architecture: no server-side runtime; all logic in build step or client
- Unidirectional data flow in React components

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        CSV((CSV Files)):::data
        JSON((JSON Files)):::data
    end
    click CSV "https://github.com/sap/abap-atc-cr-cv-s4hc/tree/main/src/"
    click JSON "https://github.com/sap/abap-atc-cr-cv-s4hc/tree/main/src/"
    
    %% Transformation Layer
    subgraph "Transformation Layer"
        DataGenerator["Data Generator Script"]:::transform
    end
    click DataGenerator "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/scripts/generateContents.js"
    
    %% Integration Layer
    Repo((Git Repository)):::data
    CI["CI/CD Pipeline"]:::ci
    DataTests["Data Validation Tests"]:::ci
    subgraph "Hosting"
        GHPages["GitHub Pages (Static Hosting)"]:::hosting
    end
    click CI "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/.github/workflows/ci.yml"
    click DataTests "https://github.com/sap/abap-atc-cr-cv-s4hc/tree/main/test/"
    
    %% Viewer Layer
    subgraph "Viewer Layer"
        ViewerApp["Viewer Application (React SPA)"]:::presentation
        subgraph "Viewer Components"
            DataProv["DataProvider"]:::presentation
            FilterProv["FilterProvider"]:::presentation
            ElementTab["ElementTab"]:::presentation
            PageBar["PageBar"]:::presentation
            PageFilter["PageFilter"]:::presentation
            StateStatus["StateStatus"]:::presentation
            ThemePopover["ThemePopover"]:::presentation
        end
        subgraph "Viewer E2E Tests"
            E2E["Cypress Tests"]:::presentation
        end
    end
    click ViewerApp "https://github.com/sap/abap-atc-cr-cv-s4hc/tree/main/viewer/"
    click DataProv "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/viewer/src/providers/DataProvider.tsx"
    click FilterProv "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/viewer/src/providers/FilterProvider.tsx"
    click ElementTab "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/viewer/src/components/ElementTab.tsx"
    click PageBar "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/viewer/src/components/PageBar.tsx"
    click PageFilter "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/viewer/src/components/PageFilter.tsx"
    click StateStatus "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/viewer/src/components/StateStatus.tsx"
    click ThemePopover "https://github.com/sap/abap-atc-cr-cv-s4hc/blob/main/viewer/src/components/ThemePopover.tsx"
    click E2E "https://github.com/sap/abap-atc-cr-cv-s4hc/tree/main/viewer/cypress/"
    
    %% External Consumers
    subgraph "External Consumers"
        Browser["Browser (User)"]:::external
        ATC["ABAP Test Cockpit"]:::external
    end
    
    %% Relationships
    Repo -->|"git push"| CI
    CI -->|"generate JSON from CSV"| DataGenerator
    DataGenerator -->|outputs JSON| JSON
    CSV -->|input CSV| DataGenerator
    CI -->|"runs tests & deploy"| DataTests
    DataTests -->|"validate JSON"| JSON
    CI -->|"build & deploy"| GHPages
    GHPages -->|"serves SPA"| Browser
    Browser -->|"HTTP GET JSON"| JSON
    ATC -->|"HTTP GET JSON"| JSON
    
    %% Styles
    classDef data fill:#cce5ff,stroke:#007bff;
    classDef transform fill:#ffe5b4,stroke:#ff8c00;
    classDef ci fill:#e5ccff,stroke:#800080;
    classDef presentation fill:#ccffcc,stroke:#008000;
    classDef external fill:#ffdede,stroke:#ff0000;
    classDef hosting fill:#e2e3e5,stroke:#6c757d;
```
