# dhruvbaslas/global-data-security-observatory architecture

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

- Interactive diagram: https://gitdiagram.com/dhruvbaslas/global-data-security-observatory
- Repository: https://github.com/dhruvbaslas/global-data-security-observatory

## Overview

The observatory combines a Python pipeline that gathers and scores national policy data with a client-side React application for browsing, comparing, ranking, and adding country frameworks. The graph emphasizes documented orchestration and sampled import relationships; unsampled implementation details are not inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/App.jsx) (Observatory app), [`frontend/src/components/ComparisonView.jsx`](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/ComparisonView.jsx) (Head-to-head comparison), [`scraper/scraper.py`](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/scraper.py) (Statutory scraper), [`frontend/src/components/BestOfBest.jsx`](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/BestOfBest.jsx) (Best-of-best rankings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Data pipeline"]
  node_scraper_main["Scraper entry point<br/>[main.py]"]
  node_scraper_engine["Statutory scraper<br/>[scraper.py]"]
  node_scraper_config["Sources and settings<br/>[config.py]"]
  node_cache[("Scrape cache<br/>[cache.py]")]
  node_sanitizer["Data sanitizer<br/>[sanitizer.py]"]
  node_json_output[("Country dataset<br/>[countries.json]")]
end

subgraph group_scoring["Policy analysis"]
  node_py_analyzer["Policy scoring<br/>[analyzer.py]"]
  node_analysis["Comparison scoring<br/>[analysis.js]"]
end

subgraph group_browse["Country browsing"]
  node_app["Observatory app<br/>[App.jsx]"]
  node_country_data["Country data hook<br/>[useCountryData.js]"]
  node_country_filter["Country filtering<br/>[CountryFilter.jsx]"]
  node_country_card["Country detail cards<br/>[CountryCard.jsx]"]
  node_archetypes["Legal archetypes<br/>[archetypes.js]"]
  node_add_country["Add country<br/>[AddCountry.jsx]"]
  node_sanitize_ui["Input sanitization<br/>[sanitize.js]"]
  node_header["Navigation and notice<br/>[Header.jsx]"]
  node_security_notice["Privacy notice"]
end

subgraph group_compare["Comparison experience"]
  node_comparison["Head-to-head comparison<br/>[ComparisonView.jsx]"]
  node_radar["Radar visualizer<br/>[ParameterRadar.jsx]"]
  node_select["Searchable selector"]
  node_best["Best-of-best rankings<br/>[BestOfBest.jsx]"]
  node_i18n["Seven-language localization<br/>[i18n.js]"]
end

node_researcher(("Researcher"))
node_official_sources[("Official sources")]

node_researcher -->|"uses"| node_app
node_official_sources -->|"provides statutes"| node_scraper_engine
node_scraper_main -->|"runs scraping"| node_scraper_engine
node_scraper_main -->|"scores countries"| node_py_analyzer
node_scraper_main -->|"writes dataset"| node_json_output
node_scraper_engine -->|"uses settings"| node_scraper_config
node_scraper_engine -->|"reads and writes"| node_cache
node_scraper_engine -->|"sanitizes data"| node_sanitizer
node_py_analyzer -->|"uses parameters"| node_scraper_config
node_app -->|"loads countries"| node_country_data
node_country_data -->|"fetches dataset"| node_json_output
node_app -->|"renders filtering"| node_country_filter
node_app -->|"renders country cards"| node_country_card
node_app -->|"renders comparison"| node_comparison
node_app -->|"renders rankings"| node_best
node_app -->|"renders country form"| node_add_country
node_app -->|"filters archetypes"| node_archetypes
node_country_filter -->|"classifies countries"| node_archetypes
node_add_country -->|"sanitizes input"| node_sanitize_ui
node_comparison -->|"calculates comparisons"| node_analysis
node_comparison -->|"evaluates transfer adequacy"| node_archetypes
node_comparison -->|"renders radar chart"| node_radar
node_comparison -->|"selects countries"| node_select
node_best -->|"ranks countries"| node_analysis
node_best -->|"renders radar chart"| node_radar
node_header -->|"renders notice"| node_security_notice
node_comparison -->|"translates interface"| node_i18n
node_best -->|"translates rankings"| node_i18n
node_header -->|"translates navigation"| node_i18n

click node_scraper_main "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/main.py"
click node_scraper_engine "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/scraper.py"
click node_scraper_config "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/config.py"
click node_cache "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/cache.py"
click node_sanitizer "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/sanitizer.py"
click node_json_output "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/public/data/countries.json"
click node_py_analyzer "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/analyzer.py"
click node_app "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/App.jsx"
click node_country_data "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/hooks/useCountryData.js"
click node_country_filter "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/CountryFilter.jsx"
click node_country_card "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/CountryCard.jsx"
click node_archetypes "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/archetypes.js"
click node_add_country "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/AddCountry.jsx"
click node_sanitize_ui "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/sanitize.js"
click node_comparison "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/ComparisonView.jsx"
click node_analysis "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/analysis.js"
click node_radar "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/ParameterRadar.jsx"
click node_select "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/SearchableSelect.jsx"
click node_best "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/BestOfBest.jsx"
click node_i18n "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/i18n.js"
click node_header "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/Header.jsx"
click node_security_notice "https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/DataSecurityNotice.jsx"

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_scraper_main,node_scraper_engine,node_scraper_config,node_cache,node_sanitizer,node_json_output toneBlue
class node_py_analyzer,node_analysis,node_official_sources toneAmber
class node_app,node_country_data,node_country_filter,node_country_card,node_archetypes,node_add_country,node_sanitize_ui,node_header,node_security_notice toneMint
class node_comparison,node_radar,node_select,node_best,node_i18n toneRose
class node_researcher toneIndigo
```

## Components

### Data pipeline

- [Scraper entry point](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/main.py): `scraper/main.py`
- [Statutory scraper](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/scraper.py): `scraper/scraper.py`
- [Sources and settings](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/config.py): `scraper/config.py`
- [Scrape cache](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/cache.py): `scraper/cache.py`
- [Data sanitizer](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/sanitizer.py): `scraper/sanitizer.py`
- [Country dataset](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/public/data/countries.json): `frontend/public/data/countries.json`

### Policy analysis

- [Policy scoring](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/scraper/analyzer.py): `scraper/analyzer.py`
- [Comparison scoring](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/analysis.js): `frontend/src/utils/analysis.js`

### Country browsing

- [Observatory app](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Country data hook](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/hooks/useCountryData.js): `frontend/src/hooks/useCountryData.js`
- [Country filtering](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/CountryFilter.jsx): `frontend/src/components/CountryFilter.jsx`
- [Country detail cards](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/CountryCard.jsx): `frontend/src/components/CountryCard.jsx`
- [Legal archetypes](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/archetypes.js): `frontend/src/utils/archetypes.js`
- [Add country](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/AddCountry.jsx): `frontend/src/components/AddCountry.jsx`
- [Input sanitization](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/sanitize.js): `frontend/src/utils/sanitize.js`
- [Navigation and notice](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/Header.jsx): `frontend/src/components/Header.jsx`
- [Privacy notice](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/DataSecurityNotice.jsx): `frontend/src/components/DataSecurityNotice.jsx`

### Comparison experience

- [Head-to-head comparison](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/ComparisonView.jsx): `frontend/src/components/ComparisonView.jsx`
- [Radar visualizer](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/ParameterRadar.jsx): `frontend/src/components/ParameterRadar.jsx`
- [Searchable selector](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/SearchableSelect.jsx): `frontend/src/components/SearchableSelect.jsx`
- [Best-of-best rankings](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/components/BestOfBest.jsx): `frontend/src/components/BestOfBest.jsx`
- [Seven-language localization](https://github.com/dhruvbaslas/global-data-security-observatory/blob/main/frontend/src/utils/i18n.js): `frontend/src/utils/i18n.js`

### Other components

- **Researcher**
- **Official sources**

## Connections

- Researcher → Observatory app: uses (evidence: `README.md`)
- Official sources → Statutory scraper: provides statutes (evidence: `README.md`)
- Scraper entry point → Statutory scraper: runs scraping (evidence: `scraper/main.py`)
- Scraper entry point → Policy scoring: scores countries (evidence: `scraper/main.py`)
- Scraper entry point → Country dataset: writes dataset (evidence: `README.md`)
- Statutory scraper → Sources and settings: uses settings (evidence: `scraper/scraper.py`)
- Statutory scraper → Scrape cache: reads and writes (evidence: `scraper/scraper.py`)
- Statutory scraper → Data sanitizer: sanitizes data (evidence: `scraper/scraper.py`)
- Policy scoring → Sources and settings: uses parameters (evidence: `scraper/analyzer.py`)
- Observatory app → Country data hook: loads countries (evidence: `frontend/src/App.jsx`)
- Country data hook → Country dataset: fetches dataset (evidence: `frontend/src/hooks/useCountryData.js`)
- Observatory app → Country filtering: renders filtering (evidence: `frontend/src/App.jsx`)
- Observatory app → Country detail cards: renders country cards (evidence: `frontend/src/App.jsx`)
- Observatory app → Head-to-head comparison: renders comparison (evidence: `frontend/src/App.jsx`)
- Observatory app → Best-of-best rankings: renders rankings (evidence: `frontend/src/App.jsx`)
- Observatory app → Add country: renders country form (evidence: `frontend/src/App.jsx`)
- Observatory app → Legal archetypes: filters archetypes (evidence: `frontend/src/App.jsx`)
- Country filtering → Legal archetypes: classifies countries (evidence: `frontend/src/components/CountryFilter.jsx`)
- Add country → Input sanitization: sanitizes input (evidence: `frontend/src/components/AddCountry.jsx`)
- Head-to-head comparison → Comparison scoring: calculates comparisons (evidence: `frontend/src/components/ComparisonView.jsx`)
- Head-to-head comparison → Legal archetypes: evaluates transfer adequacy (evidence: `frontend/src/utils/archetypes.js`)
- Head-to-head comparison → Radar visualizer: renders radar chart (evidence: `frontend/src/components/ComparisonView.jsx`)
- Head-to-head comparison → Searchable selector: selects countries (evidence: `frontend/src/components/ComparisonView.jsx`)
- Best-of-best rankings → Comparison scoring: ranks countries (evidence: `frontend/src/components/BestOfBest.jsx`)
- Best-of-best rankings → Radar visualizer: renders radar chart (evidence: `frontend/src/components/BestOfBest.jsx`)
- Navigation and notice → Privacy notice: renders notice (evidence: `frontend/src/components/Header.jsx`)
- Head-to-head comparison → Seven-language localization: translates interface (evidence: `frontend/src/components/ComparisonView.jsx`)
- Best-of-best rankings → Seven-language localization: translates rankings (evidence: `frontend/src/components/BestOfBest.jsx`)
- Navigation and notice → Seven-language localization: translates navigation (evidence: `frontend/src/components/Header.jsx`)
