# vedasm/nasa-space-explorer architecture

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

- Interactive diagram: https://gitdiagram.com/vedasm/nasa-space-explorer
- Repository: https://github.com/vedasm/nasa-space-explorer

## Overview

NASA Space Explorer is a Flask-backed dashboard for APOD, near-Earth asteroids, dated EPIC imagery, and keyword image search. The user loads the dashboard, whose JavaScript requests feature-specific Flask endpoints; Flask delegates data retrieval to the NASA client, which normalizes NASA responses and caches results. The sampled source confirms these route and client interactions. The dashboard also includes interactive media viewing and presentation behavior in the frontend.

Main entry points: [`nasa_api.py`](https://github.com/vedasm/nasa-space-explorer/blob/main/nasa_api.py) (NASA API client), [`app.py`](https://github.com/vedasm/nasa-space-explorer/blob/main/app.py) (Flask routes), [`index.html`](https://github.com/vedasm/nasa-space-explorer/blob/main/index.html) (Dashboard page), [`main.js`](https://github.com/vedasm/nasa-space-explorer/blob/main/main.js) (Dashboard interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard frontend"]
  node_dashboard["Dashboard page<br/>[index.html]"]
  node_browser_logic["Dashboard interactions<br/>[main.js]"]
end

subgraph group_backend["Flask API"]
  node_flask_app["Flask routes<br/>[app.py]"]
end

subgraph group_client["NASA client"]
  node_nasa_client["NASA API client<br/>[nasa_api.py]"]
  node_response_cache[("In-memory cache<br/>[nasa_api.py]")]
end

node_user(("Visitor"))
node_apod{{"APOD service"}}
node_neo{{"Asteroid service"}}
node_epic{{"EPIC service"}}
node_images{{"NASA image archive"}}

node_user -->|"opens"| node_dashboard
node_flask_app -->|"renders"| node_dashboard
node_dashboard -->|"loads"| node_browser_logic
node_browser_logic -->|"requests routes"| node_flask_app
node_flask_app -->|"calls feature getters"| node_nasa_client
node_nasa_client -->|"reads/writes"| node_response_cache
node_nasa_client -->|"fetches APOD"| node_apod
node_nasa_client -->|"fetches asteroids"| node_neo
node_nasa_client -->|"fetches dated images"| node_epic
node_nasa_client -->|"searches catalog"| node_images

click node_dashboard "https://github.com/vedasm/nasa-space-explorer/blob/main/index.html"
click node_browser_logic "https://github.com/vedasm/nasa-space-explorer/blob/main/main.js"
click node_flask_app "https://github.com/vedasm/nasa-space-explorer/blob/main/app.py"
click node_nasa_client "https://github.com/vedasm/nasa-space-explorer/blob/main/nasa_api.py"
click node_response_cache "https://github.com/vedasm/nasa-space-explorer/blob/main/nasa_api.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_dashboard,node_browser_logic toneBlue
class node_flask_app toneAmber
class node_nasa_client,node_response_cache toneMint
class node_user,node_apod,node_neo,node_epic,node_images toneIndigo
```

## Components

### Dashboard frontend

- [Dashboard page](https://github.com/vedasm/nasa-space-explorer/blob/main/index.html): `index.html`
- [Dashboard interactions](https://github.com/vedasm/nasa-space-explorer/blob/main/main.js): `main.js`

### Flask API

- [Flask routes](https://github.com/vedasm/nasa-space-explorer/blob/main/app.py): `app.py`

### NASA client

- [NASA API client](https://github.com/vedasm/nasa-space-explorer/blob/main/nasa_api.py): `nasa_api.py`
- [In-memory cache](https://github.com/vedasm/nasa-space-explorer/blob/main/nasa_api.py): `nasa_api.py`

### Other components

- **Visitor**
- **APOD service**
- **Asteroid service**
- **EPIC service**
- **NASA image archive**

## Connections

- Visitor → Dashboard page: opens
- Flask routes → Dashboard page: renders
- Dashboard page → Dashboard interactions: loads
- Dashboard interactions → Flask routes: requests routes
- Flask routes → NASA API client: calls feature getters
- NASA API client → In-memory cache: reads/writes
- NASA API client → APOD service: fetches APOD
- NASA API client → Asteroid service: fetches asteroids
- NASA API client → EPIC service: fetches dated images
- NASA API client → NASA image archive: searches catalog
