# harshithada/nasa-space-data-app architecture

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

- Interactive diagram: https://gitdiagram.com/harshithada/nasa-space-data-app
- Repository: https://github.com/harshithada/nasa-space-data-app

## Overview

This Flask app lets users search NASA’s Near Earth Object feed or DONKI by date, then presents readable results, including hazardous-asteroid indicators and DONKI event details with raw JSON available on demand. The main runtime is concentrated in app.py: its route validates submitted input, selects a fetch path, prepares summaries, and renders the page. The README documents the UI capabilities, but the template and stylesheet were not sampled, so their internal behavior and wiring are not inferred here.

Main entry points: [`app.py`](https://github.com/harshithada/nasa-space-data-app/blob/main/app.py) (Flask search route), [`templates/index.html`](https://github.com/harshithada/nasa-space-data-app/blob/main/templates/index.html) (Search page), [`static/style.css`](https://github.com/harshithada/nasa-space-data-app/blob/main/static/style.css) (Page styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_page["Search page<br/>[index.html]"]
  node_styling["Page styling<br/>[style.css]"]
end

subgraph group_request["Search handling"]
  node_route["Flask search route<br/>[app.py]"]
end

subgraph group_nasa["NASA data"]
  node_neo_fetch["NEO feed fetch<br/>[app.py]"]
  node_donki_fetch["DONKI fetch<br/>[app.py]"]
end

subgraph group_presentation["Result preparation"]
  node_neo_prepare["Asteroid preparation<br/>[app.py]"]
  node_donki_summary["DONKI summaries<br/>[app.py]"]
  node_response["Rendered results<br/>[app.py]"]
end

node_browser(("User browser"))
node_neo_api["NASA NEO API"]
node_donki_api["NASA DONKI API"]

node_browser -->|"opens"| node_page
node_page -->|"submits search"| node_route
node_route -->|"fetches NEO"| node_neo_fetch
node_route -->|"fetches DONKI"| node_donki_fetch
node_neo_fetch -->|"requests feed"| node_neo_api
node_neo_api -->|"returns data"| node_neo_fetch
node_donki_fetch -->|"requests events"| node_donki_api
node_donki_api -->|"returns data"| node_donki_fetch
node_route -->|"prepares asteroids"| node_neo_prepare
node_route -->|"summarizes events"| node_donki_summary
node_route -->|"renders page"| node_response
node_response -->|"returns HTML"| node_page
node_page -.->|"uses styling"| node_styling

click node_page "https://github.com/harshithada/nasa-space-data-app/blob/main/templates/index.html"
click node_styling "https://github.com/harshithada/nasa-space-data-app/blob/main/static/style.css"
click node_route "https://github.com/harshithada/nasa-space-data-app/blob/main/app.py"
click node_neo_fetch "https://github.com/harshithada/nasa-space-data-app/blob/main/app.py"
click node_donki_fetch "https://github.com/harshithada/nasa-space-data-app/blob/main/app.py"
click node_neo_prepare "https://github.com/harshithada/nasa-space-data-app/blob/main/app.py"
click node_donki_summary "https://github.com/harshithada/nasa-space-data-app/blob/main/app.py"
click node_response "https://github.com/harshithada/nasa-space-data-app/blob/main/app.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_page,node_styling,node_browser toneBlue
class node_route toneAmber
class node_neo_fetch,node_donki_fetch,node_neo_api,node_donki_api toneMint
class node_neo_prepare,node_donki_summary,node_response toneRose
```

## Components

### Web interface

- [Search page](https://github.com/harshithada/nasa-space-data-app/blob/main/templates/index.html): `templates/index.html`
- [Page styling](https://github.com/harshithada/nasa-space-data-app/blob/main/static/style.css): `static/style.css`

### Search handling

- [Flask search route](https://github.com/harshithada/nasa-space-data-app/blob/main/app.py): `app.py`

### NASA data

- [NEO feed fetch](https://github.com/harshithada/nasa-space-data-app/blob/main/app.py): `app.py`
- [DONKI fetch](https://github.com/harshithada/nasa-space-data-app/blob/main/app.py): `app.py`

### Result preparation

- [Asteroid preparation](https://github.com/harshithada/nasa-space-data-app/blob/main/app.py): `app.py`
- [DONKI summaries](https://github.com/harshithada/nasa-space-data-app/blob/main/app.py): `app.py`
- [Rendered results](https://github.com/harshithada/nasa-space-data-app/blob/main/app.py): `app.py`

### Other components

- **User browser**
- **NASA NEO API**
- **NASA DONKI API**

## Connections

- User browser → Search page: opens (evidence: `README.md`)
- Search page → Flask search route: submits search (evidence: `README.md`)
- Flask search route → NEO feed fetch: fetches NEO (evidence: `app.py`)
- Flask search route → DONKI fetch: fetches DONKI (evidence: `app.py`)
- NEO feed fetch → NASA NEO API: requests feed (evidence: `app.py`)
- NASA NEO API → NEO feed fetch: returns data (evidence: `app.py`)
- DONKI fetch → NASA DONKI API: requests events (evidence: `app.py`)
- NASA DONKI API → DONKI fetch: returns data (evidence: `app.py`)
- Flask search route → Asteroid preparation: prepares asteroids (evidence: `app.py`)
- Flask search route → DONKI summaries: summarizes events (evidence: `app.py`)
- Flask search route → Rendered results: renders page (evidence: `app.py`)
- Rendered results → Search page: returns HTML (evidence: `app.py`)
- Search page → Page styling: uses styling (evidence: `README.md`)
