# kauanmonteiro/dashboard-crescimento-jundiai architecture

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

- Interactive diagram: https://gitdiagram.com/kauanmonteiro/dashboard-crescimento-jundiai
- Repository: https://github.com/kauanmonteiro/dashboard-crescimento-jundiai

## Overview

A Streamlit dashboard presents Jundiaí’s population and economy: it loads local CSVs or falls back to the IBGE API, prepares filtered series and derived indicators, then displays charts, metrics, tables, and CSV downloads. The separate API module fetches locality and SIDRA data, transforms population and GDP, and can export the resulting datasets. Relationships are grounded in the excerpts and README; the dashboard excerpt omits some filtering and preparation code, so those internal details are represented only at subsystem level.

Main entry points: [`api_ibge.py`](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py) (IBGE API client), [`dashboard.py`](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py) (Streamlit app), [`populacao_jundiai.csv`](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/populacao_jundiai.csv) (Local datasets), [`pib_jundiai.csv`](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/pib_jundiai.csv) (GDP dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_streamlit_app["Streamlit app<br/>[dashboard.py]"]
  node_population_view["Population analysis<br/>[dashboard.py]"]
  node_economy_view["Economy analysis<br/>[dashboard.py]"]
  node_data_view["Data and methodology<br/>[dashboard.py]"]
  node_filters["Analysis filters<br/>[dashboard.py]"]
  node_charts["Charts and metrics<br/>[dashboard.py]"]
  node_downloads["CSV downloads<br/>[dashboard.py]"]
  node_loader["Cached data loader<br/>[dashboard.py]"]
end

subgraph group_data["Data acquisition"]
  node_local_csv["Local datasets"]
  node_pib_csv["GDP dataset<br/>[pib_jundiai.csv]"]
  node_ibge_api{{"IBGE services"}}
  node_api_client["IBGE API client<br/>[api_ibge.py]"]
  node_locality_lookup["Municipality lookup<br/>[api_ibge.py]"]
  node_sidra_fetch["SIDRA table fetching<br/>[api_ibge.py]"]
  node_csv_export["Dataset export<br/>[api_ibge.py]"]
end

subgraph group_derived["Data preparation"]
  node_population_transform["Population treatment<br/>[api_ibge.py]"]
  node_pib_transform["GDP treatment<br/>[api_ibge.py]"]
  node_per_capita["Per-capita calculation<br/>[api_ibge.py]"]
end

node_user(("Dashboard user"))

node_user -->|"opens dashboard"| node_streamlit_app
node_streamlit_app -->|"loads data"| node_loader
node_loader -->|"reads datasets"| node_local_csv
node_loader -->|"fallback calls"| node_api_client
node_api_client -->|"requests data"| node_ibge_api
node_api_client -->|"looks up municipality"| node_locality_lookup
node_api_client -->|"fetches tables"| node_sidra_fetch
node_sidra_fetch -->|"requests SIDRA"| node_ibge_api
node_locality_lookup -->|"requests locality"| node_ibge_api
node_api_client -->|"treats population"| node_population_transform
node_api_client -->|"treats GDP"| node_pib_transform
node_api_client -->|"derives indicator"| node_per_capita
node_api_client -->|"writes datasets"| node_csv_export
node_csv_export -->|"writes population"| node_local_csv
node_csv_export -->|"writes GDP"| node_pib_csv
node_streamlit_app -->|"collects selections"| node_filters
node_streamlit_app -->|"renders tab"| node_population_view
node_streamlit_app -->|"renders tab"| node_economy_view
node_streamlit_app -->|"renders tab"| node_data_view
node_population_view -->|"renders analysis"| node_charts
node_economy_view -->|"renders analysis"| node_charts
node_data_view -.->|"shows data"| node_local_csv
node_population_view -->|"exports filtered data"| node_downloads
node_economy_view -->|"exports filtered data"| node_downloads

click node_streamlit_app "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_population_view "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_economy_view "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_data_view "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_filters "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_charts "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_downloads "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_loader "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py"
click node_local_csv "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/populacao_jundiai.csv"
click node_pib_csv "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/pib_jundiai.csv"
click node_api_client "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py"
click node_locality_lookup "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py"
click node_sidra_fetch "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py"
click node_population_transform "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py"
click node_pib_transform "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py"
click node_per_capita "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py"
click node_csv_export "https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py"

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_streamlit_app,node_population_view,node_economy_view,node_data_view,node_filters,node_charts,node_downloads,node_loader,node_user toneBlue
class node_local_csv,node_pib_csv,node_ibge_api,node_api_client,node_locality_lookup,node_sidra_fetch,node_csv_export toneAmber
class node_population_transform,node_pib_transform,node_per_capita toneMint
```

## Components

### Dashboard

- [Streamlit app](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`
- [Population analysis](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`
- [Economy analysis](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`
- [Data and methodology](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`
- [Analysis filters](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`
- [Charts and metrics](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`
- [CSV downloads](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`
- [Cached data loader](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/dashboard.py): `dashboard.py`

### Data acquisition

- [Local datasets](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/populacao_jundiai.csv): `populacao_jundiai.csv`
- [GDP dataset](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/pib_jundiai.csv): `pib_jundiai.csv`
- **IBGE services**
- [IBGE API client](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py): `api_ibge.py`
- [Municipality lookup](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py): `api_ibge.py`
- [SIDRA table fetching](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py): `api_ibge.py`
- [Dataset export](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py): `api_ibge.py`

### Data preparation

- [Population treatment](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py): `api_ibge.py`
- [GDP treatment](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py): `api_ibge.py`
- [Per-capita calculation](https://github.com/kauanmonteiro/dashboard-crescimento-jundiai/blob/main/api_ibge.py): `api_ibge.py`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Streamlit app: opens dashboard (evidence: `README.md`)
- Streamlit app → Cached data loader: loads data (evidence: `dashboard.py`)
- Cached data loader → Local datasets: reads datasets (evidence: `dashboard.py`)
- Cached data loader → IBGE API client: fallback calls (evidence: `dashboard.py`)
- IBGE API client → IBGE services: requests data (evidence: `api_ibge.py`)
- IBGE API client → Municipality lookup: looks up municipality (evidence: `api_ibge.py`)
- IBGE API client → SIDRA table fetching: fetches tables (evidence: `api_ibge.py`)
- SIDRA table fetching → IBGE services: requests SIDRA (evidence: `api_ibge.py`)
- Municipality lookup → IBGE services: requests locality (evidence: `api_ibge.py`)
- IBGE API client → Population treatment: treats population (evidence: `api_ibge.py`)
- IBGE API client → GDP treatment: treats GDP (evidence: `api_ibge.py`)
- IBGE API client → Per-capita calculation: derives indicator (evidence: `api_ibge.py`)
- IBGE API client → Dataset export: writes datasets (evidence: `api_ibge.py`)
- Dataset export → Local datasets: writes population (evidence: `api_ibge.py`)
- Dataset export → GDP dataset: writes GDP (evidence: `api_ibge.py`)
- Streamlit app → Analysis filters: collects selections (evidence: `dashboard.py`)
- Streamlit app → Population analysis: renders tab (evidence: `dashboard.py`)
- Streamlit app → Economy analysis: renders tab (evidence: `dashboard.py`)
- Streamlit app → Data and methodology: renders tab (evidence: `dashboard.py`)
- Population analysis → Charts and metrics: renders analysis (evidence: `dashboard.py`)
- Economy analysis → Charts and metrics: renders analysis (evidence: `dashboard.py`)
- Data and methodology → Local datasets: shows data
- Population analysis → CSV downloads: exports filtered data (evidence: `dashboard.py`)
- Economy analysis → CSV downloads: exports filtered data (evidence: `dashboard.py`)
