# p0ll-png/klimatix architecture

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

- Interactive diagram: https://gitdiagram.com/p0ll-png/klimatix
- Repository: https://github.com/p0ll-png/klimatix

## Overview

KLIMATIX is represented here as a live flood-intelligence map: visitors open the map route, which renders the map UI; that UI loads recent flood reports and subscribes to new reports while Mapbox renders the geographic view. The two map components contain substantially duplicated implementations; only the components/ version is routed from the sampled page. The README is a generic Next.js starter and documents no additional product capabilities, so the graph reflects only the sampled map behavior.

Main entry points: [`src/app/map/components/BantayMap.jsx`](https://github.com/p0ll-png/klimatix/blob/main/src/app/map/components/BantayMap.jsx) (Map UI), [`src/app/map/BantayMap.jsx`](https://github.com/p0ll-png/klimatix/blob/main/src/app/map/BantayMap.jsx) (Alternate map), [`src/lib/supabase/client.js`](https://github.com/p0ll-png/klimatix/blob/main/src/lib/supabase/client.js) (Supabase client), [`src/app/map/page.js`](https://github.com/p0ll-png/klimatix/blob/main/src/app/map/page.js) (Map route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Map experience"]
  node_map_route["Map route<br/>[page.js]"]
  node_map_ui["Map UI<br/>[BantayMap.jsx]"]
  node_alternate_map["Alternate map<br/>[BantayMap.jsx]"]
end

subgraph group_data["Flood data"]
  node_supabase_client["Supabase client<br/>[client.js]"]
  node_flood_reports[("Flood reports")]
end

node_visitor(("Map visitor"))
node_mapbox["Mapbox service"]

node_visitor -->|"opens"| node_map_route
node_map_route -->|"renders"| node_map_ui
node_map_ui -->|"uses client"| node_supabase_client
node_map_ui -->|"loads and subscribes"| node_flood_reports
node_map_ui -->|"renders map"| node_mapbox
node_alternate_map -->|"uses client"| node_supabase_client
node_alternate_map -->|"loads and subscribes"| node_flood_reports
node_alternate_map -->|"renders map"| node_mapbox
node_supabase_client -->|"configures access"| node_flood_reports

click node_map_route "https://github.com/p0ll-png/klimatix/blob/main/src/app/map/page.js"
click node_map_ui "https://github.com/p0ll-png/klimatix/blob/main/src/app/map/components/BantayMap.jsx"
click node_alternate_map "https://github.com/p0ll-png/klimatix/blob/main/src/app/map/BantayMap.jsx"
click node_supabase_client "https://github.com/p0ll-png/klimatix/blob/main/src/lib/supabase/client.js"

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_map_route,node_map_ui,node_alternate_map toneBlue
class node_supabase_client,node_flood_reports toneAmber
class node_visitor,node_mapbox toneIndigo
```

## Components

### Map experience

- [Map route](https://github.com/p0ll-png/klimatix/blob/main/src/app/map/page.js): `src/app/map/page.js`
- [Map UI](https://github.com/p0ll-png/klimatix/blob/main/src/app/map/components/BantayMap.jsx): `src/app/map/components/BantayMap.jsx`
- [Alternate map](https://github.com/p0ll-png/klimatix/blob/main/src/app/map/BantayMap.jsx): `src/app/map/BantayMap.jsx`

### Flood data

- [Supabase client](https://github.com/p0ll-png/klimatix/blob/main/src/lib/supabase/client.js): `src/lib/supabase/client.js`
- **Flood reports**

### Other components

- **Map visitor**
- **Mapbox service**

## Connections

- Map visitor → Map route: opens (evidence: `src/app/map/page.js`)
- Map route → Map UI: renders (evidence: `src/app/map/page.js`)
- Map UI → Supabase client: uses client (evidence: `src/app/map/components/BantayMap.jsx`)
- Map UI → Flood reports: loads and subscribes (evidence: `src/app/map/components/BantayMap.jsx`)
- Map UI → Mapbox service: renders map (evidence: `src/app/map/components/BantayMap.jsx`)
- Alternate map → Supabase client: uses client (evidence: `src/app/map/BantayMap.jsx`)
- Alternate map → Flood reports: loads and subscribes (evidence: `src/app/map/BantayMap.jsx`)
- Alternate map → Mapbox service: renders map (evidence: `src/app/map/BantayMap.jsx`)
- Supabase client → Flood reports: configures access (evidence: `src/lib/supabase/client.js`)
