# internethealthreport/ihr-website architecture

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

- Interactive diagram: https://gitdiagram.com/internethealthreport/ihr-website
- Repository: https://github.com/internethealthreport/ihr-website

## Overview

##### Main Components and Their File Paths
"ihr-website/src/main.js"
- Main Application Component – This is the central Vue component. Label it “Main App Component” and note its file:
"ihr-website/src/App.vue"
"ihr-website/src/router/index.js"
- Views – These are the pages (features) the app displays (Home, Contact, Documentation, etc.). Represent each view as a distinct component and mention the general file path:
"ihr-website/src/views" (with specific files such as "Home.vue", "BGPMonitor.vue", etc.)
- Components – The reusable parts of the UI (charts, controllers, maps, tables, etc.). Indicate that these are organized in the "ihr-website/src/components" directory and include subpaths where necessary (e.g., charts are in "ihr-website/src/components/charts").
"ihr-website/src/plugins"
- API Integrations (e.g., "ihr-website/src/plugins/IodaApi.js", "ihr-website/src/plugins/RipeApi.js")
- Data Models (e.g., "ihr-website/src/plugins/models/AggregatedAlarmsDataModel.js")
- Utility modules (e.g., "ihr-website/src/plugins/utils/AggregatedAlarmsUtils.js")
"ihr-website/index.html" and "ihr-website/public"
- Infrastructure and DevOps – Represent the deployment configuration and CI/CD pipelines:
- Dockerfile for containerization (file: "ihr-website/Dockerfile")
- GitHub workflows for CI/CD effects (folder: "ihr-website/.github/workflows")
- Environment configuration file (e.g., "ihr-website/.env")

##### Relationships and Data Flow Between Components
- The SPA Entry Point (main.js) initializes the Vue application and integrates the Main App Component.
- The Main App Component loads and sets up the Router. The Router then navigates between different Views.
- Each View comprises several reusable Components (charts, maps, tables, controllers, etc.) that are defined in their respective directories.
- Public Assets (index.html and the public folder) provide the container for the SPA and include static resources referenced by the components.
- Deployment/CI elements (Dockerfile and GitHub workflows) are connected to the entire application lifecycle, indicating both build-time and deployment stages.

##### Architectural Patterns and Design Principles
- Modular Architecture: The project is well-modularized; each Vue component (located in "src/components" and "src/views") is organized by functional domain.
- Separation of Concerns: The division between UI (Vue components and views), business logic (plugins and controllers), and configuration/deployment (Dockerfile, GitHub workflows) adheres to best practices.
- Single-Page Application (SPA) Design: Emphasize the asynchronous data flow between the SPA entry point, router, and dynamic components.

##### Relevant Technologies and Frameworks
- Vue.js Framework – for building the SPA.
- Vite – indicated by "vite.config.js" for build configuration.
- Node.js and NPM – for package management and running scripts.
- Docker – for containerization and deployment.
- ESLint, Prettier, and Babel – for code linting and transpiling as reflected by configuration files.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% SPA Layer
    subgraph "SPA Layer"
        A["SPA Entry point: ihr-website/src/main.js"]:::ui
        B["Main App Component: ihr-website/src/App.vue"]:::ui
        C["Router: ihr-website/src/router/index.js"]:::ui

        subgraph "Views Layer"
            D["Home View: ihr-website/src/views/Home.vue"]:::ui
            E["Contact View: ihr-website/src/views/Contact.vue"]:::ui
            F["Documentation View: ihr-website/src/views/Documentation.vue"]:::ui
        end

        subgraph "Components Layer"
            G["UI Components: ihr-website/src/components"]:::ui
            H["Charts Components: ihr-website/src/components/charts"]:::ui
            I["Controllers: ihr-website/src/components/controllers"]:::ui
        end
    end

    %% Plugins & Integrations
    subgraph "Plugins & Integrations"
        J["Plugins: ihr-website/src/plugins"]:::plugin
        K["Ioda API Integration: ihr-website/src/plugins/IodaApi.js"]:::plugin
        L["Ripe API Integration: ihr-website/src/plugins/RipeApi.js"]:::plugin
        M["Ihr API Integration: ihr-website/src/plugins/IhrApi.js"]:::plugin
        N["Iyp API Integration: ihr-website/src/plugins/IypApi.js"]:::plugin
        O["Aggregated Alarms Data Model: ihr-website/src/plugins/models/AggregatedAlarmsDataModel.js"]:::plugin
        P["Aggregated Alarms Utils: ihr-website/src/plugins/utils/AggregatedAlarmsUtils.js"]:::plugin
    end

    %% Static Assets
    subgraph "Static Assets"
        Q["Static Asset: ihr-website/index.html"]:::asset
        R["Public Folder: ihr-website/public"]:::asset
    end

    %% Infrastructure & DevOps
    subgraph "Infrastructure & DevOps"
        S["Dockerfile: ihr-website/Dockerfile"]:::infra
        T["GitHub Workflows: ihr-website/.github/workflows"]:::infra
        U["Environment Config: ihr-website/.env"]:::infra
    end

    %% Connections between SPA Layer components
    A -->|"initiates"| B
    B -->|"initializes"| C
    C -->|"routesTo"| D
    C -->|"routesTo"| E
    C -->|"routesTo"| F

    %% Relationships between Views and Components
    D -->|"uses"| G
    E -->|"uses"| G
    F -->|"uses"| G
    G -->|"includes"| H
    G -->|"includes"| I

    %% Data flow from Plugins to UI components
    G <-->|"fetchesDataFrom"| J
    D <-->|"fetchesDataFrom"| J

    %% Plugins invoking external API integrations and utilities
    J -->|"calls"| K
    J -->|"calls"| L
    J -->|"calls"| M
    J -->|"calls"| N
    J -->|"utilizes"| O
    J -->|"utilizes"| P

    %% Static Assets provide the container for SPA 
    A -->|"loads"| Q
    A -->|"accesses"| R

    %% Infrastructure & DevOps integration with the SPA lifecycle
    S -->|"containers"| A
    T -->|"CI/CDIntegratesWith"| A
    U -->|"configures"| A
    U -->|"configures"| S
    U -->|"configures"| T

    %% Click Events for SPA Layer
    click A "https://github.com/internethealthreport/ihr-website/blob/master/src/main.js"
    click B "https://github.com/internethealthreport/ihr-website/blob/master/src/App.vue"
    click C "https://github.com/internethealthreport/ihr-website/blob/master/src/router/index.js"
    
    %% Click Events for Views
    click D "https://github.com/internethealthreport/ihr-website/blob/master/src/views/Home.vue"
    click E "https://github.com/internethealthreport/ihr-website/blob/master/src/views/Contact.vue"
    click F "https://github.com/internethealthreport/ihr-website/blob/master/src/views/Documentation.vue"
    
    %% Click Events for Components
    click G "https://github.com/internethealthreport/ihr-website/tree/master/src/components"
    click H "https://github.com/internethealthreport/ihr-website/tree/master/src/components/charts"
    click I "https://github.com/internethealthreport/ihr-website/tree/master/src/components/controllers"
    
    %% Click Events for Plugins and Integrations
    click J "https://github.com/internethealthreport/ihr-website/tree/master/src/plugins"
    click K "https://github.com/internethealthreport/ihr-website/blob/master/src/plugins/IodaApi.js"
    click L "https://github.com/internethealthreport/ihr-website/blob/master/src/plugins/RipeApi.js"
    click M "https://github.com/internethealthreport/ihr-website/blob/master/src/plugins/IhrApi.js"
    click N "https://github.com/internethealthreport/ihr-website/blob/master/src/plugins/IypApi.js"
    click O "https://github.com/internethealthreport/ihr-website/blob/master/src/plugins/models/AggregatedAlarmsDataModel.js"
    click P "https://github.com/internethealthreport/ihr-website/blob/master/src/plugins/utils/AggregatedAlarmsUtils.js"
    
    %% Click Events for Static Assets
    click Q "https://github.com/internethealthreport/ihr-website/blob/master/index.html"
    click R "https://github.com/internethealthreport/ihr-website/tree/master/public"
    
    %% Click Events for Infrastructure & DevOps
    click S "https://github.com/internethealthreport/ihr-website/tree/master/Dockerfile"
    click T "https://github.com/internethealthreport/ihr-website/tree/master/.github/workflows"
    click U "https://github.com/internethealthreport/ihr-website/blob/master/.env"

    %% Styles / Class Definitions
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef plugin fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef asset fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef infra fill:#FFB6C1,stroke:#333,stroke-width:2px;
```
