# nahidislam106/brac-weather-station architecture

> Architecture diagram of the GitHub repository nahidislam106/brac-weather-station, 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/nahidislam106/brac-weather-station
- Repository: https://github.com/nahidislam106/brac-weather-station

## Overview

AeroSense Control is a React/Firebase precision-agriculture dashboard. Operators authenticate, then view current and historical station telemetry, explore a weather-driven digital twin and crop disease-risk guidance, and manage their profile and operating settings. The sampled code shows App coordinating authentication state and the latest Firestore reading; views fetch history or evaluate crop rules as their own responsibilities. README-documented incident diagnostics and trained crop/yield prediction remain placeholders; model artifacts exist, but no backend runtime implementation is evidenced. Connections for unsampled subsystems are documented only where the README supports them.

Main entry points: [`frontend/src/App.tsx`](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/App.tsx) (Dashboard shell), [`frontend/src/components/DigitalTwinView.tsx`](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DigitalTwinView.tsx) (Digital twin view), [`frontend/src/auth.ts`](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/auth.ts) (Authentication), [`frontend/src/firestore.ts`](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/firestore.ts) (Telemetry access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Operator access"]
  node_app["Dashboard shell<br/>[App.tsx]"]
  node_login["Sign-in view<br/>[LoginView.tsx]"]
  node_authlogic["Authentication<br/>[auth.ts]"]
end

subgraph group_telemetry["Weather telemetry"]
  node_dashboard["Weather dashboard<br/>[DashboardView.tsx]"]
  node_readings["Sensor readings"]
  node_firestore["Telemetry access<br/>[firestore.ts]"]
  node_twinview["Digital twin view"]
  node_twin_canvas["Twin scene canvas<br/>[StationCanvas.tsx]"]
  node_twin_station["Station model<br/>[WeatherStation.tsx]"]
  node_livepanel["Live data panel<br/>[LiveDataPanel.tsx]"]
  node_history["History charts<br/>[HistoryCharts.tsx]"]
end

subgraph group_insights["Farm decision support"]
  node_cropview["Disease risk view"]
  node_rules["Crop disease rules<br/>[diseaseRules.ts]"]
  node_incidents["Incident diagnostics<br/>[DashboardView.tsx]"]
  node_prediction["Crop yield prediction"]
end

subgraph group_operations["Operations management"]
  node_settings["Operations settings<br/>[SettingsView.tsx]"]
  node_profile["Operator profile<br/>[ProfileView.tsx]"]
end

subgraph group_infra["Firebase services"]
  node_store[("Firestore")]
  node_firebase["Firebase client<br/>[firebase.ts]"]
end

node_operator(("Field operator"))

node_operator -->|"uses"| node_app
node_app -->|"shows"| node_login
node_login -->|"authenticates"| node_authlogic
node_app -->|"loads profile"| node_authlogic
node_app -->|"loads latest"| node_firestore
node_authlogic -->|"uses"| node_firebase
node_firestore -->|"uses"| node_firebase
node_firebase -->|"connects"| node_store
node_authlogic -->|"reads/writes profiles"| node_store
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_readings
node_app -->|"routes to"| node_twinview
node_app -->|"routes to"| node_cropview
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_profile
node_dashboard -->|"fetches history"| node_firestore
node_readings -->|"renders"| node_livepanel
node_twinview -->|"renders"| node_twin_canvas
node_twinview -->|"renders"| node_livepanel
node_twinview -->|"renders"| node_history
node_twin_canvas -->|"renders"| node_twin_station
node_cropview -->|"evaluates"| node_rules
node_operator -->|"reviews"| node_incidents
node_operator -->|"requests guidance"| node_prediction
node_operator -->|"configures"| node_settings
node_operator -->|"edits"| node_profile

click node_app "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/App.tsx"
click node_login "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/LoginView.tsx"
click node_authlogic "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/auth.ts"
click node_dashboard "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DashboardView.tsx"
click node_readings "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/SensorReadingsView.tsx"
click node_firestore "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/firestore.ts"
click node_twinview "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DigitalTwinView.tsx"
click node_twin_canvas "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/StationCanvas.tsx"
click node_twin_station "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/WeatherStation.tsx"
click node_livepanel "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/LiveDataPanel.tsx"
click node_history "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/HistoryCharts.tsx"
click node_cropview "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DiseaseRiskView.tsx"
click node_rules "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/diseaseRules.ts"
click node_incidents "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DashboardView.tsx"
click node_prediction "https://github.com/nahidislam106/brac-weather-station/tree/main/backend/crop_model_artifacts."
click node_settings "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/SettingsView.tsx"
click node_profile "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/ProfileView.tsx"
click node_firebase "https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/firebase.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_login,node_authlogic toneBlue
class node_dashboard,node_readings,node_firestore,node_twinview,node_twin_canvas,node_twin_station,node_livepanel,node_history toneAmber
class node_cropview,node_rules,node_incidents,node_prediction toneMint
class node_settings,node_profile toneRose
class node_store,node_firebase,node_operator toneIndigo
```

## Components

### Operator access

- [Dashboard shell](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign-in view](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/LoginView.tsx): `frontend/src/components/LoginView.tsx`
- [Authentication](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/auth.ts): `frontend/src/auth.ts`

### Weather telemetry

- [Weather dashboard](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DashboardView.tsx): `frontend/src/components/DashboardView.tsx`
- [Sensor readings](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/SensorReadingsView.tsx): `frontend/src/components/SensorReadingsView.tsx`
- [Telemetry access](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/firestore.ts): `frontend/src/firestore.ts`
- [Digital twin view](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DigitalTwinView.tsx): `frontend/src/components/DigitalTwinView.tsx`
- [Twin scene canvas](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/StationCanvas.tsx): `frontend/src/components/StationCanvas.tsx`
- [Station model](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/WeatherStation.tsx): `frontend/src/components/WeatherStation.tsx`
- [Live data panel](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/LiveDataPanel.tsx): `frontend/src/components/LiveDataPanel.tsx`
- [History charts](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/HistoryCharts.tsx): `frontend/src/components/HistoryCharts.tsx`

### Farm decision support

- [Disease risk view](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DiseaseRiskView.tsx): `frontend/src/components/DiseaseRiskView.tsx`
- [Crop disease rules](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/diseaseRules.ts): `frontend/src/diseaseRules.ts`
- [Incident diagnostics](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/DashboardView.tsx): `frontend/src/components/DashboardView.tsx`
- [Crop yield prediction](https://github.com/nahidislam106/brac-weather-station/tree/main/backend/crop_model_artifacts.): `backend/crop_model_artifacts.`

### Operations management

- [Operations settings](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/SettingsView.tsx): `frontend/src/components/SettingsView.tsx`
- [Operator profile](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/components/ProfileView.tsx): `frontend/src/components/ProfileView.tsx`

### Firebase services

- **Firestore**
- [Firebase client](https://github.com/nahidislam106/brac-weather-station/blob/main/frontend/src/firebase.ts): `frontend/src/firebase.ts`

### Other components

- **Field operator**

## Connections

- Field operator → Dashboard shell: uses (evidence: `README.md`)
- Dashboard shell → Sign-in view: shows (evidence: `frontend/src/App.tsx`)
- Sign-in view → Authentication: authenticates (evidence: `frontend/src/components/LoginView.tsx`)
- Dashboard shell → Authentication: loads profile (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Telemetry access: loads latest (evidence: `frontend/src/App.tsx`)
- Authentication → Firebase client: uses (evidence: `frontend/src/auth.ts`)
- Telemetry access → Firebase client: uses (evidence: `frontend/src/firestore.ts`)
- Firebase client → Firestore: connects (evidence: `frontend/src/firebase.ts`)
- Authentication → Firestore: reads/writes profiles (evidence: `frontend/src/auth.ts`)
- Dashboard shell → Weather dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Sensor readings: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Digital twin view: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Disease risk view: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Operations settings: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Operator profile: routes to (evidence: `frontend/src/App.tsx`)
- Weather dashboard → Telemetry access: fetches history (evidence: `frontend/src/components/DashboardView.tsx`)
- Sensor readings → Live data panel: renders (evidence: `frontend/src/components/SensorReadingsView.tsx`)
- Digital twin view → Twin scene canvas: renders (evidence: `frontend/src/components/DigitalTwinView.tsx`)
- Digital twin view → Live data panel: renders (evidence: `frontend/src/components/DigitalTwinView.tsx`)
- Digital twin view → History charts: renders (evidence: `frontend/src/components/DigitalTwinView.tsx`)
- Twin scene canvas → Station model: renders (evidence: `frontend/src/components/StationCanvas.tsx`)
- Disease risk view → Crop disease rules: evaluates (evidence: `frontend/src/components/DiseaseRiskView.tsx`)
- Field operator → Incident diagnostics: reviews (evidence: `README.md`)
- Field operator → Crop yield prediction: requests guidance (evidence: `README.md`)
- Field operator → Operations settings: configures (evidence: `README.md`)
- Field operator → Operator profile: edits (evidence: `README.md`)
