# ferdesmello/exoplanets-in-the-galaxy-3d architecture

> Architecture diagram of the GitHub repository ferdesmello/exoplanets-in-the-galaxy-3d, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ferdesmello/exoplanets-in-the-galaxy-3d
- Repository: https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d

## Overview

1. **Overall shape**
   This repository is a data-driven, mostly static visualization project. Its core job is to fetch exoplanet catalog data, transform it into visualization-friendly formats, and publish a browser-based interactive 3D map plus a few derived 2D images.

2. **Primary source of truth**
   The upstream data comes from NASA’s Exoplanet Archive. That external catalog is the authoritative input for exoplanet names, host stars, distances, positions, and discovery methods. The repo does not appear to maintain its own scientific database; it regenerates local outputs from the archive.

3. **Data ingestion subsystem**
   `exoplanet_data.py` is the retrieval/scraping stage. It builds or updates the text datasets under `data/`, especially:
   - `exoplanets_coordinates.txt`
   - `exoplanets_coordinates_l_b.txt`
   - `exoplanets_coordinates_methods.txt`
   
   These files are the normalized intermediate layer for the rest of the project.

4. **Transformation subsystem**
   `data_transformer.py` converts the text outputs into JSON:
   - `exoplanets_coordinates.json`
   - `exoplanets_coordinates_methods.json`
   
   This is the boundary between offline data preparation and the browser-facing visualization. The interactive frontend consumes JSON rather than parsing the raw text tables.

5. **Map-generation subsystem**
   `flat_maps.py` produces 2D rendered maps of the exoplanet distribution using the coordinate data plus galaxy imagery. It generates face-on and edge-on projections, saved in `images/` as rendered JPEGs. This is a separate visualization path from the interactive 3D view.

6. **3D visualization assets**
   The 3D visualization depends on artifacts created outside normal Python scripts:
   - the Mathematica notebook `Exoplanets_in_the_Galaxy_3D.nb`
   - semi-transparent PNG assets such as `MW_transparent.png` and `MW_transparent_small.png`
   
   These files are part of the rendering pipeline for the 3D galaxy model, likely acting as visual backdrops or textures rather than data sources.

7. **Browser application boundary**
   `index.html` is the local and hosted entry point for the interactive experience. It is a static frontend that reads the generated JSON and images from the repository, so the runtime dependency is the browser rather than a backend service.

8. **Publishing and runtime model**
   The project is designed to run as a static site, including local serving via a simple HTTP server and deployment to GitHub Pages. The presence of `index.html` plus generated assets in the repo indicates there is no application server or database layer.

9. **Automated update pipeline**
   `.github/workflows/update.yml` drives periodic regeneration of the datasets and derived files. The README indicates monthly updates based on new Exoplanet Archive discoveries, and `data/last_update.txt` records the last successful refresh time.

10. **Data files as architecture artifacts**
   The `data/` directory is not just storage; it is the persistence layer for the pipeline. It contains both intermediate text files and final JSON outputs, allowing the visualization to be rebuilt without re-querying the archive every time.

11. **Images as derived presentation layer**
   The `images/` directory holds presentation assets: screenshots, rendered galaxy maps, and the main illustration used in the visualizations. These are treated as build outputs or curated inputs depending on the file, and they are essential to the visual composition of the site.

12. **External technologies that materially affect the system**
   The repo’s architecture spans Python for data processing, Mathematica for generating the 3D-related imagery, and plain HTML/JavaScript in the browser for visualization. GitHub Actions and GitHub Pages provide automation and hosting, while the Exoplanet Archive is the external data dependency that defines refresh cadence and content.

13. **End-to-end flow**
   The main flow is: Exoplanet Archive → Python retrieval (`exoplanet_data.py`) → local text datasets in `data/` → JSON conversion (`data_transformer.py`) and image generation (`flat_maps.py` / Mathematica notebook) → static browser visualization in `index.html` → GitHub Pages publication and monthly automation.

14. **What is and is not in the repo**
   This is not a backend service or a live data API. It is a reproducible visualization pipeline with a static frontend and generated assets, where the important architectural boundary is between offline data preparation and client-side rendering.

Main entry points: [`.github/workflows/update.yml`](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/.github/workflows/update.yml) (Update workflow), [`images`](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/tree/main/images) (Rendered images), [`data/exoplanets_coordinates.txt`](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/data/exoplanets_coordinates.txt) (Text data), [`exoplanet_data.py`](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/exoplanet_data.py) (Exoplanet fetcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_pipeline["Data pipeline"]
  node_n_exoplanet_data["Exoplanet fetcher<br/>python ingest<br/>[exoplanet_data.py]"]
  node_n_data_txt["Text data<br/>intermediate data"]
  node_n_data_json["JSON data<br/>browser data"]
  node_n_data_transformer["JSON builder<br/>python transform"]
  node_n_flat_maps["Map renderer<br/>python render<br/>[flat_maps.py]"]
  node_n_nb["3D notebook<br/>mathematica render"]
end

subgraph group_grp_frontend["Browser app"]
  node_n_index["Index page<br/>static frontend<br/>[index.html]"]
  node_n_images["Rendered images<br/>presentation assets"]
  node_n_mw["Milky Way art<br/>visual asset"]
end

subgraph group_grp_ops["Automation"]
  node_n_workflow["Update workflow<br/>github actions<br/>[update.yml]"]
  node_n_server["Serve config<br/>static serve<br/>[server.txt]"]
  node_n_pages(("GitHub Pages<br/>deployment target"))
end

node_n_archive[("Exoplanet Archive<br/>external source")]

node_n_archive -->|"source data"| node_n_exoplanet_data
node_n_exoplanet_data -->|"writes"| node_n_data_txt
node_n_data_txt -->|"input"| node_n_data_transformer
node_n_data_transformer -->|"writes"| node_n_data_json
node_n_data_txt -->|"input"| node_n_flat_maps
node_n_flat_maps -->|"writes"| node_n_images
node_n_nb -->|"creates assets"| node_n_images
node_n_mw -->|"stored in"| node_n_images
node_n_data_json -->|"consumed by"| node_n_index
node_n_images -->|"consumed by"| node_n_index
node_n_workflow -->|"runs"| node_n_exoplanet_data
node_n_workflow -->|"runs"| node_n_data_transformer
node_n_workflow -->|"runs"| node_n_flat_maps
node_n_workflow -->|"deploys"| node_n_pages
node_n_server -->|"serves"| node_n_index

click node_n_exoplanet_data "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/exoplanet_data.py"
click node_n_data_txt "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/data/exoplanets_coordinates.txt"
click node_n_data_json "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/data/exoplanets_coordinates.json"
click node_n_data_transformer "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/data_transformer.py"
click node_n_flat_maps "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/flat_maps.py"
click node_n_nb "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/Exoplanets_in_the_Galaxy_3D.nb"
click node_n_index "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/index.html"
click node_n_images "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/tree/main/images"
click node_n_mw "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/tree/main/images"
click node_n_workflow "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/.github/workflows/update.yml"
click node_n_server "https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/server.txt"

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_n_exoplanet_data,node_n_data_txt,node_n_data_json,node_n_data_transformer,node_n_flat_maps,node_n_nb toneBlue
class node_n_index,node_n_images,node_n_mw toneAmber
class node_n_workflow,node_n_server,node_n_pages toneMint
class node_n_archive toneNeutral
```

## Components

### Data pipeline

Retrieval, normalization, transformation, and rendering stages that build the repo artifacts.

- [Exoplanet fetcher](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/exoplanet_data.py): python ingest · Retrieves and normalizes exoplanet catalog data from the upstream archive into local text datasets. · `exoplanet_data.py`
- [Text data](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/data/exoplanets_coordinates.txt): intermediate data · Normalized coordinate and discovery-method tables used as the pipeline's persistence layer. · `data/exoplanets_coordinates.txt`
- [JSON data](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/data/exoplanets_coordinates.json): browser data · Final JSON datasets consumed by the static frontend. · `data/exoplanets_coordinates.json`
- [JSON builder](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/data_transformer.py): python transform · Converts the text datasets into browser-ready JSON outputs. · `data_transformer.py`
- [Map renderer](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/flat_maps.py): python render · Generates 2D face-on and edge-on galaxy maps from the coordinate data. · `flat_maps.py`
- [3D notebook](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/Exoplanets_in_the_Galaxy_3D.nb): mathematica render · Notebook used to create or support the 3D galaxy visualization assets. · `Exoplanets_in_the_Galaxy_3D.nb`

### Browser app

Static visualization entrypoint and the assets it consumes.

- [Index page](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/index.html): static frontend · Browser entrypoint for the interactive visualization. · `index.html`
- [Rendered images](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/tree/main/images): presentation assets · Generated and curated imagery used by the site, including galaxy backdrops and map renders. · `images`
- [Milky Way art](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/tree/main/images): visual asset · Transparent Milky Way image assets used in the 3D presentation. · `images`

### Automation

Scheduled refresh and hosting for the static site.

- [Update workflow](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/.github/workflows/update.yml): github actions · Scheduled automation that regenerates data and derived outputs. · `.github/workflows/update.yml`
- [Serve config](https://github.com/ferdesmello/exoplanets-in-the-galaxy-3d/blob/main/server.txt): static serve · Local serving helper for hosting the static site. · `server.txt`
- **GitHub Pages**: deployment target · Static hosting destination for the published visualization.

### Other components

- **Exoplanet Archive**: external source · Authoritative upstream catalog for exoplanet and host-star data.

## Connections

- Exoplanet Archive → Exoplanet fetcher: source data · The upstream catalog is queried to obtain the latest exoplanet records.
- Exoplanet fetcher → Text data: writes · Produces normalized text tables in the data directory.
- Text data → JSON builder: input · Text tables are converted into JSON for browser consumption.
- JSON builder → JSON data: writes · Emits the final JSON datasets used by the frontend.
- Text data → Map renderer: input · Map rendering uses the coordinate tables as its data source.
- Map renderer → Rendered images: writes · Produces rendered 2D map images for the site.
- 3D notebook → Rendered images: creates assets · Notebook-generated visual assets contribute to the 3D presentation layer.
- Milky Way art → Rendered images: stored in · Transparent galaxy imagery lives in the image asset directory.
- JSON data → Index page: consumed by · The static page reads the generated JSON data in the browser.
- Rendered images → Index page: consumed by · Rendered imagery is embedded or referenced by the frontend.
- Update workflow → Exoplanet fetcher: runs · Automation periodically refreshes the pipeline from the upstream archive.
- Update workflow → JSON builder: runs · The workflow rebuilds derived JSON artifacts.
- Update workflow → Map renderer: runs · The workflow regenerates rendered map outputs.
- Update workflow → GitHub Pages: deploys · Automation publishes the static site artifacts to GitHub Pages.
- Serve config → Index page: serves · Local hosting is used to open the static frontend in a browser.
