# ritvikr-codes/urjamitra architecture

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

- Interactive diagram: https://gitdiagram.com/ritvikr-codes/urjamitra
- Repository: https://github.com/ritvikr-codes/urjamitra

## Overview

UrjaMitra is a Streamlit prototype for factory energy intelligence. Its implemented workflow is: a user adjusts plant assumptions, the app simulates a 30-day plant, computes energy and cost metrics, and presents dashboards and recommendations. Distinct views cover savings, baseline/SEC, predictive maintenance, tariff shifting, carbon reporting, and ROI. The README also describes a proposed sensor-to-cloud deployment, but the repository contains only app.py and no implementation of that infrastructure; the graph therefore maps the software prototype. All implementation nodes share the monolithic app.py path.

Main entry points: [`app.py`](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py) (Streamlit dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Plant simulation"]
  node_simulator["Plant simulator<br/>[app.py]"]
end

subgraph group_analysis["Energy analysis"]
  node_energy_metrics["Energy metrics<br/>[app.py]"]
  node_baseline_sec["Baseline and SEC<br/>[app.py]"]
end

subgraph group_experience["User insights"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_savings["Savings finder<br/>[app.py]"]
  node_maintenance["Predictive maintenance<br/>[app.py]"]
  node_tariff["Tariff optimiser<br/>[app.py]"]
  node_carbon["Carbon ledger<br/>[app.py]"]
  node_roi["ROI calculator<br/>[app.py]"]
end

node_operator(("Plant user"))

node_operator -->|"adjusts inputs"| node_dashboard
node_dashboard -->|"calls simulate"| node_simulator
node_simulator -->|"returns plant data"| node_energy_metrics
node_dashboard -->|"calculates metrics"| node_energy_metrics
node_dashboard -->|"fits baseline"| node_baseline_sec
node_dashboard -->|"renders losses"| node_savings
node_dashboard -->|"renders trends"| node_maintenance
node_dashboard -->|"computes shifting"| node_tariff
node_dashboard -->|"computes emissions"| node_carbon
node_dashboard -->|"computes payback"| node_roi

click node_dashboard "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_simulator "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_energy_metrics "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_baseline_sec "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_savings "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_maintenance "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_tariff "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_carbon "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"
click node_roi "https://github.com/ritvikr-codes/urjamitra/blob/main/app.py"

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_simulator,node_operator toneBlue
class node_energy_metrics,node_baseline_sec toneAmber
class node_dashboard,node_savings,node_maintenance,node_tariff,node_carbon,node_roi toneMint
```

## Components

### Plant simulation

- [Plant simulator](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`

### Energy analysis

- [Energy metrics](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`
- [Baseline and SEC](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`

### User insights

- [Streamlit dashboard](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`
- [Savings finder](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`
- [Predictive maintenance](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`
- [Tariff optimiser](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`
- [Carbon ledger](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`
- [ROI calculator](https://github.com/ritvikr-codes/urjamitra/blob/main/app.py): `app.py`

### Other components

- **Plant user**

## Connections

- Plant user → Streamlit dashboard: adjusts inputs (evidence: `app.py`)
- Streamlit dashboard → Plant simulator: calls simulate (evidence: `app.py`)
- Plant simulator → Energy metrics: returns plant data (evidence: `app.py`)
- Streamlit dashboard → Energy metrics: calculates metrics (evidence: `app.py`)
- Streamlit dashboard → Baseline and SEC: fits baseline (evidence: `app.py`)
- Streamlit dashboard → Savings finder: renders losses (evidence: `app.py`)
- Streamlit dashboard → Predictive maintenance: renders trends (evidence: `app.py`)
- Streamlit dashboard → Tariff optimiser: computes shifting (evidence: `app.py`)
- Streamlit dashboard → Carbon ledger: computes emissions (evidence: `app.py`)
- Streamlit dashboard → ROI calculator: computes payback (evidence: `app.py`)
