# aravind2k6/soa-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/aravind2k6/soa-frontend
- Repository: https://github.com/aravind2k6/soa-frontend

## Overview

GridPulse is a React energy-monitoring portal. Users sign in or request access, then navigate to an overview, meter views, usage analytics, alerts, reports, and profile; managers can review access requests. The frontend uses service modules and a credentialed API client to communicate with a separately hosted API. The graph follows documented routes and relationships in the README and source index; some service-to-page connections are unverified because those page implementations were not sampled.

Main entry points: [`src/App.jsx`](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/App.jsx) (Route application), [`src/Services/api.js`](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/api.js) (API client), [`src/Services/usageService.js`](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/usageService.js) (Usage service), [`src/pages/Dashboard.jsx`](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Dashboard.jsx) (Energy dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and access"]
  node_app["Route application<br/>[App.jsx]"]
  node_guard["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_login["Sign-in and access request<br/>[Login.jsx]"]
end

subgraph group_energy["Energy monitoring"]
  node_dashboard["Energy dashboard<br/>[Dashboard.jsx]"]
  node_meters["Meter list<br/>[Meters.jsx]"]
  node_meter_details["Meter details<br/>[MeterDetails.jsx]"]
  node_analytics["Usage analytics<br/>[UsageAnalytics.jsx]"]
  node_reports["Energy reports<br/>[Reports.jsx]"]
  node_alerts["Alerts<br/>[Alerts.jsx]"]
  node_usage_chart["Usage chart<br/>[UsageChart.jsx]"]
  node_alert_card["Alert card<br/>[AlertCard.jsx]"]
  node_meter_card["Meter card<br/>[MeterCard.jsx]"]
end

subgraph group_management["Account management"]
  node_account_requests["Account request review"]
end

subgraph group_integration["API integration"]
  node_auth["Authentication service<br/>[authService.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_usage_service["Usage service<br/>[usageService.js]"]
  node_meter_service["Meter service<br/>[meterService.js]"]
  node_alert_service["Alert service<br/>[alertService.js]"]
end

node_user(("Portal user"))
node_backend["Backend API"]

node_user -->|"opens portal"| node_app
node_app -->|"routes to"| node_login
node_app -->|"protects routes"| node_guard
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_meters
node_app -->|"routes to"| node_meter_details
node_app -->|"routes to"| node_analytics
node_app -->|"routes to"| node_alerts
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_account_requests
node_login -->|"submits credentials"| node_auth
node_guard -->|"loads session"| node_auth
node_auth -->|"sends requests"| node_api_client
node_api_client -->|"sends HTTP requests"| node_backend
node_account_requests -->|"reviews requests"| node_auth
node_dashboard -->|"reads portal usage"| node_usage_service
node_meter_details -->|"reads portal usage"| node_usage_service
node_meters -->|"requests usage"| node_usage_service
node_analytics -->|"requests usage"| node_usage_service
node_usage_service -->|"requests data"| node_api_client
node_meter_service -->|"requests data"| node_api_client
node_alert_service -->|"requests data"| node_api_client
node_dashboard -->|"renders"| node_usage_chart
node_meter_details -->|"renders"| node_usage_chart
node_analytics -->|"renders"| node_usage_chart
node_dashboard -->|"renders alerts"| node_alert_card
node_alerts -->|"renders alerts"| node_alert_card
node_meters -->|"renders meters"| node_meter_card
node_meters -.->|"may request meter data"| node_meter_service
node_alerts -.->|"may request alert data"| node_alert_service

click node_app "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/App.jsx"
click node_guard "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/ProtectedRoute.jsx"
click node_login "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Login.jsx"
click node_auth "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/authService.js"
click node_api_client "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/api.js"
click node_dashboard "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Dashboard.jsx"
click node_meters "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Meters.jsx"
click node_meter_details "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/MeterDetails.jsx"
click node_analytics "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/UsageAnalytics.jsx"
click node_reports "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Reports.jsx"
click node_alerts "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Alerts.jsx"
click node_usage_service "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/usageService.js"
click node_meter_service "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/meterService.js"
click node_alert_service "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/alertService.js"
click node_usage_chart "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/UsageChart.jsx"
click node_alert_card "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/AlertCard.jsx"
click node_meter_card "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/MeterCard.jsx"
click node_account_requests "https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/AccountRequests.jsx"

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_guard,node_login,node_user toneBlue
class node_dashboard,node_meters,node_meter_details,node_analytics,node_reports,node_alerts,node_usage_chart,node_alert_card,node_meter_card toneAmber
class node_account_requests,node_backend toneMint
class node_auth,node_api_client,node_usage_service,node_meter_service,node_alert_service toneRose
```

## Components

### Navigation and access

- [Route application](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/App.jsx): `src/App.jsx`
- [Protected routes](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [Sign-in and access request](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Login.jsx): `src/pages/Login.jsx`

### Energy monitoring

- [Energy dashboard](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Meter list](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Meters.jsx): `src/pages/Meters.jsx`
- [Meter details](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/MeterDetails.jsx): `src/pages/MeterDetails.jsx`
- [Usage analytics](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/UsageAnalytics.jsx): `src/pages/UsageAnalytics.jsx`
- [Energy reports](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Reports.jsx): `src/pages/Reports.jsx`
- [Alerts](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/Alerts.jsx): `src/pages/Alerts.jsx`
- [Usage chart](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/UsageChart.jsx): `src/components/UsageChart.jsx`
- [Alert card](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/AlertCard.jsx): `src/components/AlertCard.jsx`
- [Meter card](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/components/MeterCard.jsx): `src/components/MeterCard.jsx`

### Account management

- [Account request review](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/pages/AccountRequests.jsx): `src/pages/AccountRequests.jsx`

### API integration

- [Authentication service](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/authService.js): `src/Services/authService.js`
- [API client](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/api.js): `src/Services/api.js`
- [Usage service](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/usageService.js): `src/Services/usageService.js`
- [Meter service](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/meterService.js): `src/Services/meterService.js`
- [Alert service](https://github.com/aravind2k6/soa-frontend/blob/frontend/src/Services/alertService.js): `src/Services/alertService.js`

### Other components

- **Portal user**
- **Backend API**

## Connections

- Portal user → Route application: opens portal (evidence: `src/App.jsx`)
- Route application → Sign-in and access request: routes to (evidence: `src/App.jsx`)
- Route application → Protected routes: protects routes (evidence: `src/App.jsx`)
- Route application → Energy dashboard: routes to (evidence: `src/App.jsx`)
- Route application → Meter list: routes to (evidence: `src/App.jsx`)
- Route application → Meter details: routes to (evidence: `src/App.jsx`)
- Route application → Usage analytics: routes to (evidence: `src/App.jsx`)
- Route application → Alerts: routes to (evidence: `src/App.jsx`)
- Route application → Energy reports: routes to (evidence: `src/App.jsx`)
- Route application → Account request review: routes to (evidence: `src/App.jsx`)
- Sign-in and access request → Authentication service: submits credentials (evidence: `src/pages/Login.jsx`)
- Protected routes → Authentication service: loads session (evidence: `src/components/ProtectedRoute.jsx`)
- Authentication service → API client: sends requests (evidence: `src/Services/authService.js`)
- API client → Backend API: sends HTTP requests (evidence: `README.md`)
- Account request review → Authentication service: reviews requests (evidence: `src/pages/AccountRequests.jsx`)
- Energy dashboard → Usage service: reads portal usage (evidence: `src/pages/Dashboard.jsx`)
- Meter details → Usage service: reads portal usage (evidence: `src/pages/MeterDetails.jsx`)
- Meter list → Usage service: requests usage (evidence: `src/pages/Meters.jsx`)
- Usage analytics → Usage service: requests usage (evidence: `src/pages/UsageAnalytics.jsx`)
- Usage service → API client: requests data (evidence: `src/Services/usageService.js`)
- Meter service → API client: requests data (evidence: `src/Services/meterService.js`)
- Alert service → API client: requests data (evidence: `src/Services/alertService.js`)
- Energy dashboard → Usage chart: renders (evidence: `src/pages/Dashboard.jsx`)
- Meter details → Usage chart: renders (evidence: `src/pages/MeterDetails.jsx`)
- Usage analytics → Usage chart: renders (evidence: `src/pages/UsageAnalytics.jsx`)
- Energy dashboard → Alert card: renders alerts (evidence: `src/pages/Dashboard.jsx`)
- Alerts → Alert card: renders alerts (evidence: `src/pages/Alerts.jsx`)
- Meter list → Meter card: renders meters (evidence: `src/pages/Meters.jsx`)
- Meter list → Meter service: may request meter data
- Alerts → Alert service: may request alert data
