# rodrigoaiosa/mapaantenasanatel architecture

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

- Interactive diagram: https://gitdiagram.com/rodrigoaiosa/mapaantenasanatel
- Repository: https://github.com/rodrigoaiosa/mapaantenasanatel

## Overview

Mapa de Antenas Anatel lets people inspect licensed Brazilian cellular stations, compare operators and technologies, and explore coverage and municipal gaps. Its main workflow is to load the published map, search or mark a location, and inspect nearby stations; separate panels provide operator coverage, municipal estimates, and historical trends. The build pipeline downloads and consolidates Anatel records into the map and supporting datasets. The graph preserves the documented spreadsheet and user-facing features. Some browser wiring is unsampled, so only documented or visible relationships are connected.

Main entry points: [`app/js/app.js`](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/app.js) (Map and search), [`scripts/vercel_build.py`](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/scripts/vercel_build.py) (Site build), [`ferramentas/gerar.py`](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/gerar.py) (Map generation), [`coletar/baixar_anatel.py`](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/coletar/baixar_anatel.py) (Station records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Data preparation"]
  node_anatel_stations[("Station records<br/>[baixar_anatel.py]")]
  node_consolidation["Station consolidation<br/>[consolidar.py]"]
  node_map_generator["Map generation<br/>[gerar.py]"]
  node_vercel_build["Site build<br/>[vercel_build.py]"]
  node_spreadsheet["Spreadsheet export<br/>[planilha.py]"]
  node_history_builder["History builder<br/>[historico.py]"]
  node_coverage_download["Anatel coverage data"]
  node_boundary_download["Municipal boundaries<br/>[baixar_malhas.py]"]
end

subgraph group_map["Map exploration"]
  node_map_app["Map and search<br/>[app.js]"]
  node_address_search["Address lookup<br/>[endereco.js]"]
  node_geospatial["Distance and ranking<br/>[geo.js]"]
end

subgraph group_analysis["Coverage and trends"]
  node_coverage_overlay["Operator coverage<br/>[cobertura.js]"]
  node_municipal_analysis["Municipal coverage<br/>[territorio.js]"]
  node_coverage_comparison["Anatel comparison<br/>[semcobertura.js]"]
  node_history_view["Station evolution<br/>[evolucao.js]"]
end

subgraph group_experience["Visitor features"]
  node_panel["Collapsible panels<br/>[painel.js]"]
  node_missions["Guided tour<br/>[tour.js]"]
  node_offline["Offline cache<br/>[sw.js]"]
end

node_visitor(("Map visitor"))
node_map_tiles{{"Base map tiles"}}
node_geocoding{{"Geocoding services"}}
node_coverage_services{{"Operator map services"}}
node_ibge{{"IBGE boundary data"}}

node_visitor -->|"searches and marks"| node_map_app
node_map_app -.->|"looks up addresses"| node_address_search
node_map_app -.->|"geocodes locations"| node_geocoding
node_map_app -->|"displays basemap"| node_map_tiles
node_map_app -.->|"offers coverage layer"| node_coverage_overlay
node_coverage_overlay -->|"requests coverage tiles"| node_coverage_services
node_visitor -->|"opens coverage panel"| node_municipal_analysis
node_municipal_analysis -->|"shows Anatel estimates"| node_coverage_comparison
node_visitor -->|"views yearly trends"| node_history_view
node_visitor -->|"customizes panels"| node_panel
node_visitor -->|"starts tour"| node_missions
node_map_app -->|"ranks nearby operators"| node_geospatial
node_map_app -->|"uses offline cache"| node_offline
node_anatel_stations -->|"supplies station CSV"| node_consolidation
node_vercel_build -->|"downloads records"| node_anatel_stations
node_vercel_build -->|"runs map generation"| node_map_generator
node_map_generator -->|"consolidates records"| node_consolidation
node_map_generator -->|"creates spreadsheet"| node_spreadsheet
node_map_generator -->|"builds history data"| node_history_builder
node_vercel_build -->|"downloads estimates"| node_coverage_download
node_vercel_build -->|"downloads boundaries"| node_boundary_download
node_boundary_download -->|"fetches boundaries"| node_ibge

click node_anatel_stations "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/coletar/baixar_anatel.py"
click node_consolidation "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/consolidar.py"
click node_map_generator "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/gerar.py"
click node_vercel_build "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/scripts/vercel_build.py"
click node_spreadsheet "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/planilha.py"
click node_history_builder "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/historico.py"
click node_coverage_download "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/scripts/baixar_cobertura_anatel.py"
click node_boundary_download "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/scripts/baixar_malhas.py"
click node_map_app "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/app.js"
click node_address_search "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/endereco.js"
click node_coverage_overlay "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/cobertura.js"
click node_municipal_analysis "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/territorio.js"
click node_coverage_comparison "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/semcobertura.js"
click node_history_view "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/evolucao.js"
click node_geospatial "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/geo.js"
click node_panel "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/painel.js"
click node_missions "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/tour.js"
click node_offline "https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/public_extra/sw.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_anatel_stations,node_consolidation,node_map_generator,node_vercel_build,node_spreadsheet,node_history_builder,node_coverage_download,node_boundary_download toneBlue
class node_map_app,node_address_search,node_geospatial toneAmber
class node_coverage_overlay,node_municipal_analysis,node_coverage_comparison,node_history_view toneMint
class node_panel,node_missions,node_offline toneRose
class node_visitor,node_map_tiles,node_geocoding,node_coverage_services,node_ibge toneIndigo
```

## Components

### Data preparation

- [Station records](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/coletar/baixar_anatel.py): `coletar/baixar_anatel.py`
- [Station consolidation](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/consolidar.py): `ferramentas/consolidar.py`
- [Map generation](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/gerar.py): `ferramentas/gerar.py`
- [Site build](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/scripts/vercel_build.py): `scripts/vercel_build.py`
- [Spreadsheet export](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/planilha.py): `ferramentas/planilha.py`
- [History builder](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/ferramentas/historico.py): `ferramentas/historico.py`
- [Anatel coverage data](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/scripts/baixar_cobertura_anatel.py): `scripts/baixar_cobertura_anatel.py`
- [Municipal boundaries](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/scripts/baixar_malhas.py): `scripts/baixar_malhas.py`

### Map exploration

- [Map and search](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/app.js): `app/js/app.js`
- [Address lookup](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/endereco.js): `app/js/endereco.js`
- [Distance and ranking](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/geo.js): `app/js/geo.js`

### Coverage and trends

- [Operator coverage](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/cobertura.js): `app/js/cobertura.js`
- [Municipal coverage](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/territorio.js): `app/js/territorio.js`
- [Anatel comparison](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/semcobertura.js): `app/js/semcobertura.js`
- [Station evolution](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/evolucao.js): `app/js/evolucao.js`

### Visitor features

- [Collapsible panels](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/painel.js): `app/js/painel.js`
- [Guided tour](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/app/js/tour.js): `app/js/tour.js`
- [Offline cache](https://github.com/rodrigoaiosa/mapaantenasanatel/blob/main/public_extra/sw.js): `public_extra/sw.js`

### Other components

- **Map visitor**
- **Base map tiles**
- **Geocoding services**
- **Operator map services**
- **IBGE boundary data**

## Connections

- Map visitor → Map and search: searches and marks (evidence: `README.md`)
- Map and search → Address lookup: looks up addresses
- Map and search → Geocoding services: geocodes locations
- Map and search → Base map tiles: displays basemap (evidence: `app/js/app.js`)
- Map and search → Operator coverage: offers coverage layer
- Operator coverage → Operator map services: requests coverage tiles (evidence: `app/js/cobertura.js`)
- Map visitor → Municipal coverage: opens coverage panel (evidence: `README.md`)
- Municipal coverage → Anatel comparison: shows Anatel estimates (evidence: `README.md`)
- Map visitor → Station evolution: views yearly trends (evidence: `README.md`)
- Map visitor → Collapsible panels: customizes panels (evidence: `README.md`)
- Map visitor → Guided tour: starts tour (evidence: `README.md`)
- Map and search → Distance and ranking: ranks nearby operators (evidence: `README.md`)
- Map and search → Offline cache: uses offline cache (evidence: `README.md`)
- Station records → Station consolidation: supplies station CSV
- Site build → Station records: downloads records (evidence: `scripts/vercel_build.py`)
- Site build → Map generation: runs map generation (evidence: `scripts/vercel_build.py`)
- Map generation → Station consolidation: consolidates records (evidence: `ferramentas/gerar.py`)
- Map generation → Spreadsheet export: creates spreadsheet (evidence: `ferramentas/gerar.py`)
- Map generation → History builder: builds history data (evidence: `ferramentas/gerar.py`)
- Site build → Anatel coverage data: downloads estimates (evidence: `scripts/vercel_build.py`)
- Site build → Municipal boundaries: downloads boundaries (evidence: `scripts/vercel_build.py`)
- Municipal boundaries → IBGE boundary data: fetches boundaries (evidence: `scripts/baixar_malhas.py`)
