# balakumarr02/encryptcon architecture

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

- Interactive diagram: https://gitdiagram.com/balakumarr02/encryptcon
- Repository: https://github.com/balakumarr02/encryptcon

## Overview

##### Project type and purpose
- This is a full-stack web application called “Encryptcon” that delivers ESG (“green index”) insights and predictions. It consists of:
- A React front end (client/)
- A mixed Node.js + Python back end (server/)
- A MongoDB data store (configured in server/config/mongoConnection.js)
- A ML/pipeline component (green_index.py, portfolio.py, notebook.ipynb, ESG_data.csv) for computing indices and predictions

##### File structure
- Top‐level directories:
- client/ – React single-page app
- server/ – API server code (Express + Python scripts)
- notebook.ipynb – data exploration/training work
- client/ follows standard CRA layout:
- public/ – static HTML, manifest, robots.txt
- src/ – React components, pages, CSS
- .env, package.json
- server/ mixes:
- Node.js entrypoints (index.js, app.py?)
- Express routes/controllers (routes/index.js, controller/predictController.js)
- Python modules for ML (green_index.py, portfolio.py)
- Configuration (config/mongoConnection.js)
- requirements.txt, package.json
- Data assets:
- client/ESG_data.csv
- client/column1_data.csv

##### README
- No text description; rely on file layout and those images.

##### Elements
- Blue for user-facing components
- Green for ML/data services
- Orange for database

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User interaction
    User["User"]:::infra
    User -->|"Interacts via browser"| Frontend

    subgraph "Client Layer"
        Frontend["React Frontend (SPA)"]:::frontend
        Frontend -->|"Serves App"/static| PublicDir
        Frontend -->|"Loads Env Config"| ClientEnv
        Frontend -->|"Installs Dependencies"| ClientPkg
        Frontend -->|"Renders Components"| AppJS
        Frontend -->|"Bootstraps"| IndexJS
        AppJS["App.js"]:::frontend
        IndexJS["index.js"]:::frontend
        ComponentsDir["components/"]:::frontend
        PagesDir["pages/"]:::frontend
        PublicDir["public/"]:::frontend
        ClientPkg["package.json"]:::infra
        ClientEnv[".env"]:::infra

        %% Click events
        click Frontend "https://github.com/balakumarr02/encryptcon/tree/main/client/"
        click PublicDir "https://github.com/balakumarr02/encryptcon/tree/main/client/public/"
        click ClientEnv "https://github.com/balakumarr02/encryptcon/blob/main/client/.env"
        click ClientPkg "https://github.com/balakumarr02/encryptcon/blob/main/client/package.json"
        click AppJS "https://github.com/balakumarr02/encryptcon/blob/main/client/src/App.js"
        click IndexJS "https://github.com/balakumarr02/encryptcon/blob/main/client/src/index.js"
        click ComponentsDir "https://github.com/balakumarr02/encryptcon/tree/main/client/src/components/"
        click PagesDir "https://github.com/balakumarr02/encryptcon/tree/main/client/src/pages/"
    end

    subgraph "Server Layer"
        APIServer["Express API Server"]:::infra
        APIServer -->|"Handles Routes"| Routes
        APIServer -->|"Uses Controller"| Controller
        APIServer -->|"Reads Config"| MongoConfig
        APIServer -->|"Spawns ML Processes"| MLService
        APIServer -->|"Installs Node Deps"| ServerPkg
        APIServer -->|"Installs Python Deps"| Requirements
        Routes["routes/index.js"]:::infra
        Controller["predictController.js"]:::infra
        MongoConfig["mongoConnection.js"]:::db
        ServerPkg["package.json"]:::infra
        Requirements["requirements.txt"]:::infra
        AppPy["app.py"]:::infra
        IndexServer["index.js"]:::infra

        %% Click events
        click APIServer "https://github.com/balakumarr02/encryptcon/tree/main/server/"
        click IndexServer "https://github.com/balakumarr02/encryptcon/blob/main/server/index.js"
        click AppPy "https://github.com/balakumarr02/encryptcon/blob/main/server/app.py"
        click Routes "https://github.com/balakumarr02/encryptcon/blob/main/server/routes/index.js"
        click Controller "https://github.com/balakumarr02/encryptcon/blob/main/server/controller/predictController.js"
        click MongoConfig "https://github.com/balakumarr02/encryptcon/blob/main/server/config/mongoConnection.js"
        click ServerPkg "https://github.com/balakumarr02/encryptcon/blob/main/server/package.json"
        click Requirements "https://github.com/balakumarr02/encryptcon/blob/main/server/requirements.txt"
    end

    subgraph "ML Service"
        MLService["Python ML Services"]:::ml
        MLService -->|"Compute Green Index"| GreenIndex
        MLService -->|"Compute Portfolio Analytics"| Portfolio
        MLService -->|"Experimental Script"| Untitled
        GreenIndex["green_index.py"]:::ml
        Portfolio["portfolio.py"]:::ml
        Untitled["untitled14.py"]:::ml

        %% Click events
        click GreenIndex "https://github.com/balakumarr02/encryptcon/blob/main/server/green_index.py"
        click Portfolio "https://github.com/balakumarr02/encryptcon/blob/main/server/portfolio.py"
        click Untitled "https://github.com/balakumarr02/encryptcon/blob/main/server/untitled14.py"
    end

    subgraph "Data Store"
        MongoDB["MongoDB"]:::db
    end

    subgraph "Data Pipeline & Assets"
        CSV1["ESG_data.csv"]:::data
        CSV2["column1_data.csv"]:::data
        Notebook["notebook.ipynb"]:::data
        CSV1 -->|"Sample Data for Demo"| Frontend
        CSV2 -->|"Sample Data for Demo"| Frontend
        Notebook -.->|"Offline Training"| MLService

        %% Click events
        click CSV1 "https://github.com/balakumarr02/encryptcon/blob/main/client/ESG_data.csv"
        click CSV2 "https://github.com/balakumarr02/encryptcon/blob/main/client/column1_data.csv"
        click Notebook "https://github.com/balakumarr02/encryptcon/blob/main/notebook.ipynb"
    end

    %% Connections
    Frontend -->|"GET /predict"| APIServer
    APIServer -->|"CRUD Operations"| MongoDB
    APIServer -->|"Invoke Prediction"| MLService
    MLService -->|"Returns JSON Predictions"| APIServer
    APIServer -->|"Responds with JSON"| Frontend

    %% Styles
    classDef frontend fill:#aecbfa,stroke:#1f77b4,color:#000
    classDef ml fill:#b7e4c7,stroke:#2d6a4f,color:#000
    classDef db fill:#ffd6a5,stroke:#ff7f0e,color:#000
    classDef data fill:#d0f4de,stroke:#38b000,color:#000
    classDef infra fill:#e8e8e8,stroke:#6c757d,color:#000
```
