# rakesh-100-resai/responsivle_ai_v1 architecture

> Architecture diagram of the GitHub repository rakesh-100-resai/responsivle_ai_v1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rakesh-100-resai/responsivle_ai_v1
- Repository: https://github.com/rakesh-100-resai/responsivle_ai_v1

## Overview

##### Project type and purpose
- This is a full-stack Responsible AI evaluation platform for the Finance sector (Loan Approval use case).
- It provides a web UI for users to upload models/datasets, runs Python-based AI assessments (Fairness, Privacy, Safety), maps results to compliance frameworks (EU AI Act, RBI IT Master Direction), stores results, and renders reports.

##### File structure
- Top-level “app.js” – Express HTTP server entrypoint.
- “package.json” / “package-lock.json” – Node.js dependencies & scripts.
- “routes/” – Express routers (auth.js, assess.js, compliance.js, sectors.js).
- “utils/db.js” – Database connection module.
- Python scripts in root: evaluate_model.py, map_rbi_compliance.py – core AI evaluation & compliance logic.
- “datasets/” – sample datasets & metadata.
- Config/requirements files: requirement.txt (Python deps), proxy_updated_rbi_requirements.json (regulations), evaluation_report.json.

##### README for additional insights
- Tech stack: Node.js/Express (backend), Python 3.10+ (AI logic), static HTML/CSS (frontend).
- Features: user auth, model/dataset upload, automated evaluations, compliance mapping, report export (JSON, CSV, PDF).

##### Elements
- Labels: “Web Client,” “Express API,” “Python Evaluation Service,” “Database,” “File Storage,” “Config Store,” “External PDF/LLM API.”
- From Web Client → Express API (HTTP requests)
- Express API → Database (queries)
- Express API → File Storage (upload/download)
- Express API → Python Service (spawn process or HTTP call)
- Python Service → Express API (results callback)
- Express API → External PDF Generator / LLM API (optional)
- Green for backend services (Express, Python Service)
- Gray documents for config files

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        WC["Web Client"]:::frontend
    end

    subgraph "Backend (Node.js/Express)"
        API["Express API\n(app.js)"]:::backend
        subgraph "Routers"
            Auth["Auth Router"]:::backend
            Assess["Assess Router"]:::backend
            ComplianceR["Compliance Router"]:::backend
            Sectors["Sector Router"]:::backend
        end
        DBConn["DB Connection\n(utils/db.js)"]:::backend
    end

    subgraph "Python Evaluation Service"
        Eval["evaluate_model.py"]:::backend
        Map["map_rbi_compliance.py"]:::backend
        Req["requirements.txt"]:::config
        ReportTpl["evaluation_report.json"]:::config
    end

    subgraph "Data Layer"
        DB["Database"]:::data
        FS["File Storage"]:::data
    end

    subgraph "Config Store"
        DatasetsMeta["datasets/metadata.json"]:::config
        RegConfig["proxy_updated_rbi_requirements.json"]:::config
    end

    External["External PDF/LLM API"]:::external

    WC -->|HTTP Requests| API
    API --> Auth
    API --> Assess
    API --> ComplianceR
    API --> Sectors
    Auth -->|queries| DBConn
    DBConn -->|connects to| DB
    Assess -->|uploads to| FS
    Assess -->|spawns| Eval
    Eval -->|loads metadata| DatasetsMeta
    Eval -->|loads configs| RegConfig
    Eval -->|returns results| API
    Map -->|loads configs| RegConfig
    Map -->|returns mapping| API
    API -->|stores results| DB
    API -->|persists reports| FS
    API -->|requests PDF| External

    click WC "https://github.com/rakesh-100-resai/responsivle_ai_v1/tree/main/public/"
    click API "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/app.js"
    click Auth "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/routes/auth.js"
    click Assess "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/routes/assess.js"
    click ComplianceR "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/routes/compliance.js"
    click Sectors "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/routes/sectors.js"
    click DBConn "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/utils/db.js"
    click Eval "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/evaluate_model.py"
    click Map "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/map_rbi_compliance.py"
    click Req "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/requirement.txt"
    click FS "https://github.com/rakesh-100-resai/responsivle_ai_v1/tree/main/datasets/"
    click DatasetsMeta "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/datasets/metadata.json"
    click RegConfig "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/proxy_updated_rbi_requirements.json"
    click ReportTpl "https://github.com/rakesh-100-resai/responsivle_ai_v1/blob/main/evaluation_report.json"

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px;
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef data fill:#FFA500,stroke:#333,stroke-width:1px;
    classDef config fill:#D3D3D3,stroke:#333,stroke-width:1px;
    classDef external fill:#E0FFFF,stroke:#333,stroke-width:1px;
```
