# upstairs-aura/website_v2 architecture

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

- Interactive diagram: https://gitdiagram.com/upstairs-aura/website_v2
- Repository: https://github.com/upstairs-aura/website_v2

## Overview

This is a Next.js machine predictive-maintenance dashboard. A user selects a drill, the dashboard loads its metrics, alerts, health history, and prediction from a FastAPI service, then presents operational status and maintenance recommendations. The page also contains mock drill data and isolated loading/error states. The source excerpts show the dashboard, data-fetching calls, and key panels; other panel details are only represented where their rendering is visible.

Main entry points: [`src/app/page.tsx`](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx) (Machine Dashboard), [`src/app/layout.tsx`](https://github.com/upstairs-aura/website_v2/blob/master/src/app/layout.tsx) (App Layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Dashboard UI"]
  node_dashboard["Machine Dashboard<br/>[page.tsx]"]
  node_fleet["Drill Selector<br/>[page.tsx]"]
  node_metrics["Metrics Panel<br/>[page.tsx]"]
  node_system_info["System Info Panel<br/>[page.tsx]"]
  node_degradation["Degradation Panel<br/>[page.tsx]"]
  node_recommendations["Recommendations Panel<br/>[page.tsx]"]
  node_panel_states["Panel States<br/>[page.tsx]"]
end

subgraph group_data["Asset Data"]
  node_data_loader["Drill Data Loader<br/>[page.tsx]"]
  node_mock_data[("Mock Drill Data<br/>[page.tsx]")]
  node_fastapi["FastAPI Service"]
end

subgraph group_runtime["Page Runtime"]
  node_layout["App Layout<br/>[layout.tsx]"]
  node_recharts["Recharts"]
end

node_operator(("Operator"))

node_operator -->|"opens dashboard"| node_dashboard
node_layout -.->|"renders page"| node_dashboard
node_operator -->|"selects drill"| node_fleet
node_fleet -->|"sets selection"| node_dashboard
node_dashboard -->|"loads selected data"| node_data_loader
node_data_loader -->|"fetches metrics, alerts, history"| node_fastapi
node_data_loader -->|"requests prediction"| node_fastapi
node_dashboard -->|"renders"| node_metrics
node_dashboard -->|"renders"| node_system_info
node_dashboard -->|"renders"| node_degradation
node_dashboard -->|"renders"| node_recommendations
node_dashboard -->|"shows loading or errors"| node_panel_states
node_degradation -->|"draws health chart"| node_recharts

click node_layout "https://github.com/upstairs-aura/website_v2/blob/master/src/app/layout.tsx"
click node_dashboard "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_fleet "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_data_loader "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_mock_data "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_metrics "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_system_info "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_degradation "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_recommendations "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"
click node_panel_states "https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx"

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_dashboard,node_fleet,node_metrics,node_system_info,node_degradation,node_recommendations,node_panel_states toneBlue
class node_data_loader,node_mock_data,node_fastapi toneAmber
class node_layout,node_recharts toneMint
class node_operator toneIndigo
```

## Components

### Dashboard UI

- [Machine Dashboard](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Drill Selector](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Metrics Panel](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [System Info Panel](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Degradation Panel](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Recommendations Panel](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Panel States](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`

### Asset Data

- [Drill Data Loader](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Mock Drill Data](https://github.com/upstairs-aura/website_v2/blob/master/src/app/page.tsx): `src/app/page.tsx`
- **FastAPI Service**

### Page Runtime

- [App Layout](https://github.com/upstairs-aura/website_v2/blob/master/src/app/layout.tsx): `src/app/layout.tsx`
- **Recharts**

### Other components

- **Operator**

## Connections

- Operator → Machine Dashboard: opens dashboard (evidence: `README.md`)
- App Layout → Machine Dashboard: renders page
- Operator → Drill Selector: selects drill (evidence: `src/app/page.tsx`)
- Drill Selector → Machine Dashboard: sets selection (evidence: `src/app/page.tsx`)
- Machine Dashboard → Drill Data Loader: loads selected data (evidence: `src/app/page.tsx`)
- Drill Data Loader → FastAPI Service: fetches metrics, alerts, history (evidence: `src/app/page.tsx`)
- Drill Data Loader → FastAPI Service: requests prediction (evidence: `src/app/page.tsx`)
- Machine Dashboard → Metrics Panel: renders (evidence: `src/app/page.tsx`)
- Machine Dashboard → System Info Panel: renders (evidence: `src/app/page.tsx`)
- Machine Dashboard → Degradation Panel: renders (evidence: `src/app/page.tsx`)
- Machine Dashboard → Recommendations Panel: renders (evidence: `src/app/page.tsx`)
- Machine Dashboard → Panel States: shows loading or errors (evidence: `src/app/page.tsx`)
- Degradation Panel → Recharts: draws health chart (evidence: `src/app/page.tsx`)
