# palmacitra/geo-poverty-insight architecture

> Architecture diagram of the GitHub repository palmacitra/geo-poverty-insight, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/palmacitra/geo-poverty-insight
- Repository: https://github.com/palmacitra/geo-poverty-insight

## Overview

GEO·POVERTY·INSIGHT is a Next.js prototype for exploring Indonesian poverty indicators through province mapping, national statistics, trend analysis, and short-term-to-long-term policy pathways. The main user workflow is to open the dashboard, inspect the map, select a province for details, and switch to trend or policy views; two API routes also expose province and timeline data. The implementation uses a local prototype dataset. Relationships below are grounded in the README and sampled files; external data ingestion is not shown.

Main entry points: [`src/components/Dashboard.tsx`](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/Dashboard.tsx) (Dashboard), [`src/data/povertyData.ts`](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/data/povertyData.ts) (Prototype dataset), [`src/components/LeafletMap.tsx`](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/LeafletMap.tsx) (Province map), [`src/components/ProvinceDetail.tsx`](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/ProvinceDetail.tsx) (Province detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Dashboard app"]
  node_home["Home page<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_header["Header<br/>[Header.tsx]"]
end

subgraph group_views["Analysis views"]
  node_national["National stats<br/>[NationalStats.tsx]"]
  node_mapview["Map view<br/>[MapView.tsx]"]
  node_map["Province map<br/>[LeafletMap.tsx]"]
  node_detail["Province detail<br/>[ProvinceDetail.tsx]"]
  node_trends["Trend analysis<br/>[TrendChart.tsx]"]
  node_policy["Policy matrix<br/>[PolicyMatrix.tsx]"]
end

subgraph group_data["Data and API"]
  node_dataset["Prototype dataset<br/>[povertyData.ts]"]
  node_provinceapi["Province API<br/>[route.ts]"]
  node_timelineapi["Timeline API<br/>[route.ts]"]
end

node_user(("Dashboard user"))
node_tileprovider["Carto map tiles"]

node_user -->|"opens"| node_home
node_home -->|"renders"| node_dashboard
node_dashboard -->|"renders"| node_header
node_dashboard -->|"renders"| node_national
node_dashboard -->|"renders"| node_mapview
node_dashboard -->|"renders"| node_detail
node_dashboard -->|"renders"| node_trends
node_dashboard -->|"renders"| node_policy
node_mapview -->|"loads dynamically"| node_map
node_map -->|"selects province"| node_dashboard
node_dashboard -->|"passes selection"| node_detail
node_national -->|"reads stats"| node_dataset
node_map -->|"reads provinces"| node_dataset
node_detail -->|"reads indicators"| node_dataset
node_trends -->|"reads timeline"| node_dataset
node_policy -->|"reads domains"| node_dataset
node_provinceapi -->|"returns data"| node_dataset
node_timelineapi -->|"returns data"| node_dataset
node_map -->|"requests tiles"| node_tileprovider

click node_home "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/app/page.tsx"
click node_dashboard "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/Dashboard.tsx"
click node_header "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/Header.tsx"
click node_national "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/NationalStats.tsx"
click node_mapview "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/MapView.tsx"
click node_map "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/LeafletMap.tsx"
click node_detail "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/ProvinceDetail.tsx"
click node_trends "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/TrendChart.tsx"
click node_policy "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/PolicyMatrix.tsx"
click node_dataset "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/data/povertyData.ts"
click node_provinceapi "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/app/api/provinces/route.ts"
click node_timelineapi "https://github.com/palmacitra/geo-poverty-insight/blob/main/src/app/api/timeline/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_home,node_dashboard,node_header,node_user toneBlue
class node_national,node_mapview,node_map,node_detail,node_trends,node_policy toneAmber
class node_dataset,node_provinceapi,node_timelineapi toneMint
class node_tileprovider toneIndigo
```

## Components

### Dashboard app

- [Home page](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Dashboard](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Header](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/Header.tsx): `src/components/Header.tsx`

### Analysis views

- [National stats](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/NationalStats.tsx): `src/components/NationalStats.tsx`
- [Map view](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/MapView.tsx): `src/components/MapView.tsx`
- [Province map](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/LeafletMap.tsx): `src/components/LeafletMap.tsx`
- [Province detail](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/ProvinceDetail.tsx): `src/components/ProvinceDetail.tsx`
- [Trend analysis](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/TrendChart.tsx): `src/components/TrendChart.tsx`
- [Policy matrix](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/components/PolicyMatrix.tsx): `src/components/PolicyMatrix.tsx`

### Data and API

- [Prototype dataset](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/data/povertyData.ts): `src/data/povertyData.ts`
- [Province API](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/app/api/provinces/route.ts): `src/app/api/provinces/route.ts`
- [Timeline API](https://github.com/palmacitra/geo-poverty-insight/blob/main/src/app/api/timeline/route.ts): `src/app/api/timeline/route.ts`

### Other components

- **Dashboard user**
- **Carto map tiles**

## Connections

- Dashboard user → Home page: opens (evidence: `README.md`)
- Home page → Dashboard: renders (evidence: `src/app/page.tsx`)
- Dashboard → Header: renders (evidence: `src/components/Dashboard.tsx`)
- Dashboard → National stats: renders (evidence: `src/components/Dashboard.tsx`)
- Dashboard → Map view: renders (evidence: `src/components/Dashboard.tsx`)
- Dashboard → Province detail: renders (evidence: `src/components/Dashboard.tsx`)
- Dashboard → Trend analysis: renders (evidence: `src/components/Dashboard.tsx`)
- Dashboard → Policy matrix: renders (evidence: `src/components/Dashboard.tsx`)
- Map view → Province map: loads dynamically (evidence: `src/components/MapView.tsx`)
- Province map → Dashboard: selects province (evidence: `src/components/LeafletMap.tsx`)
- Dashboard → Province detail: passes selection (evidence: `src/components/Dashboard.tsx`)
- National stats → Prototype dataset: reads stats (evidence: `src/components/NationalStats.tsx`)
- Province map → Prototype dataset: reads provinces (evidence: `src/components/LeafletMap.tsx`)
- Province detail → Prototype dataset: reads indicators (evidence: `src/components/ProvinceDetail.tsx`)
- Trend analysis → Prototype dataset: reads timeline (evidence: `src/components/TrendChart.tsx`)
- Policy matrix → Prototype dataset: reads domains (evidence: `src/components/PolicyMatrix.tsx`)
- Province API → Prototype dataset: returns data (evidence: `src/app/api/provinces/route.ts`)
- Timeline API → Prototype dataset: returns data (evidence: `src/app/api/timeline/route.ts`)
- Province map → Carto map tiles: requests tiles (evidence: `src/components/LeafletMap.tsx`)
