# vineeth4005/solarshare architecture

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

- Interactive diagram: https://gitdiagram.com/vineeth4005/solarshare
- Repository: https://github.com/vineeth4005/solarshare

## Overview

SolarShare is a shared-solar forecasting, allocation, and time-of-use billing platform for industrial estates, with a FastAPI backend and a React dashboard. Its intended user workflow runs from load and weather data through profiles, solar and tenant forecasts, allocation, battery status, and billing/analytics; the repository also includes authentication and estate configuration. The README describes Phase 1 as foundational and says several domain functions are not implemented, while the tree and sampled sources show additional ingestion, profiling, API, and UI modules. Uninspected modules are included only as documented or indexed subsystems; their internal behavior is not inferred.

Main entry points: [`app/main.py`](https://github.com/vineeth4005/solarshare/blob/main/app/main.py) (FastAPI application), [`src/App.tsx`](https://github.com/vineeth4005/solarshare/blob/main/src/App.tsx) (Web application), [`src/api/client.ts`](https://github.com/vineeth4005/solarshare/blob/main/src/api/client.ts) (API client), [`app/db/session.py`](https://github.com/vineeth4005/solarshare/blob/main/app/db/session.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_app["Web application<br/>[App.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_api_types["API types<br/>[api.ts]"]
  node_overview["Overview dashboard<br/>[OverviewPage.tsx]"]
  node_tenant_page["Tenant dashboard"]
  node_profiles_page["Load profiles UI"]
  node_forecast_page["Forecasting UI"]
  node_domain_pages["Energy and billing UI"]
  node_ui_states["Loading and error views<br/>[StateViews.tsx]"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[routes_auth.py]"]
  node_data_routes["Data routes<br/>[routes_data.py]"]
  node_profiles_routes["Profile routes"]
  node_solar_routes["Solar routes<br/>[routes_solar.py]"]
  node_domain_routes["Energy domain routes"]
end

subgraph group_domain["Data and energy"]
  node_electricity_ingest["Electricity ingestion"]
  node_tsf_parser["TSF parser<br/>[tsf_parser.py]"]
  node_load_profiling["Load profiling<br/>[load_profiling.py]"]
  node_nasa_ingest["NASA weather ingestion"]
  node_nasa_api["NASA POWER integration<br/>[nasa_power.py]"]
  node_forecast_services["Forecasting services"]
  node_solar_services["Solar services"]
end

subgraph group_platform["Platform foundation"]
  node_load_store[("Public load records<br/>[public_load.py]")]
  node_weather_store[("Weather records<br/>[weather.py]")]
  node_profile_store[("Profile records<br/>[load_profile.py]")]
  node_db_session[("Database sessions<br/>[session.py]")]
  node_settings["Runtime configuration<br/>[config.py]"]
  node_auth_deps["Auth dependencies<br/>[deps.py]"]
  node_security["JWT and password security<br/>[security.py]"]
end

node_operator(("Estate operator"))

node_operator -->|"uses"| node_app
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_tenant_page
node_app -->|"routes to"| node_profiles_page
node_app -->|"routes to"| node_forecast_page
node_app -->|"routes to"| node_domain_pages
node_overview -->|"requests data"| node_api_client
node_tenant_page -->|"requests data"| node_api_client
node_profiles_page -->|"requests data"| node_api_client
node_forecast_page -->|"requests data"| node_api_client
node_forecast_page -->|"renders"| node_ui_states
node_profiles_page -->|"renders"| node_ui_states
node_api_client -->|"uses types"| node_api_types
node_api_client -->|"calls API"| node_backend
node_backend -->|"registers"| node_auth_routes
node_backend -->|"registers"| node_data_routes
node_backend -->|"registers"| node_profiles_routes
node_backend -->|"registers"| node_solar_routes
node_backend -->|"registers"| node_domain_routes
node_auth_routes -->|"uses"| node_auth_deps
node_auth_deps -->|"validates tokens"| node_security
node_data_routes -->|"invokes"| node_nasa_ingest
node_nasa_ingest -->|"fetches data"| node_nasa_api
node_nasa_ingest -->|"persists"| node_weather_store
node_profiles_routes -->|"reads"| node_load_store
node_profiles_routes -->|"reads"| node_profile_store
node_electricity_ingest -->|"parses with"| node_tsf_parser
node_electricity_ingest -->|"persists"| node_load_store
node_load_profiling -->|"reads observations"| node_load_store
node_load_profiling -->|"writes profiles"| node_profile_store
node_nasa_ingest -->|"uses settings"| node_settings
node_db_session -->|"configures engine"| node_settings
node_backend -->|"initializes schema"| node_db_session
node_data_routes -->|"gets session"| node_db_session
node_profiles_routes -->|"gets session"| node_db_session
node_solar_routes -->|"gets session"| node_db_session
node_solar_routes -.->|"may expose"| node_solar_services
node_domain_routes -.->|"may expose"| node_forecast_services

click node_app "https://github.com/vineeth4005/solarshare/blob/main/src/App.tsx"
click node_api_client "https://github.com/vineeth4005/solarshare/blob/main/src/api/client.ts"
click node_api_types "https://github.com/vineeth4005/solarshare/blob/main/src/types/api.ts"
click node_overview "https://github.com/vineeth4005/solarshare/blob/main/src/pages/OverviewPage.tsx"
click node_tenant_page "https://github.com/vineeth4005/solarshare/blob/main/src/pages/TenantDashboardPage.tsx"
click node_profiles_page "https://github.com/vineeth4005/solarshare/blob/main/src/pages/LoadProfilesPage.tsx"
click node_forecast_page "https://github.com/vineeth4005/solarshare/blob/main/src/pages/ForecastingPage.tsx"
click node_domain_pages "https://github.com/vineeth4005/solarshare/tree/main/src/pages"
click node_ui_states "https://github.com/vineeth4005/solarshare/blob/main/src/components/ui/StateViews.tsx"
click node_backend "https://github.com/vineeth4005/solarshare/blob/main/app/main.py"
click node_auth_routes "https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_auth.py"
click node_data_routes "https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_data.py"
click node_profiles_routes "https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_load_profiles.py"
click node_solar_routes "https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_solar.py"
click node_domain_routes "https://github.com/vineeth4005/solarshare/tree/main/app/api"
click node_electricity_ingest "https://github.com/vineeth4005/solarshare/blob/main/app/services/electricity_ingestion.py"
click node_tsf_parser "https://github.com/vineeth4005/solarshare/blob/main/app/integrations/tsf_parser.py"
click node_load_profiling "https://github.com/vineeth4005/solarshare/blob/main/app/services/load_profiling.py"
click node_nasa_ingest "https://github.com/vineeth4005/solarshare/blob/main/app/services/nasa_power_ingestion.py"
click node_nasa_api "https://github.com/vineeth4005/solarshare/blob/main/app/integrations/nasa_power.py"
click node_forecast_services "https://github.com/vineeth4005/solarshare/blob/main/app/services/tenant_forecasting.py"
click node_solar_services "https://github.com/vineeth4005/solarshare/blob/main/app/services/solar_forecasting.py"
click node_load_store "https://github.com/vineeth4005/solarshare/blob/main/app/models/public_load.py"
click node_weather_store "https://github.com/vineeth4005/solarshare/blob/main/app/models/weather.py"
click node_profile_store "https://github.com/vineeth4005/solarshare/blob/main/app/models/load_profile.py"
click node_db_session "https://github.com/vineeth4005/solarshare/blob/main/app/db/session.py"
click node_settings "https://github.com/vineeth4005/solarshare/blob/main/app/core/config.py"
click node_auth_deps "https://github.com/vineeth4005/solarshare/blob/main/app/api/deps.py"
click node_security "https://github.com/vineeth4005/solarshare/blob/main/app/core/security.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_app,node_api_client,node_api_types,node_overview,node_tenant_page,node_profiles_page,node_forecast_page,node_domain_pages,node_ui_states toneBlue
class node_backend,node_auth_routes,node_data_routes,node_profiles_routes,node_solar_routes,node_domain_routes toneAmber
class node_electricity_ingest,node_tsf_parser,node_load_profiling,node_nasa_ingest,node_nasa_api,node_forecast_services,node_solar_services toneMint
class node_load_store,node_weather_store,node_profile_store,node_db_session,node_settings,node_auth_deps,node_security toneRose
class node_operator toneIndigo
```

## Components

### Dashboard UI

- [Web application](https://github.com/vineeth4005/solarshare/blob/main/src/App.tsx): `src/App.tsx`
- [API client](https://github.com/vineeth4005/solarshare/blob/main/src/api/client.ts): `src/api/client.ts`
- [API types](https://github.com/vineeth4005/solarshare/blob/main/src/types/api.ts): `src/types/api.ts`
- [Overview dashboard](https://github.com/vineeth4005/solarshare/blob/main/src/pages/OverviewPage.tsx): `src/pages/OverviewPage.tsx`
- [Tenant dashboard](https://github.com/vineeth4005/solarshare/blob/main/src/pages/TenantDashboardPage.tsx): `src/pages/TenantDashboardPage.tsx`
- [Load profiles UI](https://github.com/vineeth4005/solarshare/blob/main/src/pages/LoadProfilesPage.tsx): `src/pages/LoadProfilesPage.tsx`
- [Forecasting UI](https://github.com/vineeth4005/solarshare/blob/main/src/pages/ForecastingPage.tsx): `src/pages/ForecastingPage.tsx`
- [Energy and billing UI](https://github.com/vineeth4005/solarshare/tree/main/src/pages): `src/pages`
- [Loading and error views](https://github.com/vineeth4005/solarshare/blob/main/src/components/ui/StateViews.tsx): `src/components/ui/StateViews.tsx`

### Backend API

- [FastAPI application](https://github.com/vineeth4005/solarshare/blob/main/app/main.py): `app/main.py`
- [Authentication routes](https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_auth.py): `app/api/routes_auth.py`
- [Data routes](https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_data.py): `app/api/routes_data.py`
- [Profile routes](https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_load_profiles.py): `app/api/routes_load_profiles.py`
- [Solar routes](https://github.com/vineeth4005/solarshare/blob/main/app/api/routes_solar.py): `app/api/routes_solar.py`
- [Energy domain routes](https://github.com/vineeth4005/solarshare/tree/main/app/api): `app/api`

### Data and energy

- [Electricity ingestion](https://github.com/vineeth4005/solarshare/blob/main/app/services/electricity_ingestion.py): `app/services/electricity_ingestion.py`
- [TSF parser](https://github.com/vineeth4005/solarshare/blob/main/app/integrations/tsf_parser.py): `app/integrations/tsf_parser.py`
- [Load profiling](https://github.com/vineeth4005/solarshare/blob/main/app/services/load_profiling.py): `app/services/load_profiling.py`
- [NASA weather ingestion](https://github.com/vineeth4005/solarshare/blob/main/app/services/nasa_power_ingestion.py): `app/services/nasa_power_ingestion.py`
- [NASA POWER integration](https://github.com/vineeth4005/solarshare/blob/main/app/integrations/nasa_power.py): `app/integrations/nasa_power.py`
- [Forecasting services](https://github.com/vineeth4005/solarshare/blob/main/app/services/tenant_forecasting.py): `app/services/tenant_forecasting.py`
- [Solar services](https://github.com/vineeth4005/solarshare/blob/main/app/services/solar_forecasting.py): `app/services/solar_forecasting.py`

### Platform foundation

- [Public load records](https://github.com/vineeth4005/solarshare/blob/main/app/models/public_load.py): `app/models/public_load.py`
- [Weather records](https://github.com/vineeth4005/solarshare/blob/main/app/models/weather.py): `app/models/weather.py`
- [Profile records](https://github.com/vineeth4005/solarshare/blob/main/app/models/load_profile.py): `app/models/load_profile.py`
- [Database sessions](https://github.com/vineeth4005/solarshare/blob/main/app/db/session.py): `app/db/session.py`
- [Runtime configuration](https://github.com/vineeth4005/solarshare/blob/main/app/core/config.py): `app/core/config.py`
- [Auth dependencies](https://github.com/vineeth4005/solarshare/blob/main/app/api/deps.py): `app/api/deps.py`
- [JWT and password security](https://github.com/vineeth4005/solarshare/blob/main/app/core/security.py): `app/core/security.py`

### Other components

- **Estate operator**

## Connections

- Estate operator → Web application: uses (evidence: `src/App.tsx`)
- Web application → Overview dashboard: routes to (evidence: `src/App.tsx`)
- Web application → Tenant dashboard: routes to (evidence: `src/App.tsx`)
- Web application → Load profiles UI: routes to (evidence: `src/App.tsx`)
- Web application → Forecasting UI: routes to (evidence: `src/App.tsx`)
- Web application → Energy and billing UI: routes to (evidence: `src/App.tsx`)
- Overview dashboard → API client: requests data (evidence: `src/pages/OverviewPage.tsx`)
- Tenant dashboard → API client: requests data (evidence: `src/pages/TenantDashboardPage.tsx`)
- Load profiles UI → API client: requests data (evidence: `src/pages/LoadProfilesPage.tsx`)
- Forecasting UI → API client: requests data (evidence: `src/pages/ForecastingPage.tsx`)
- Forecasting UI → Loading and error views: renders (evidence: `src/pages/ForecastingPage.tsx`)
- Load profiles UI → Loading and error views: renders (evidence: `src/pages/LoadProfilesPage.tsx`)
- API client → API types: uses types (evidence: `src/api/client.ts`)
- API client → FastAPI application: calls API (evidence: `src/api/client.ts`)
- FastAPI application → Authentication routes: registers (evidence: `app/main.py`)
- FastAPI application → Data routes: registers (evidence: `app/main.py`)
- FastAPI application → Profile routes: registers (evidence: `app/main.py`)
- FastAPI application → Solar routes: registers (evidence: `app/main.py`)
- FastAPI application → Energy domain routes: registers (evidence: `app/main.py`)
- Authentication routes → Auth dependencies: uses (evidence: `app/api/routes_auth.py`)
- Auth dependencies → JWT and password security: validates tokens (evidence: `app/api/deps.py`)
- Data routes → NASA weather ingestion: invokes (evidence: `app/api/routes_data.py`)
- NASA weather ingestion → NASA POWER integration: fetches data (evidence: `app/services/nasa_power_ingestion.py`)
- NASA weather ingestion → Weather records: persists (evidence: `app/services/nasa_power_ingestion.py`)
- Profile routes → Public load records: reads (evidence: `app/api/routes_load_profiles.py`)
- Profile routes → Profile records: reads (evidence: `app/api/routes_load_profiles.py`)
- Electricity ingestion → TSF parser: parses with (evidence: `app/services/electricity_ingestion.py`)
- Electricity ingestion → Public load records: persists (evidence: `app/services/electricity_ingestion.py`)
- Load profiling → Public load records: reads observations (evidence: `README.md`)
- Load profiling → Profile records: writes profiles (evidence: `README.md`)
- NASA weather ingestion → Runtime configuration: uses settings (evidence: `app/services/nasa_power_ingestion.py`)
- Database sessions → Runtime configuration: configures engine (evidence: `app/db/session.py`)
- FastAPI application → Database sessions: initializes schema (evidence: `app/main.py`)
- Data routes → Database sessions: gets session (evidence: `app/api/routes_data.py`)
- Profile routes → Database sessions: gets session (evidence: `app/api/routes_load_profiles.py`)
- Solar routes → Database sessions: gets session (evidence: `app/api/routes_solar.py`)
- Solar routes → Solar services: may expose
- Energy domain routes → Forecasting services: may expose
