# nethrakarthikkumar/aegis-supply-chain-risk-detector architecture

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

- Interactive diagram: https://gitdiagram.com/nethrakarthikkumar/aegis-supply-chain-risk-detector
- Repository: https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector

## Overview

This Next.js supply-chain risk dashboard presents supply nodes on a tactical map, with threat summaries, node analysis, and mitigation recommendations. The main workflow starts at the dashboard: it loads default or industry-preset nodes, lets users select and inspect nodes, and supports adding nodes manually or by CSV. A risk-score API derives mock dynamic scores from the default node set. The mitigation API is present, but its behavior and wiring are not shown in the supplied excerpts, so its relationships are left unspecified.

Main entry points: [`app/page.tsx`](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/page.tsx) (Dashboard Orchestrator), [`components/map/MapContainer.tsx`](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/map/MapContainer.tsx) (Tactical Map), [`app/configure/page.tsx`](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/configure/page.tsx) (Configuration Page), [`components/config/ConfiguratorModal.tsx`](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/config/ConfiguratorModal.tsx) (Node Configurator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard["Dashboard Orchestrator<br/>[page.tsx]"]
  node_header["Header and Alerts<br/>[Header.tsx]"]
  node_threatlist["Threat List<br/>[ThreatList.tsx]"]
  node_warroom["Node Analysis<br/>[WarRoomPanel.tsx]"]
  node_terminal["Command Terminal"]
  node_map["Tactical Map<br/>[MapContainer.tsx]"]
  node_marker["Node Markers<br/>[NodeMarker.tsx]"]
end

subgraph group_configuration["Node Configuration"]
  node_configpage["Configuration Page<br/>[page.tsx]"]
  node_configurator["Node Configurator"]
end

subgraph group_risk["Risk Data"]
  node_presets["Industry Presets<br/>[presets.ts]"]
  node_nodedata["Default Supply Nodes<br/>[data.ts]"]
  node_nodecontract["Supply Node Type<br/>[index.ts]"]
end

subgraph group_services["API Services"]
  node_riskapi["Risk Score API<br/>[route.ts]"]
  node_mitigationapi["Mitigation API<br/>[route.ts]"]
end

node_user(("Dashboard User"))
node_browser(("Browser Client"))
node_tiles["OpenStreetMap Tiles"]

node_user -->|"opens"| node_dashboard
node_dashboard -->|"renders"| node_header
node_dashboard -->|"renders"| node_threatlist
node_dashboard -->|"renders"| node_warroom
node_dashboard -->|"renders"| node_terminal
node_dashboard -->|"loads and renders"| node_map
node_dashboard -->|"renders"| node_configurator
node_dashboard -->|"loads defaults"| node_nodedata
node_dashboard -->|"selects industry data"| node_presets
node_header -->|"links to"| node_configpage
node_dashboard -->|"accepts node updates"| node_configurator
node_configpage -->|"renders"| node_configurator
node_configpage -->|"loads presets"| node_presets
node_configpage -->|"loads defaults"| node_nodedata
node_configurator -->|"submits node updates"| node_dashboard
node_dashboard -->|"passes nodes and selection"| node_map
node_map -->|"creates node icons"| node_marker
node_map -->|"requests map tiles"| node_tiles
node_map -->|"reports selected node"| node_dashboard
node_dashboard -->|"passes node selection"| node_threatlist
node_dashboard -->|"passes selected node"| node_warroom
node_warroom -->|"looks up node"| node_nodedata
node_riskapi -->|"scores default nodes"| node_nodedata
node_browser -.->|"requests score"| node_riskapi

click node_dashboard "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/page.tsx"
click node_header "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/hud/Header.tsx"
click node_threatlist "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/sidebar/ThreatList.tsx"
click node_warroom "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/sidebar/WarRoomPanel.tsx"
click node_terminal "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/hud/terminal/CommandTerminal.tsx"
click node_map "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/map/MapContainer.tsx"
click node_marker "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/map/NodeMarker.tsx"
click node_configpage "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/configure/page.tsx"
click node_configurator "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/config/ConfiguratorModal.tsx"
click node_presets "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/lib/presets.ts"
click node_nodedata "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/lib/data.ts"
click node_nodecontract "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/types/index.ts"
click node_riskapi "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/api/risk-score/route.ts"
click node_mitigationapi "https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/api/mitigation/route.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_dashboard,node_header,node_threatlist,node_warroom,node_terminal,node_map,node_marker,node_user,node_browser toneBlue
class node_configpage,node_configurator toneAmber
class node_presets,node_nodedata,node_nodecontract toneMint
class node_riskapi,node_mitigationapi toneRose
class node_tiles toneIndigo
```

## Components

### Dashboard

- [Dashboard Orchestrator](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/page.tsx): `app/page.tsx`
- [Header and Alerts](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/hud/Header.tsx): `components/hud/Header.tsx`
- [Threat List](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/sidebar/ThreatList.tsx): `components/sidebar/ThreatList.tsx`
- [Node Analysis](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/sidebar/WarRoomPanel.tsx): `components/sidebar/WarRoomPanel.tsx`
- [Command Terminal](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/hud/terminal/CommandTerminal.tsx): `components/hud/terminal/CommandTerminal.tsx`
- [Tactical Map](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/map/MapContainer.tsx): `components/map/MapContainer.tsx`
- [Node Markers](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/map/NodeMarker.tsx): `components/map/NodeMarker.tsx`

### Node Configuration

- [Configuration Page](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/configure/page.tsx): `app/configure/page.tsx`
- [Node Configurator](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/components/config/ConfiguratorModal.tsx): `components/config/ConfiguratorModal.tsx`

### Risk Data

- [Industry Presets](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/lib/presets.ts): `lib/presets.ts`
- [Default Supply Nodes](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/lib/data.ts): `lib/data.ts`
- [Supply Node Type](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/types/index.ts): `types/index.ts`

### API Services

- [Risk Score API](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/api/risk-score/route.ts): `app/api/risk-score/route.ts`
- [Mitigation API](https://github.com/nethrakarthikkumar/aegis-supply-chain-risk-detector/blob/main/app/api/mitigation/route.ts): `app/api/mitigation/route.ts`

### Other components

- **Dashboard User**
- **Browser Client**
- **OpenStreetMap Tiles**

## Connections

- Dashboard User → Dashboard Orchestrator: opens (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Header and Alerts: renders (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Threat List: renders (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Node Analysis: renders (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Command Terminal: renders (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Tactical Map: loads and renders (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Node Configurator: renders (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Default Supply Nodes: loads defaults (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Industry Presets: selects industry data (evidence: `app/page.tsx`)
- Header and Alerts → Configuration Page: links to (evidence: `components/hud/Header.tsx`)
- Dashboard Orchestrator → Node Configurator: accepts node updates (evidence: `app/page.tsx`)
- Configuration Page → Node Configurator: renders (evidence: `app/configure/page.tsx`)
- Configuration Page → Industry Presets: loads presets (evidence: `app/configure/page.tsx`)
- Configuration Page → Default Supply Nodes: loads defaults (evidence: `app/configure/page.tsx`)
- Node Configurator → Dashboard Orchestrator: submits node updates (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Tactical Map: passes nodes and selection (evidence: `app/page.tsx`)
- Tactical Map → Node Markers: creates node icons (evidence: `components/map/MapContainer.tsx`)
- Tactical Map → OpenStreetMap Tiles: requests map tiles (evidence: `components/map/MapContainer.tsx`)
- Tactical Map → Dashboard Orchestrator: reports selected node (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Threat List: passes node selection (evidence: `app/page.tsx`)
- Dashboard Orchestrator → Node Analysis: passes selected node (evidence: `app/page.tsx`)
- Node Analysis → Default Supply Nodes: looks up node (evidence: `components/sidebar/WarRoomPanel.tsx`)
- Risk Score API → Default Supply Nodes: scores default nodes (evidence: `app/api/risk-score/route.ts`)
- Browser Client → Risk Score API: requests score
