# anshikas18/macrolens-economic-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/anshikas18/macrolens-economic-intelligence
- Repository: https://github.com/anshikas18/macrolens-economic-intelligence

## Overview

MacroLens turns World Bank indicators into economic analysis for interactive Power BI dashboards. The documented user workflow is data extraction, transformation, database loading, then dashboard exploration. The sampled pipeline does invoke its extract, transform, and load scripts in sequence, but the shown `src/load.py` writes processed CSVs rather than PostgreSQL records; database loading and dashboard capabilities are therefore represented from the README, not verified in sampled implementation. SQL and dashboard internals were not sampled.

Main entry points: [`src/run_pipeline.py`](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/run_pipeline.py) (Pipeline runner), [`dashboard/MacroLens.pbix`](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/dashboard/MacroLens.pbix) (Power BI dashboard), [`src/load.py`](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/load.py) (CSV processing), [`src/extract.py`](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/extract.py) (Indicator extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data pipeline"]
  node_runner["Pipeline runner<br/>[run_pipeline.py]"]
  node_extract["Indicator extraction<br/>[extract.py]"]
  node_transform["Data transformation<br/>[transform.py]"]
  node_load["CSV processing<br/>[load.py]"]
end

subgraph group_storage["Data storage"]
  node_postgres[("PostgreSQL")]
  node_schema["Relational schema<br/>[create_tables.sql]"]
end

subgraph group_analysis["Economic analytics"]
  node_sqlanalytics["SQL analytics<br/>[analytics.sql]"]
  node_sqlqueries["SQL query set"]
end

subgraph group_presentation["Dashboard experience"]
  node_dashboard["Power BI dashboard<br/>[MacroLens.pbix]"]
  node_executive["Executive overview<br/>[MacroLens.pbix]"]
  node_intelligence["Economic intelligence<br/>[MacroLens.pbix]"]
end

node_analyst(("Analyst"))
node_worldbank{{"World Bank API"}}

node_analyst -->|"starts pipeline"| node_runner
node_runner -->|"executes"| node_extract
node_runner -->|"executes"| node_transform
node_runner -->|"executes"| node_load
node_extract -->|"fetches data"| node_worldbank
node_transform -->|"precedes"| node_load
node_load -.->|"loads observations"| node_postgres
node_schema -->|"defines tables"| node_postgres
node_postgres -.->|"supplies data"| node_sqlanalytics
node_postgres -.->|"queried by"| node_sqlqueries
node_postgres -->|"provides data"| node_dashboard
node_analyst -->|"explores insights"| node_dashboard
node_dashboard -->|"presents"| node_executive
node_dashboard -->|"presents"| node_intelligence

click node_runner "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/run_pipeline.py"
click node_extract "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/extract.py"
click node_transform "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/transform.py"
click node_load "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/load.py"
click node_schema "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/sql/create_tables.sql"
click node_sqlanalytics "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/sql/analytics.sql"
click node_sqlqueries "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/sql/01_basic_queries.sql"
click node_dashboard "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/dashboard/MacroLens.pbix"
click node_executive "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/dashboard/MacroLens.pbix"
click node_intelligence "https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/dashboard/MacroLens.pbix"

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_runner,node_extract,node_transform,node_load toneBlue
class node_postgres,node_schema toneAmber
class node_sqlanalytics,node_sqlqueries,node_worldbank toneMint
class node_dashboard,node_executive,node_intelligence toneRose
class node_analyst toneIndigo
```

## Components

### Data pipeline

- [Pipeline runner](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/run_pipeline.py): `src/run_pipeline.py`
- [Indicator extraction](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/extract.py): `src/extract.py`
- [Data transformation](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/transform.py): `src/transform.py`
- [CSV processing](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/src/load.py): `src/load.py`

### Data storage

- **PostgreSQL**
- [Relational schema](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/sql/create_tables.sql): `sql/create_tables.sql`

### Economic analytics

- [SQL analytics](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/sql/analytics.sql): `sql/analytics.sql`
- [SQL query set](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/sql/01_basic_queries.sql): `sql/01_basic_queries.sql`

### Dashboard experience

- [Power BI dashboard](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/dashboard/MacroLens.pbix): `dashboard/MacroLens.pbix`
- [Executive overview](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/dashboard/MacroLens.pbix): `dashboard/MacroLens.pbix`
- [Economic intelligence](https://github.com/anshikas18/macrolens-economic-intelligence/blob/main/dashboard/MacroLens.pbix): `dashboard/MacroLens.pbix`

### Other components

- **Analyst**
- **World Bank API**

## Connections

- Analyst → Pipeline runner: starts pipeline (evidence: `README.md`)
- Pipeline runner → Indicator extraction: executes (evidence: `src/run_pipeline.py`)
- Pipeline runner → Data transformation: executes (evidence: `src/run_pipeline.py`)
- Pipeline runner → CSV processing: executes (evidence: `src/run_pipeline.py`)
- Indicator extraction → World Bank API: fetches data (evidence: `src/extract.py`)
- Data transformation → CSV processing: precedes
- CSV processing → PostgreSQL: loads observations (evidence: `README.md`)
- Relational schema → PostgreSQL: defines tables (evidence: `README.md`)
- PostgreSQL → SQL analytics: supplies data (evidence: `README.md`)
- PostgreSQL → SQL query set: queried by (evidence: `README.md`)
- PostgreSQL → Power BI dashboard: provides data (evidence: `README.md`)
- Analyst → Power BI dashboard: explores insights (evidence: `README.md`)
- Power BI dashboard → Executive overview: presents (evidence: `README.md`)
- Power BI dashboard → Economic intelligence: presents (evidence: `README.md`)
