# yh3rcul3sy/naplanta architecture

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

- Interactive diagram: https://gitdiagram.com/yh3rcul3sy/naplanta
- Repository: https://github.com/yh3rcul3sy/naplanta

## Overview

NaPlanta collects public launch listings from property developers, validates and enriches them, preserves daily snapshots and change/status data, then publishes a static map and listing for users. The main path is daily collection → normalization and enrichment → JSON publication → browser filtering and map/list rendering. The README documents nearby amenities, change tracking, transparency, and generated detail/city pages. Some browser and infrastructure connections are documented rather than shown in sampled implementation; those limits are noted with dashed edges.

Main entry points: [`site/js/main.js`](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/main.js) (Browser coordinator), [`coleta/naplanta/app/coleta_diaria.py`](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/app/coleta_diaria.py) (Daily collection), [`coleta/naplanta/fontes/__init__.py`](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/fontes/__init__.py) (Developer adapters), [`coleta/naplanta/config.py`](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/config.py) (Published JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_collector_entry["Collection entry<br/>[coletar.py]"]
  node_daily_run["Daily collection<br/>[coleta_diaria.py]"]
  node_source_registry["Developer adapters<br/>[__init__.py]"]
  node_network["Robots-aware network<br/>[rede.py]"]
end

subgraph group_domain["Domain and enrichment"]
  node_validation["Listing validation<br/>[empreendimento.py]"]
  node_change_tracking["Change tracking<br/>[mudancas.py]"]
  node_geocoding["Geocoding<br/>[geo.py]"]
  node_amenities["Nearby amenities<br/>[arredores.py]"]
  node_photos["Photo thumbnails<br/>[fotos.py]"]
end

subgraph group_publication["Publication"]
  node_json_repository[("JSON repository<br/>[repositorio.py]")]
  node_published_data["Published JSON<br/>[config.py]"]
  node_detail_pages["Detail and city pages<br/>[paginas.py]"]
end

subgraph group_browser["Map experience"]
  node_data_loader["Data loader<br/>[dados.js]"]
  node_app_shell["Browser coordinator<br/>[main.js]"]
  node_filters["Search filters<br/>[filtros.js]"]
  node_map["Interactive map<br/>[mapa.js]"]
  node_listing["Results list<br/>[lista.js]"]
  node_cards["Cards and popups<br/>[modelos.js]"]
end

subgraph group_insight["Status and discovery"]
  node_status_changes["Changes and status<br/>[situacao.js]"]
  node_news_panel["Recent changes panel<br/>[novidades.js]"]
  node_transparency["Data transparency<br/>[transparencia.js]"]
end

node_scheduler(("Daily scheduler"))
node_developer_sites["Developer websites"]
node_osm_nominatim["Nominatim"]
node_osm_overpass["Overpass"]
node_browser_user(("Site visitor"))

node_scheduler -.->|"starts daily run"| node_collector_entry
node_collector_entry -->|"runs"| node_daily_run
node_daily_run -->|"collects from"| node_source_registry
node_source_registry -->|"reads listings"| node_developer_sites
node_source_registry -.->|"uses client"| node_network
node_network -->|"requests allowed pages"| node_developer_sites
node_daily_run -->|"normalizes listings"| node_validation
node_daily_run -->|"compares snapshots"| node_change_tracking
node_daily_run -->|"completes locations"| node_geocoding
node_geocoding -->|"queries"| node_osm_nominatim
node_daily_run -->|"enriches surroundings"| node_amenities
node_amenities -->|"queries"| node_osm_overpass
node_daily_run -->|"completes thumbnails"| node_photos
node_daily_run -->|"reads and writes"| node_json_repository
node_json_repository -->|"stores snapshots"| node_published_data
node_published_data -->|"loads JSON"| node_data_loader
node_published_data -->|"supplies page generation"| node_detail_pages
node_browser_user -->|"uses site"| node_app_shell
node_app_shell -->|"loads data"| node_data_loader
node_app_shell -->|"filters results"| node_filters
node_app_shell -->|"renders results"| node_map
node_app_shell -->|"renders results"| node_listing
node_app_shell -->|"builds content"| node_cards
node_app_shell -->|"summarizes status"| node_status_changes
node_app_shell -->|"shows changes"| node_news_panel
node_app_shell -.->|"offers data details"| node_transparency
node_listing -.->|"renders cards"| node_cards
node_map -.->|"renders popups"| node_cards

click node_collector_entry "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/coletar.py"
click node_daily_run "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/app/coleta_diaria.py"
click node_source_registry "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/fontes/__init__.py"
click node_network "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/rede.py"
click node_validation "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/dominio/empreendimento.py"
click node_change_tracking "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/dominio/mudancas.py"
click node_geocoding "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/geo.py"
click node_amenities "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/arredores.py"
click node_photos "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/fotos.py"
click node_json_repository "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/repositorio.py"
click node_published_data "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/config.py"
click node_detail_pages "https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/publicacao/paginas.py"
click node_data_loader "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/dados.js"
click node_app_shell "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/main.js"
click node_filters "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/nucleo/filtros.js"
click node_map "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/mapa.js"
click node_listing "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/lista.js"
click node_cards "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/modelos.js"
click node_status_changes "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/nucleo/situacao.js"
click node_news_panel "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/novidades.js"
click node_transparency "https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/transparencia.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_collector_entry,node_daily_run,node_source_registry,node_network toneBlue
class node_validation,node_change_tracking,node_geocoding,node_amenities,node_photos toneAmber
class node_json_repository,node_published_data,node_detail_pages toneMint
class node_data_loader,node_app_shell,node_filters,node_map,node_listing,node_cards,node_scheduler toneRose
class node_status_changes,node_news_panel,node_transparency,node_developer_sites,node_osm_nominatim,node_osm_overpass,node_browser_user toneIndigo
```

## Components

### Collection

- [Collection entry](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/coletar.py): `coleta/coletar.py`
- [Daily collection](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/app/coleta_diaria.py): `coleta/naplanta/app/coleta_diaria.py`
- [Developer adapters](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/fontes/__init__.py): `coleta/naplanta/fontes/__init__.py`
- [Robots-aware network](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/rede.py): `coleta/naplanta/infra/rede.py`

### Domain and enrichment

- [Listing validation](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/dominio/empreendimento.py): `coleta/naplanta/dominio/empreendimento.py`
- [Change tracking](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/dominio/mudancas.py): `coleta/naplanta/dominio/mudancas.py`
- [Geocoding](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/geo.py): `coleta/naplanta/infra/geo.py`
- [Nearby amenities](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/arredores.py): `coleta/naplanta/infra/arredores.py`
- [Photo thumbnails](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/fotos.py): `coleta/naplanta/infra/fotos.py`

### Publication

- [JSON repository](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/infra/repositorio.py): `coleta/naplanta/infra/repositorio.py`
- [Published JSON](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/config.py): `coleta/naplanta/config.py`
- [Detail and city pages](https://github.com/yh3rcul3sy/naplanta/blob/main/coleta/naplanta/publicacao/paginas.py): `coleta/naplanta/publicacao/paginas.py`

### Map experience

- [Data loader](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/dados.js): `site/js/dados.js`
- [Browser coordinator](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/main.js): `site/js/main.js`
- [Search filters](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/nucleo/filtros.js): `site/js/nucleo/filtros.js`
- [Interactive map](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/mapa.js): `site/js/ui/mapa.js`
- [Results list](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/lista.js): `site/js/ui/lista.js`
- [Cards and popups](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/modelos.js): `site/js/ui/modelos.js`

### Status and discovery

- [Changes and status](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/nucleo/situacao.js): `site/js/nucleo/situacao.js`
- [Recent changes panel](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/ui/novidades.js): `site/js/ui/novidades.js`
- [Data transparency](https://github.com/yh3rcul3sy/naplanta/blob/main/site/js/transparencia.js): `site/js/transparencia.js`

### Other components

- **Daily scheduler**
- **Developer websites**
- **Nominatim**
- **Overpass**
- **Site visitor**

## Connections

- Daily scheduler → Collection entry: starts daily run
- Collection entry → Daily collection: runs (evidence: `coleta/coletar.py`)
- Daily collection → Developer adapters: collects from (evidence: `coleta/naplanta/app/coleta_diaria.py`)
- Developer adapters → Developer websites: reads listings
- Developer adapters → Robots-aware network: uses client
- Robots-aware network → Developer websites: requests allowed pages (evidence: `coleta/naplanta/infra/rede.py`)
- Daily collection → Listing validation: normalizes listings (evidence: `coleta/naplanta/app/coleta_diaria.py`)
- Daily collection → Change tracking: compares snapshots (evidence: `coleta/naplanta/app/coleta_diaria.py`)
- Daily collection → Geocoding: completes locations (evidence: `coleta/naplanta/app/coleta_diaria.py`)
- Geocoding → Nominatim: queries
- Daily collection → Nearby amenities: enriches surroundings (evidence: `coleta/naplanta/app/coleta_diaria.py`)
- Nearby amenities → Overpass: queries
- Daily collection → Photo thumbnails: completes thumbnails (evidence: `coleta/naplanta/app/coleta_diaria.py`)
- Daily collection → JSON repository: reads and writes (evidence: `coleta/naplanta/app/coleta_diaria.py`)
- JSON repository → Published JSON: stores snapshots (evidence: `coleta/naplanta/infra/repositorio.py`)
- Published JSON → Data loader: loads JSON
- Published JSON → Detail and city pages: supplies page generation (evidence: `coleta/naplanta/publicacao/paginas.py`)
- Site visitor → Browser coordinator: uses site
- Browser coordinator → Data loader: loads data (evidence: `site/js/main.js`)
- Browser coordinator → Search filters: filters results (evidence: `site/js/main.js`)
- Browser coordinator → Interactive map: renders results (evidence: `site/js/main.js`)
- Browser coordinator → Results list: renders results (evidence: `site/js/main.js`)
- Browser coordinator → Cards and popups: builds content (evidence: `site/js/main.js`)
- Browser coordinator → Changes and status: summarizes status (evidence: `site/js/main.js`)
- Browser coordinator → Recent changes panel: shows changes (evidence: `site/js/main.js`)
- Browser coordinator → Data transparency: offers data details
- Results list → Cards and popups: renders cards (evidence: `site/js/ui/modelos.js`)
- Interactive map → Cards and popups: renders popups (evidence: `site/js/ui/modelos.js`)
