# sakthivelan08/green-metrics architecture

> Architecture diagram of the GitHub repository sakthivelan08/green-metrics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sakthivelan08/green-metrics
- Repository: https://github.com/sakthivelan08/green-metrics

## Overview

The tree describes an ESGRC/PIM web application: users configure reporting structures, enter assessment and compliance data, manage audits and workflows, and view reports. The client is a React/TypeScript app backed by ASP.NET API and BAL services, with PostgreSQL-oriented persistence and file handling. The README is a template without product details; feature branches are identified from the source tree. Only a few backend relationships are evidenced by sampled source or the SOURCE INDEX, so other likely links are marked unverified rather than asserted.

Main entry points: [`ESGRC/api/ESGRC/Joy.PIM.Api/Program.cs`](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Program.cs) (HTTP API), [`ESGRC/client/joy-pim/src/layouts/AppLayout.tsx`](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/layouts/AppLayout.tsx) (Application UI), [`ESGRC/client/joy-pim/src/services/AuthManagerService.ts`](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/services/AuthManagerService.ts) (Authentication), [`ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/MasterController.cs`](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/MasterController.cs) (Master data API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_ui["Application UI<br/>[AppLayout.tsx]"]
  node_auth["Authentication"]
  node_clientapi["API client<br/>[ApiManager.ts]"]
  node_assessment["Assessments<br/>[assessment.tsx]"]
  node_compliance["Compliance queries<br/>[QueryRaise.tsx]"]
  node_reportsui["Reports and dashboard"]
end

subgraph group_api["API surface"]
  node_apiapp["HTTP API<br/>[Program.cs]"]
  node_masterapi["Master data API"]
  node_integrationapi["Integration API"]
  node_workflowapi["Workflow API"]
  node_assessmentapi["Assessment API"]
  node_complianceapi["Compliance API"]
  node_reportapi["Report API"]
end

subgraph group_domain["ESGRC services"]
  node_master["Master data services<br/>[IMasterManager.cs]"]
  node_workflow["Process and workflow<br/>[ProcessManager.cs]"]
  node_assessmentlogic["Assessment handling"]
  node_compliancelogic["Compliance handling<br/>[ComplianceRepo.cs]"]
  node_metric["Metrics and templates"]
  node_ingestion["File ingestion"]
  node_reportlogic["Report generation"]
  node_users["User management<br/>[PgUserManager.cs]"]
end

subgraph group_infra["Storage and integrations"]
  node_dbcache["Database cache<br/>[IDbCache.cs]"]
  node_blob[("Blob storage")]
  node_mail["Email delivery<br/>[SmtpMailEngine.cs]"]
end

node_user(("ESGRC user"))
node_externalidp{{"Identity provider"}}
node_externalservices{{"External data services"}}

node_user -.->|"uses"| node_ui
node_ui -.->|"authenticates through"| node_auth
node_auth -->|"calls"| node_clientapi
node_auth -.->|"obtains token"| node_externalidp
node_ui -.->|"opens"| node_assessment
node_ui -.->|"opens"| node_compliance
node_ui -.->|"opens"| node_reportsui
node_clientapi -.->|"sends requests"| node_apiapp
node_apiapp -.->|"routes requests"| node_masterapi
node_apiapp -.->|"routes requests"| node_integrationapi
node_apiapp -.->|"routes requests"| node_workflowapi
node_apiapp -.->|"routes requests"| node_assessmentapi
node_apiapp -.->|"routes requests"| node_complianceapi
node_apiapp -.->|"routes requests"| node_reportapi
node_masterapi -->|"reads cached data"| node_dbcache
node_masterapi -->|"searches master data"| node_master
node_workflowapi -.->|"delegates workflow"| node_workflow
node_assessmentapi -.->|"delegates assessment"| node_assessmentlogic
node_complianceapi -.->|"delegates compliance"| node_compliancelogic
node_reportapi -.->|"delegates reporting"| node_reportlogic
node_integrationapi -->|"configures integration"| node_externalservices
node_workflow -->|"uses cache"| node_dbcache
node_workflow -->|"uses file storage"| node_blob
node_ingestion -->|"uses cache"| node_dbcache
node_users -.->|"requests authentication"| node_externalidp
node_users -.->|"sends account email"| node_mail

click node_ui "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/layouts/AppLayout.tsx"
click node_auth "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/services/AuthManagerService.ts"
click node_clientapi "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/services/ApiManager.ts"
click node_assessment "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/pages/Assessment/assessment.tsx"
click node_compliance "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/pages/Compliance/QueryRaise.tsx"
click node_apiapp "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Program.cs"
click node_masterapi "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/MasterController.cs"
click node_integrationapi "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/IntegrationController.cs"
click node_workflowapi "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/WorkFlowController.cs"
click node_assessmentapi "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/AssessmentController.cs"
click node_complianceapi "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/ComplianceController.cs"
click node_reportapi "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/PdfReportController.cs"
click node_master "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Contracts/IMasterManager.cs"
click node_workflow "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ProcessManager.cs"
click node_assessmentlogic "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/AssessmentRepository.cs"
click node_compliancelogic "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ComplianceRepo.cs"
click node_metric "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/MetricRepository.cs"
click node_ingestion "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Processor/Controllers/api/FileManagerController.cs"
click node_reportlogic "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/PdfReportManager.cs"
click node_users "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/PgUserManager.cs"
click node_dbcache "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Contracts/IDbCache.cs"
click node_blob "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/Storage/PostgreSqlBlobStorage.cs"
click node_mail "https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/SmtpMailEngine.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_auth,node_clientapi,node_assessment,node_compliance,node_reportsui,node_user toneBlue
class node_apiapp,node_masterapi,node_integrationapi,node_workflowapi,node_assessmentapi,node_complianceapi,node_reportapi toneAmber
class node_master,node_workflow,node_assessmentlogic,node_compliancelogic,node_metric,node_ingestion,node_reportlogic,node_users toneMint
class node_dbcache,node_blob,node_mail toneRose
class node_externalidp,node_externalservices toneIndigo
```

## Components

### Web client

- [Application UI](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/layouts/AppLayout.tsx): `ESGRC/client/joy-pim/src/layouts/AppLayout.tsx`
- [Authentication](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/services/AuthManagerService.ts): `ESGRC/client/joy-pim/src/services/AuthManagerService.ts`
- [API client](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/services/ApiManager.ts): `ESGRC/client/joy-pim/src/services/ApiManager.ts`
- [Assessments](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/pages/Assessment/assessment.tsx): `ESGRC/client/joy-pim/src/pages/Assessment/assessment.tsx`
- [Compliance queries](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/client/joy-pim/src/pages/Compliance/QueryRaise.tsx): `ESGRC/client/joy-pim/src/pages/Compliance/QueryRaise.tsx`
- **Reports and dashboard**

### API surface

- [HTTP API](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Program.cs): `ESGRC/api/ESGRC/Joy.PIM.Api/Program.cs`
- [Master data API](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/MasterController.cs): `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/MasterController.cs`
- [Integration API](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/IntegrationController.cs): `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/IntegrationController.cs`
- [Workflow API](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/WorkFlowController.cs): `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/WorkFlowController.cs`
- [Assessment API](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/AssessmentController.cs): `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/AssessmentController.cs`
- [Compliance API](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/ComplianceController.cs): `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/ComplianceController.cs`
- [Report API](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/PdfReportController.cs): `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/PdfReportController.cs`

### ESGRC services

- [Master data services](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Contracts/IMasterManager.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Contracts/IMasterManager.cs`
- [Process and workflow](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ProcessManager.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ProcessManager.cs`
- [Assessment handling](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/AssessmentRepository.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/AssessmentRepository.cs`
- [Compliance handling](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ComplianceRepo.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ComplianceRepo.cs`
- [Metrics and templates](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/MetricRepository.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/MetricRepository.cs`
- [File ingestion](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.Processor/Controllers/api/FileManagerController.cs): `ESGRC/api/ESGRC/Joy.PIM.Processor/Controllers/api/FileManagerController.cs`
- [Report generation](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/PdfReportManager.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/PdfReportManager.cs`
- [User management](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/PgUserManager.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/PgUserManager.cs`

### Storage and integrations

- [Database cache](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Contracts/IDbCache.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Contracts/IDbCache.cs`
- [Blob storage](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/Storage/PostgreSqlBlobStorage.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/Storage/PostgreSqlBlobStorage.cs`
- [Email delivery](https://github.com/sakthivelan08/green-metrics/blob/main/ESGRC/api/ESGRC/Joy.PIM.BAL/SmtpMailEngine.cs): `ESGRC/api/ESGRC/Joy.PIM.BAL/SmtpMailEngine.cs`

### Other components

- **ESGRC user**
- **Identity provider**
- **External data services**

## Connections

- ESGRC user → Application UI: uses
- Application UI → Authentication: authenticates through
- Authentication → API client: calls (evidence: `ESGRC/client/joy-pim/src/services/AuthManagerService.ts`)
- Authentication → Identity provider: obtains token
- Application UI → Assessments: opens
- Application UI → Compliance queries: opens
- Application UI → Reports and dashboard: opens
- API client → HTTP API: sends requests
- HTTP API → Master data API: routes requests
- HTTP API → Integration API: routes requests
- HTTP API → Workflow API: routes requests
- HTTP API → Assessment API: routes requests
- HTTP API → Compliance API: routes requests
- HTTP API → Report API: routes requests
- Master data API → Database cache: reads cached data (evidence: `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/MasterController.cs`)
- Master data API → Master data services: searches master data (evidence: `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/api/MasterController.cs`)
- Workflow API → Process and workflow: delegates workflow
- Assessment API → Assessment handling: delegates assessment
- Compliance API → Compliance handling: delegates compliance
- Report API → Report generation: delegates reporting
- Integration API → External data services: configures integration (evidence: `ESGRC/api/ESGRC/Joy.PIM.Api/Controllers/IntegrationController.cs`)
- Process and workflow → Database cache: uses cache (evidence: `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ProcessManager.cs`)
- Process and workflow → Blob storage: uses file storage (evidence: `ESGRC/api/ESGRC/Joy.PIM.BAL/Implementations/ProcessManager.cs`)
- File ingestion → Database cache: uses cache (evidence: `ESGRC/api/ESGRC/Joy.PIM.Processor/Controllers/api/FileManagerController.cs`)
- User management → Identity provider: requests authentication
- User management → Email delivery: sends account email
