# ankitcodes18/risklens architecture

> Architecture diagram of the GitHub repository ankitcodes18/risklens, 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/ankitcodes18/risklens
- Repository: https://github.com/ankitcodes18/risklens

## Overview

RiskLens is an environmental-risk information product: visitors explore map layers and forecast horizons, and can access an AI assistant or demo account flows. The frontend presents these capabilities through a Next.js site; its map and forecast viewers check for static image assets rather than showing a live data pipeline in the sampled code. A separate Python climate-agent CLI handles location-based analysis and Open-Meteo data. The excerpts do not establish a connection between that CLI and the website, nor do they show the assistant page’s implementation.

Main entry points: [`frontend/src/app/page.tsx`](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/page.tsx) (Home Page), [`ai/climate_agent.py`](https://github.com/ankitcodes18/risklens/blob/main/ai/climate_agent.py) (Climate Agent CLI), [`frontend/src/components/RiskMapPreview.tsx`](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/RiskMapPreview.tsx) (Map Viewer), [`frontend/src/components/Hero.tsx`](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/Hero.tsx) (Hero)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["RiskLens Website"]
  node_home["Home Page<br/>[page.tsx]"]
  node_hero["Hero<br/>[Hero.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_layout["App Layout<br/>[layout.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_home_cta["Final CTA<br/>[FinalCta.tsx]"]
end

subgraph group_spatial["Risk Mapping"]
  node_risk_section["Risk Map Section<br/>[RiskMapSection.tsx]"]
  node_risk_page["Risk Maps Page<br/>[page.tsx]"]
  node_risk_view["Map Viewer<br/>[RiskMapPreview.tsx]"]
end

subgraph group_forecast["Forecasting"]
  node_forecast_section["Forecast Section"]
  node_predictions_page["Predictions Page<br/>[page.tsx]"]
  node_forecast_view["Forecast Viewer"]
end

subgraph group_guidance["AI Guidance"]
  node_assistant_section["Assistant Section"]
  node_assistant_page["Assistant Page<br/>[page.tsx]"]
  node_climate_cli["Climate Agent CLI<br/>[climate_agent.py]"]
end

subgraph group_access["Account Access"]
  node_login["Login Page<br/>[page.tsx]"]
  node_signup["Signup Page<br/>[page.tsx]"]
end

node_visitor(("Visitor"))
node_open_meteo{{"Open-Meteo APIs"}}
node_gemini{{"Gemini"}}

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_risk_section
node_home -->|"renders"| node_forecast_section
node_home -->|"renders"| node_assistant_section
node_home -->|"renders"| node_home_cta
node_home -->|"renders"| node_navbar
node_home -->|"renders"| node_footer
node_home -->|"uses layout"| node_layout
node_hero -->|"renders"| node_risk_view
node_risk_section -.->|"renders"| node_risk_view
node_risk_page -->|"renders"| node_risk_view
node_forecast_section -->|"renders"| node_forecast_view
node_predictions_page -->|"renders"| node_forecast_view
node_visitor -->|"opens"| node_login
node_visitor -.->|"opens"| node_signup
node_visitor -.->|"opens"| node_assistant_page
node_visitor -->|"enters location"| node_climate_cli
node_climate_cli -->|"fetches weather"| node_open_meteo
node_climate_cli -.->|"uses model"| node_gemini

click node_home "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/page.tsx"
click node_hero "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/Hero.tsx"
click node_risk_section "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/RiskMapSection.tsx"
click node_risk_page "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/risk-maps/page.tsx"
click node_risk_view "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/RiskMapPreview.tsx"
click node_forecast_section "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/ForecastSection.tsx"
click node_predictions_page "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/predictions/page.tsx"
click node_forecast_view "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/ForecastGraphPreview.tsx"
click node_assistant_section "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/AssistantSection.tsx"
click node_assistant_page "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/assistant/page.tsx"
click node_climate_cli "https://github.com/ankitcodes18/risklens/blob/main/ai/climate_agent.py"
click node_login "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/login/page.tsx"
click node_signup "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/signup/page.tsx"
click node_navbar "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/Navbar.tsx"
click node_layout "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/layout.tsx"
click node_footer "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/Footer.tsx"
click node_home_cta "https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/FinalCta.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_home,node_hero,node_navbar,node_layout,node_footer,node_home_cta toneBlue
class node_risk_section,node_risk_page,node_risk_view toneAmber
class node_forecast_section,node_predictions_page,node_forecast_view,node_open_meteo toneMint
class node_assistant_section,node_assistant_page,node_climate_cli toneRose
class node_login,node_signup,node_visitor,node_gemini toneIndigo
```

## Components

### RiskLens Website

- [Home Page](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Hero](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/Hero.tsx): `frontend/src/components/Hero.tsx`
- [Navigation](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/Navbar.tsx): `frontend/src/components/Navbar.tsx`
- [App Layout](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/layout.tsx): `frontend/src/app/layout.tsx`
- [Footer](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/Footer.tsx): `frontend/src/components/Footer.tsx`
- [Final CTA](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/FinalCta.tsx): `frontend/src/components/FinalCta.tsx`

### Risk Mapping

- [Risk Map Section](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/RiskMapSection.tsx): `frontend/src/components/RiskMapSection.tsx`
- [Risk Maps Page](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/risk-maps/page.tsx): `frontend/src/app/risk-maps/page.tsx`
- [Map Viewer](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/RiskMapPreview.tsx): `frontend/src/components/RiskMapPreview.tsx`

### Forecasting

- [Forecast Section](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/ForecastSection.tsx): `frontend/src/components/ForecastSection.tsx`
- [Predictions Page](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/predictions/page.tsx): `frontend/src/app/predictions/page.tsx`
- [Forecast Viewer](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/ForecastGraphPreview.tsx): `frontend/src/components/ForecastGraphPreview.tsx`

### AI Guidance

- [Assistant Section](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/components/AssistantSection.tsx): `frontend/src/components/AssistantSection.tsx`
- [Assistant Page](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/assistant/page.tsx): `frontend/src/app/assistant/page.tsx`
- [Climate Agent CLI](https://github.com/ankitcodes18/risklens/blob/main/ai/climate_agent.py): `ai/climate_agent.py`

### Account Access

- [Login Page](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/login/page.tsx): `frontend/src/app/login/page.tsx`
- [Signup Page](https://github.com/ankitcodes18/risklens/blob/main/frontend/src/app/signup/page.tsx): `frontend/src/app/signup/page.tsx`

### Other components

- **Visitor**
- **Open-Meteo APIs**
- **Gemini**

## Connections

- Visitor → Home Page: opens (evidence: `frontend/src/app/page.tsx`)
- Home Page → Hero: renders (evidence: `frontend/src/app/page.tsx`)
- Home Page → Risk Map Section: renders (evidence: `frontend/src/app/page.tsx`)
- Home Page → Forecast Section: renders (evidence: `frontend/src/app/page.tsx`)
- Home Page → Assistant Section: renders (evidence: `frontend/src/app/page.tsx`)
- Home Page → Final CTA: renders (evidence: `frontend/src/app/page.tsx`)
- Home Page → Navigation: renders (evidence: `frontend/src/app/page.tsx`)
- Home Page → Footer: renders (evidence: `frontend/src/app/page.tsx`)
- Home Page → App Layout: uses layout (evidence: `frontend/src/app/layout.tsx`)
- Hero → Map Viewer: renders (evidence: `frontend/src/components/Hero.tsx`)
- Risk Map Section → Map Viewer: renders
- Risk Maps Page → Map Viewer: renders (evidence: `frontend/src/app/risk-maps/page.tsx`)
- Forecast Section → Forecast Viewer: renders (evidence: `frontend/src/components/ForecastSection.tsx`)
- Predictions Page → Forecast Viewer: renders (evidence: `frontend/src/app/predictions/page.tsx`)
- Visitor → Login Page: opens (evidence: `frontend/src/app/login/page.tsx`)
- Visitor → Signup Page: opens
- Visitor → Assistant Page: opens
- Visitor → Climate Agent CLI: enters location (evidence: `ai/climate_agent.py`)
- Climate Agent CLI → Open-Meteo APIs: fetches weather (evidence: `ai/climate_agent.py`)
- Climate Agent CLI → Gemini: uses model
