# modeva-ai/modeva architecture

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

- Interactive diagram: https://gitdiagram.com/modeva-ai/modeva
- Repository: https://github.com/modeva-ai/modeva

## Overview

##### Project Type and Purpose
- Modeva is designed as a tool to support model development and validation. The focus is on not only building models but also on validating them – this includes simulation, pipelines, and visualization (e.g., saving plots).
- The examples indicate that Modeva caters to diverse use cases via different approaches: high-code examples (BikeSharing, SimuCredit, SavePlots) and a low-code example (SimuCredit) along with a pipeline example (CaliforniaHousing).

##### File Structure
- The project is not organized into multiple source directories; instead, it contains a set of demonstration notebooks alongside configuration files (like .gitignore) and the README.
- The presence of multiple notebooks suggests that the core library (packaged as “modeva”) provides APIs that are exercised in these notebooks. These notebooks effectively serve as examples showing how users can leverage the tool for various modeling tasks.

##### Architectural Insights from the README
- The README emphasizes installation via pip and provides Google Colab examples, implying that Modeva is intended to be used as both a local and cloud-based tool.
- The different notebooks suggest a modular design that supports different workflows (high-code vs. low-code), as well as specific features such as plot saving and pipeline configurations.

a. Main Components:
- Core Engine: The central “modeva” library that provides model development and validation functions.
- API Layers:
- High-Code API: Allows advanced users to build models with full control.
- Low-Code API: Provides a simplified interface for quickly setting up model development.
- Pipeline Manager: Handles sequential processes for tasks like the CaliforniaHousing example.
- Visualization Utility: Manages tasks like saving plots (as seen in the Highcode-SavePlots example).
- Example/Use Case Modules: Notebooks demonstrating various functionalities (BikeSharing, SimuCredit, etc.).

b. Relationships & Interactions:
- The Core Engine underpins all functionalities and is accessed via the High-Code and Low-Code APIs.
- Both API layers interact with the Pipeline Manager and Visualization Utility as needed.
- The example notebooks act as clients that connect to these APIs, triggering workflows such as simulation for SimuCredit or building pipelines for CaliforniaHousing.
- Data flow is initiated in a notebook, goes through API calls, and interacts with internal components like model validators, simulation modules, and plot generators.

c. Architectural Patterns/Design Principles:
- Modular Design: Logical separation between core functionalities and interface layers (high-code vs. low-code).
- Abstraction & Encapsulation: The underlying complexities of model validation and pipeline execution are abstracted away via user-facing APIs.
- Pipeline/Workflow Pattern: Clearly visible in the pipeline example, where stages of data processing and model validation are chained together.

d. Relevant Technologies/Frameworks:
- Python (with package distribution through pip).
- Jupyter Notebooks / Google Colab for example-driven usage.
- While not explicitly mentioned in the files, likely dependencies include popular data science/ML libraries (e.g., NumPy, pandas, scikit-learn, matplotlib) that support the functionalities showcased.

##### Specific Elements
- Clear labels for:
- Modeva Core Engine
- High-Code API
- Low-Code API
- Pipeline Manager
- Visualization Utility
- Example Notebooks (e.g., BikeSharing, SimuCredit, SavePlots, Pipeline-CaliforniaHousing)
- How notebooks invoke API functions.
- The interactions between the API layers and the underlying modules.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Example Notebooks
    subgraph "Example Notebooks"
        H_BS["High-Code: BikeSharing"]:::client
        H_SP["High-Code: SavePlots"]:::client
        H_SC["High-Code: SimuCredit"]:::client
        L_SC["Low-Code: SimuCredit"]:::client
    end

    %% API Layer
    subgraph "API Layer"
        HC_API["High-Code API"]:::api
        LC_API["Low-Code API"]:::api
    end

    %% Modeva Core
    subgraph "Modeva Core"
        CORE["Modeva Core Engine"]:::engine
    end

    %% Core Modules
    subgraph "Core Modules"
        VIS["Visualization Utility"]:::module
        PIPE["Pipeline Manager"]:::module
    end

    %% Project Metadata
    subgraph "Project Metadata"
        META_README["README"]:::meta
        META_GIT[".gitignore"]:::meta
    end

    %% Connections from Notebooks to APIs
    H_BS -->|"calls"| HC_API
    H_SP -->|"calls"| HC_API
    H_SC -->|"calls"| HC_API
    L_SC -->|"calls"| LC_API

    %% Connections from APIs to Core Engine
    HC_API -->|"invokes"| CORE
    LC_API -->|"invokes"| CORE

    %% Core Engine to Modules
    CORE -->|"executes"| VIS
    CORE -->|"executes"| PIPE

    %% Project Metadata supports the Core Engine
    META_README -->|"supports"| CORE
    META_GIT -->|"supports"| CORE

    %% Click Events
    click H_BS "https://github.com/modeva-ai/modeva/blob/main/Highcode-BikeSharing.ipynb"
    click H_SP "https://github.com/modeva-ai/modeva/blob/main/Highcode-SavePlots.ipynb"
    click H_SC "https://github.com/modeva-ai/modeva/blob/main/Highcode-SimuCredit.ipynb"
    click L_SC "https://github.com/modeva-ai/modeva/blob/main/Lowcode-SimuCredit.ipynb"
    click PIPE "https://github.com/modeva-ai/modeva/blob/main/Pipeline-CaliforniaHousing.ipynb"
    click META_README "https://github.com/modeva-ai/modeva/blob/main/README.md"
    click META_GIT "https://github.com/modeva-ai/modeva/blob/main/.gitignore"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef api fill:#FDEBD0,stroke:#000,stroke-width:1px;
    classDef engine fill:#D5F5E3,stroke:#000,stroke-width:1px;
    classDef module fill:#F9E79F,stroke:#000,stroke-width:1px;
    classDef meta fill:#D6DBDF,stroke:#000,stroke-width:1px;
```
