# shreekamesh/gridpulse architecture

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

- Interactive diagram: https://gitdiagram.com/shreekamesh/gridpulse
- Repository: https://github.com/shreekamesh/gridpulse

## Overview

Grid Plus is a grid-operations pulse analyst UI with an AI-assistant module, simulated feeder telemetry, fault handling, IEEE-based diagnostic references, and a digital-twin view. Operators enter through authentication, then use the Index workspace to inspect simulation and fault state, open dashboard, fault, AI, or twin modules, and review fault details. The graph reflects documented component imports and excerpted calls; several dashboard capabilities are present in the tree but their internal wiring was not sampled, so uncertain links are omitted.

Main entry points: [`src/pages/Index.tsx`](https://github.com/shreekamesh/gridpulse/blob/main/src/pages/Index.tsx) (Operations workspace), [`src/contexts/FaultContext.tsx`](https://github.com/shreekamesh/gridpulse/blob/main/src/contexts/FaultContext.tsx) (Fault lifecycle), [`src/hooks/useGridSimulation.ts`](https://github.com/shreekamesh/gridpulse/blob/main/src/hooks/useGridSimulation.ts) (Grid simulation), [`src/components/modules/TwinModule.tsx`](https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/TwinModule.tsx) (Twin module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access"]
  node_app["App routing<br/>[App.tsx]"]
  node_authpage["Sign-in page<br/>[Auth.tsx]"]
  node_authcontext["Auth state<br/>[AuthContext.tsx]"]
end

subgraph group_workspace["Operations workspace"]
  node_workspacepage["Operations workspace<br/>[Index.tsx]"]
  node_simulation["Grid simulation"]
  node_dashboard["Dashboard module"]
  node_aimodule["AI assistant<br/>[AIModule.tsx]"]
  node_settings["Settings module<br/>[SettingsModule.tsx]"]
  node_hublayer["3D energy hub"]
end

subgraph group_faults["Fault analysis"]
  node_faultsmodule["Faults module<br/>[FaultsModule.tsx]"]
  node_faultcontext["Fault lifecycle<br/>[FaultContext.tsx]"]
  node_faultengine["Fault reasoning<br/>[faultEngine.ts]"]
  node_ieeemap["IEEE references<br/>[ieeeFaultMap.ts]"]
  node_ieeemodal["Fault detail modal<br/>[IEEEModal.tsx]"]
end

subgraph group_twin["Digital twin"]
  node_twinmodule["Twin module<br/>[TwinModule.tsx]"]
  node_treeview["Twin tree view"]
  node_treedata["Twin model<br/>[digitalTwinTree.ts]"]
  node_propagation["Fault propagation"]
end

subgraph group_integration["External integration"]
  node_supabaseclient["Supabase client<br/>[client.ts]"]
  node_supabase[("Supabase")]
end

node_operator(("Operator"))

node_app -->|"provides auth"| node_authcontext
node_app -->|"routes to"| node_authpage
node_app -->|"protects route"| node_workspacepage
node_authpage -->|"uses auth"| node_authcontext
node_authpage -->|"submits credentials"| node_supabaseclient
node_authcontext -->|"tracks session"| node_supabaseclient
node_supabaseclient -->|"connects to"| node_supabase
node_operator -.->|"signs in"| node_authpage
node_operator -.->|"operates grid"| node_workspacepage
node_workspacepage -->|"reads simulation"| node_simulation
node_workspacepage -->|"triggers and resolves"| node_faultcontext
node_workspacepage -->|"renders hub"| node_hublayer
node_workspacepage -->|"opens module"| node_dashboard
node_workspacepage -->|"opens module"| node_faultsmodule
node_workspacepage -->|"opens module"| node_aimodule
node_workspacepage -->|"opens module"| node_twinmodule
node_workspacepage -->|"opens module"| node_settings
node_workspacepage -->|"shows fault details"| node_ieeemodal
node_faultsmodule -->|"uses telemetry"| node_simulation
node_aimodule -->|"uses telemetry"| node_simulation
node_dashboard -->|"uses telemetry"| node_simulation
node_settings -->|"uses telemetry"| node_simulation
node_faultcontext -->|"loads reasoning"| node_faultengine
node_faultcontext -->|"loads standards"| node_ieeemap
node_ieeemodal -->|"reads fault state"| node_faultcontext
node_ieeemodal -->|"shows references"| node_ieeemap
node_twinmodule -->|"reads active faults"| node_faultcontext
node_twinmodule -->|"updates model"| node_treedata
node_twinmodule -->|"renders tree"| node_treeview
node_treeview -->|"uses model"| node_treedata
node_treeview -->|"uses propagation"| node_propagation

click node_app "https://github.com/shreekamesh/gridpulse/blob/main/src/App.tsx"
click node_authpage "https://github.com/shreekamesh/gridpulse/blob/main/src/pages/Auth.tsx"
click node_authcontext "https://github.com/shreekamesh/gridpulse/blob/main/src/contexts/AuthContext.tsx"
click node_workspacepage "https://github.com/shreekamesh/gridpulse/blob/main/src/pages/Index.tsx"
click node_simulation "https://github.com/shreekamesh/gridpulse/blob/main/src/hooks/useGridSimulation.ts"
click node_dashboard "https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/DashboardModule.tsx"
click node_aimodule "https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/AIModule.tsx"
click node_settings "https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/SettingsModule.tsx"
click node_faultsmodule "https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/FaultsModule.tsx"
click node_faultcontext "https://github.com/shreekamesh/gridpulse/blob/main/src/contexts/FaultContext.tsx"
click node_faultengine "https://github.com/shreekamesh/gridpulse/blob/main/src/lib/faultEngine.ts"
click node_ieeemap "https://github.com/shreekamesh/gridpulse/blob/main/src/lib/ieeeFaultMap.ts"
click node_ieeemodal "https://github.com/shreekamesh/gridpulse/blob/main/src/components/IEEEModal.tsx"
click node_twinmodule "https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/TwinModule.tsx"
click node_treeview "https://github.com/shreekamesh/gridpulse/blob/main/src/components/DigitalTwinTree.tsx"
click node_treedata "https://github.com/shreekamesh/gridpulse/blob/main/src/lib/digitalTwinTree.ts"
click node_propagation "https://github.com/shreekamesh/gridpulse/blob/main/src/lib/faultPropagation.ts"
click node_hublayer "https://github.com/shreekamesh/gridpulse/blob/main/src/components/hub/EnergyCoreScene.tsx"
click node_supabaseclient "https://github.com/shreekamesh/gridpulse/blob/main/src/integrations/supabase/client.ts"

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_app,node_authpage,node_authcontext toneBlue
class node_workspacepage,node_simulation,node_dashboard,node_aimodule,node_settings,node_hublayer toneAmber
class node_faultsmodule,node_faultcontext,node_faultengine,node_ieeemap,node_ieeemodal toneMint
class node_twinmodule,node_treeview,node_treedata,node_propagation toneRose
class node_supabaseclient,node_supabase,node_operator toneIndigo
```

## Components

### Access

- [App routing](https://github.com/shreekamesh/gridpulse/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in page](https://github.com/shreekamesh/gridpulse/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [Auth state](https://github.com/shreekamesh/gridpulse/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`

### Operations workspace

- [Operations workspace](https://github.com/shreekamesh/gridpulse/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Grid simulation](https://github.com/shreekamesh/gridpulse/blob/main/src/hooks/useGridSimulation.ts): `src/hooks/useGridSimulation.ts`
- [Dashboard module](https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/DashboardModule.tsx): `src/components/modules/DashboardModule.tsx`
- [AI assistant](https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/AIModule.tsx): `src/components/modules/AIModule.tsx`
- [Settings module](https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/SettingsModule.tsx): `src/components/modules/SettingsModule.tsx`
- [3D energy hub](https://github.com/shreekamesh/gridpulse/blob/main/src/components/hub/EnergyCoreScene.tsx): `src/components/hub/EnergyCoreScene.tsx`

### Fault analysis

- [Faults module](https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/FaultsModule.tsx): `src/components/modules/FaultsModule.tsx`
- [Fault lifecycle](https://github.com/shreekamesh/gridpulse/blob/main/src/contexts/FaultContext.tsx): `src/contexts/FaultContext.tsx`
- [Fault reasoning](https://github.com/shreekamesh/gridpulse/blob/main/src/lib/faultEngine.ts): `src/lib/faultEngine.ts`
- [IEEE references](https://github.com/shreekamesh/gridpulse/blob/main/src/lib/ieeeFaultMap.ts): `src/lib/ieeeFaultMap.ts`
- [Fault detail modal](https://github.com/shreekamesh/gridpulse/blob/main/src/components/IEEEModal.tsx): `src/components/IEEEModal.tsx`

### Digital twin

- [Twin module](https://github.com/shreekamesh/gridpulse/blob/main/src/components/modules/TwinModule.tsx): `src/components/modules/TwinModule.tsx`
- [Twin tree view](https://github.com/shreekamesh/gridpulse/blob/main/src/components/DigitalTwinTree.tsx): `src/components/DigitalTwinTree.tsx`
- [Twin model](https://github.com/shreekamesh/gridpulse/blob/main/src/lib/digitalTwinTree.ts): `src/lib/digitalTwinTree.ts`
- [Fault propagation](https://github.com/shreekamesh/gridpulse/blob/main/src/lib/faultPropagation.ts): `src/lib/faultPropagation.ts`

### External integration

- [Supabase client](https://github.com/shreekamesh/gridpulse/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- **Supabase**

### Other components

- **Operator**

## Connections

- App routing → Auth state: provides auth (evidence: `src/App.tsx`)
- App routing → Sign-in page: routes to (evidence: `src/App.tsx`)
- App routing → Operations workspace: protects route (evidence: `src/App.tsx`)
- Sign-in page → Auth state: uses auth (evidence: `src/pages/Auth.tsx`)
- Sign-in page → Supabase client: submits credentials (evidence: `src/pages/Auth.tsx`)
- Auth state → Supabase client: tracks session (evidence: `src/contexts/AuthContext.tsx`)
- Supabase client → Supabase: connects to (evidence: `src/integrations/supabase/client.ts`)
- Operator → Sign-in page: signs in
- Operator → Operations workspace: operates grid
- Operations workspace → Grid simulation: reads simulation (evidence: `src/pages/Index.tsx`)
- Operations workspace → Fault lifecycle: triggers and resolves (evidence: `src/pages/Index.tsx`)
- Operations workspace → 3D energy hub: renders hub (evidence: `src/pages/Index.tsx`)
- Operations workspace → Dashboard module: opens module (evidence: `src/pages/Index.tsx`)
- Operations workspace → Faults module: opens module (evidence: `src/pages/Index.tsx`)
- Operations workspace → AI assistant: opens module (evidence: `src/pages/Index.tsx`)
- Operations workspace → Twin module: opens module (evidence: `src/pages/Index.tsx`)
- Operations workspace → Settings module: opens module (evidence: `src/pages/Index.tsx`)
- Operations workspace → Fault detail modal: shows fault details (evidence: `src/pages/Index.tsx`)
- Faults module → Grid simulation: uses telemetry (evidence: `src/components/modules/FaultsModule.tsx`)
- AI assistant → Grid simulation: uses telemetry (evidence: `src/components/modules/AIModule.tsx`)
- Dashboard module → Grid simulation: uses telemetry (evidence: `src/components/modules/DashboardModule.tsx`)
- Settings module → Grid simulation: uses telemetry (evidence: `src/components/modules/SettingsModule.tsx`)
- Fault lifecycle → Fault reasoning: loads reasoning (evidence: `src/contexts/FaultContext.tsx`)
- Fault lifecycle → IEEE references: loads standards (evidence: `src/contexts/FaultContext.tsx`)
- Fault detail modal → Fault lifecycle: reads fault state (evidence: `src/components/IEEEModal.tsx`)
- Fault detail modal → IEEE references: shows references (evidence: `src/components/IEEEModal.tsx`)
- Twin module → Fault lifecycle: reads active faults (evidence: `src/components/modules/TwinModule.tsx`)
- Twin module → Twin model: updates model (evidence: `src/components/modules/TwinModule.tsx`)
- Twin module → Twin tree view: renders tree (evidence: `src/components/modules/TwinModule.tsx`)
- Twin tree view → Twin model: uses model (evidence: `src/components/DigitalTwinTree.tsx`)
- Twin tree view → Fault propagation: uses propagation (evidence: `src/components/DigitalTwinTree.tsx`)
