# professador/ondeestou architecture

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

## Overview

“Onde Estou” is a browser-based geolocation and map application. Users can locate or enter a position, view it on a map, identify its municipality, and revisit saved positions through history; the app also includes map-click history and measurement controls. The main workflow is orchestrated by script.js, which uses local geographic data and browser storage alongside Leaflet. The README is empty, and excerpts are partial, so some capabilities are represented without inferred implementation links; unsampled API integrations are not asserted.

Main entry points: [`script.js`](https://github.com/professador/ondeestou/blob/main/script.js) (App interactions), [`Leaflet.Measure-master/src/leaflet.measure.js`](https://github.com/professador/ondeestou/blob/main/Leaflet.Measure-master/src/leaflet.measure.js) (Map measurement), [`leaflet`](https://github.com/professador/ondeestou/tree/main/leaflet) (Leaflet map library), [`Estados`](https://github.com/professador/ondeestou/tree/main/Estados) (Municipality boundaries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Location app"]
  node_controller["App interactions<br/>[script.js]"]
  node_position["Position search<br/>[script.js]"]
  node_geolocation["Device location<br/>[script.js]"]
  node_municipality["Municipality lookup<br/>[script.js]"]
  node_mapview["Map display<br/>[script.js]"]
  node_mapclick["Map-click history<br/>[script.js]"]
  node_historyui["History tabs<br/>[script.js]"]
end

subgraph group_geo["Geographic data"]
  node_municipaldata["Municipality boundaries"]
  node_ufnames["State names<br/>[UFs_nomes.js]"]
  node_brstates["State boundaries<br/>[BR-Estados.json]"]
end

subgraph group_mapping["Map runtime"]
  node_leaflet["Leaflet map library"]
  node_measure["Map measurement<br/>[leaflet.measure.js]"]
  node_osm["OpenStreetMap tiles"]
end

subgraph group_persistence["Position history"]
  node_positionhistory[("Search history<br/>[script.js]")]
  node_clickhistory[("Click history<br/>[script.js]")]
end

node_user(("Map user"))

node_user -->|"uses"| node_controller
node_controller -->|"handles search"| node_position
node_controller -.->|"gets location"| node_geolocation
node_controller -->|"looks up area"| node_municipality
node_municipality -->|"searches polygons"| node_municipaldata
node_municipality -.->|"uses state names"| node_ufnames
node_municipality -.->|"uses boundaries"| node_brstates
node_controller -->|"plots position"| node_mapview
node_mapview -->|"renders map"| node_leaflet
node_mapview -->|"adds base layer"| node_osm
node_user -->|"clicks map"| node_mapclick
node_mapclick -->|"saves position"| node_clickhistory
node_user -->|"opens history"| node_historyui
node_historyui -->|"reads history"| node_positionhistory
node_historyui -->|"reads history"| node_clickhistory
node_historyui -->|"plots selection"| node_mapview
node_measure -->|"extends controls"| node_leaflet
node_mapview -.->|"offers measurement"| node_measure

click node_controller "https://github.com/professador/ondeestou/blob/main/script.js"
click node_position "https://github.com/professador/ondeestou/blob/main/script.js"
click node_geolocation "https://github.com/professador/ondeestou/blob/main/script.js"
click node_municipality "https://github.com/professador/ondeestou/blob/main/script.js"
click node_mapview "https://github.com/professador/ondeestou/blob/main/script.js"
click node_mapclick "https://github.com/professador/ondeestou/blob/main/script.js"
click node_historyui "https://github.com/professador/ondeestou/blob/main/script.js"
click node_municipaldata "https://github.com/professador/ondeestou/tree/main/Estados"
click node_ufnames "https://github.com/professador/ondeestou/blob/main/UFs_nomes.js"
click node_brstates "https://github.com/professador/ondeestou/blob/main/BR-Estados.json"
click node_leaflet "https://github.com/professador/ondeestou/tree/main/leaflet"
click node_measure "https://github.com/professador/ondeestou/blob/main/Leaflet.Measure-master/src/leaflet.measure.js"
click node_positionhistory "https://github.com/professador/ondeestou/blob/main/script.js"
click node_clickhistory "https://github.com/professador/ondeestou/blob/main/script.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_controller,node_position,node_geolocation,node_municipality,node_mapview,node_mapclick,node_historyui,node_user toneBlue
class node_municipaldata,node_ufnames,node_brstates toneAmber
class node_leaflet,node_measure,node_osm toneMint
class node_positionhistory,node_clickhistory toneRose
```

## Components

### Location app

- [App interactions](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`
- [Position search](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`
- [Device location](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`
- [Municipality lookup](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`
- [Map display](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`
- [Map-click history](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`
- [History tabs](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`

### Geographic data

- [Municipality boundaries](https://github.com/professador/ondeestou/tree/main/Estados): `Estados`
- [State names](https://github.com/professador/ondeestou/blob/main/UFs_nomes.js): `UFs_nomes.js`
- [State boundaries](https://github.com/professador/ondeestou/blob/main/BR-Estados.json): `BR-Estados.json`

### Map runtime

- [Leaflet map library](https://github.com/professador/ondeestou/tree/main/leaflet): `leaflet`
- [Map measurement](https://github.com/professador/ondeestou/blob/main/Leaflet.Measure-master/src/leaflet.measure.js): `Leaflet.Measure-master/src/leaflet.measure.js`
- **OpenStreetMap tiles**

### Position history

- [Search history](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`
- [Click history](https://github.com/professador/ondeestou/blob/main/script.js): `script.js`

### Other components

- **Map user**

## Connections

- Map user → App interactions: uses
- App interactions → Position search: handles search (evidence: `script.js`)
- App interactions → Device location: gets location (evidence: `script.js`)
- App interactions → Municipality lookup: looks up area (evidence: `script.js`)
- Municipality lookup → Municipality boundaries: searches polygons (evidence: `script.js`)
- Municipality lookup → State names: uses state names
- Municipality lookup → State boundaries: uses boundaries
- App interactions → Map display: plots position (evidence: `script.js`)
- Map display → Leaflet map library: renders map (evidence: `script.js`)
- Map display → OpenStreetMap tiles: adds base layer (evidence: `script.js`)
- Map user → Map-click history: clicks map (evidence: `script.js`)
- Map-click history → Click history: saves position (evidence: `script.js`)
- Map user → History tabs: opens history (evidence: `script.js`)
- History tabs → Search history: reads history (evidence: `script.js`)
- History tabs → Click history: reads history (evidence: `script.js`)
- History tabs → Map display: plots selection (evidence: `script.js`)
- Map measurement → Leaflet map library: extends controls (evidence: `Leaflet.Measure-master/src/leaflet.measure.js`)
- Map display → Map measurement: offers measurement
