# ashtynguela/amaze-x architecture

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

- Interactive diagram: https://gitdiagram.com/ashtynguela/amaze-x
- Repository: https://github.com/ashtynguela/amaze-x

## Overview

AMAZE-X is a browser-based lunar landing-site analysis and planning app, with a separate Rocky assistant/overlay. The primary workflow is to choose a lunar site and landing date, load Sun/Earth and terrain data, inspect current and mission-long conditions, then screen landing windows or compare scenarios. The graph includes the documented Solar System and Earth–Moon views, terrain, exports, and assistant capabilities. Some UI and server internals were not sampled; edges are limited to shown imports/calls or README-documented behavior.

Main entry points: [`src/App.tsx`](https://github.com/ashtynguela/amaze-x/blob/main/src/App.tsx) (App shell), [`src/World.tsx`](https://github.com/ashtynguela/amaze-x/blob/main/src/World.tsx) (Lunar views), [`src/store.ts`](https://github.com/ashtynguela/amaze-x/blob/main/src/store.ts) (Session state), [`src/SolarSystem.tsx`](https://github.com/ashtynguela/amaze-x/blob/main/src/SolarSystem.tsx) (Solar System view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_state["Session state<br/>[store.ts]"]
  node_lunarview["Lunar views<br/>[World.tsx]"]
  node_lunar_globe["Globe and terrain<br/>[LunarGlobe.tsx]"]
  node_solar_view["Solar System view<br/>[SolarSystem.tsx]"]
end

subgraph group_analysis["Lunar analysis"]
  node_engine["Sky conditions<br/>[index.mjs]"]
  node_lunar_map["Lunar map data<br/>[lunar-map.mjs]"]
  node_lunar_scene["Lunar scene model<br/>[lunar-scene.mjs]"]
  node_terrain_api["Terrain service<br/>[terrain.mjs]"]
end

subgraph group_planning["Mission planning"]
  node_planner["Landing planner<br/>[LandingPlanner.tsx]"]
  node_history["Mission timing"]
  node_landing_search["Landing windows<br/>[landing-search.mjs]"]
  node_comparison["Scenario comparison<br/>[comparison.mjs]"]
  node_report["Analysis reports<br/>[report.mjs]"]
  node_nearby["Nearby sites<br/>[NearbySites.tsx]"]
end

subgraph group_science["Solar and orientation"]
  node_horizons["Horizons client<br/>[horizons.mjs]"]
  node_solar_api["Solar packets<br/>[solar.mjs]"]
  node_solar_engine["Solar positions<br/>[solar.mjs]"]
  node_orientation["Planet orientation"]
  node_celestial["Lunar celestial state"]
end

subgraph group_services["Data and assistant services"]
  node_rocky["Rocky assistant UI<br/>[Rocky.tsx]"]
  node_assistant["Assistant service<br/>[assistant.mjs]"]
  node_tools["App action tools<br/>[app-tools.mjs]"]
  node_server["HTTP API<br/>[index.mjs]"]
end

node_user(("App user"))
node_nasa(("NASA/JPL data"))

node_user -->|"uses"| node_app
node_app -->|"updates"| node_state
node_app -->|"renders"| node_lunarview
node_app -->|"renders"| node_planner
node_app -->|"renders"| node_nearby
node_app -->|"exports"| node_report
node_app -->|"shows"| node_solar_view
node_lunarview -->|"evaluates"| node_engine
node_lunarview -->|"uses"| node_lunar_scene
node_lunarview -->|"loads"| node_lunar_map
node_lunarview -->|"requests state"| node_celestial
node_lunar_globe -->|"reads"| node_state
node_solar_view -->|"positions bodies"| node_solar_engine
node_solar_view -->|"orients bodies"| node_orientation
node_solar_view -->|"uses"| node_celestial
node_celestial -->|"calculates from"| node_solar_engine
node_celestial -->|"orients Moon"| node_orientation
node_planner -->|"uses timing"| node_history
node_planner -->|"screens arrivals"| node_landing_search
node_planner -->|"reads"| node_state
node_nearby -->|"reads"| node_state
node_server -->|"routes requests"| node_solar_api
node_server -->|"routes requests"| node_terrain_api
node_server -->|"routes requests"| node_assistant
node_solar_api -->|"fetches vectors"| node_horizons
node_solar_api -->|"uses"| node_solar_engine
node_assistant -->|"runs actions"| node_tools
node_assistant -->|"calculates conditions"| node_engine
node_tools -->|"searches arrivals"| node_history
node_tools -->|"compares sites"| node_comparison
node_rocky -->|"requests actions"| node_app
node_state -.->|"fetches API data"| node_server
node_horizons -.->|"requests ephemerides"| node_nasa
node_terrain_api -.->|"reads terrain"| node_nasa

click node_app "https://github.com/ashtynguela/amaze-x/blob/main/src/App.tsx"
click node_state "https://github.com/ashtynguela/amaze-x/blob/main/src/store.ts"
click node_lunarview "https://github.com/ashtynguela/amaze-x/blob/main/src/World.tsx"
click node_lunar_globe "https://github.com/ashtynguela/amaze-x/blob/main/src/LunarGlobe.tsx"
click node_solar_view "https://github.com/ashtynguela/amaze-x/blob/main/src/SolarSystem.tsx"
click node_engine "https://github.com/ashtynguela/amaze-x/blob/main/engine/index.mjs"
click node_lunar_map "https://github.com/ashtynguela/amaze-x/blob/main/engine/lunar-map.mjs"
click node_lunar_scene "https://github.com/ashtynguela/amaze-x/blob/main/engine/lunar-scene.mjs"
click node_terrain_api "https://github.com/ashtynguela/amaze-x/blob/main/server/terrain.mjs"
click node_horizons "https://github.com/ashtynguela/amaze-x/blob/main/server/horizons.mjs"
click node_solar_api "https://github.com/ashtynguela/amaze-x/blob/main/server/solar.mjs"
click node_solar_engine "https://github.com/ashtynguela/amaze-x/blob/main/engine/solar.mjs"
click node_orientation "https://github.com/ashtynguela/amaze-x/blob/main/engine/planetOrientation.mjs"
click node_celestial "https://github.com/ashtynguela/amaze-x/blob/main/engine/celestial-context.mjs"
click node_planner "https://github.com/ashtynguela/amaze-x/blob/main/src/LandingPlanner.tsx"
click node_history "https://github.com/ashtynguela/amaze-x/blob/main/engine/mission-history.mjs"
click node_landing_search "https://github.com/ashtynguela/amaze-x/blob/main/engine/landing-search.mjs"
click node_comparison "https://github.com/ashtynguela/amaze-x/blob/main/engine/comparison.mjs"
click node_report "https://github.com/ashtynguela/amaze-x/blob/main/engine/report.mjs"
click node_nearby "https://github.com/ashtynguela/amaze-x/blob/main/src/NearbySites.tsx"
click node_rocky "https://github.com/ashtynguela/amaze-x/blob/main/src/Rocky.tsx"
click node_assistant "https://github.com/ashtynguela/amaze-x/blob/main/server/assistant.mjs"
click node_tools "https://github.com/ashtynguela/amaze-x/blob/main/server/app-tools.mjs"
click node_server "https://github.com/ashtynguela/amaze-x/blob/main/server/index.mjs"

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_app,node_state,node_lunarview,node_lunar_globe,node_solar_view,node_user toneBlue
class node_engine,node_lunar_map,node_lunar_scene,node_terrain_api toneAmber
class node_planner,node_history,node_landing_search,node_comparison,node_report,node_nearby toneMint
class node_horizons,node_solar_api,node_solar_engine,node_orientation,node_celestial toneRose
class node_rocky,node_assistant,node_tools,node_server,node_nasa toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/ashtynguela/amaze-x/blob/main/src/App.tsx): `src/App.tsx`
- [Session state](https://github.com/ashtynguela/amaze-x/blob/main/src/store.ts): `src/store.ts`
- [Lunar views](https://github.com/ashtynguela/amaze-x/blob/main/src/World.tsx): `src/World.tsx`
- [Globe and terrain](https://github.com/ashtynguela/amaze-x/blob/main/src/LunarGlobe.tsx): `src/LunarGlobe.tsx`
- [Solar System view](https://github.com/ashtynguela/amaze-x/blob/main/src/SolarSystem.tsx): `src/SolarSystem.tsx`

### Lunar analysis

- [Sky conditions](https://github.com/ashtynguela/amaze-x/blob/main/engine/index.mjs): `engine/index.mjs`
- [Lunar map data](https://github.com/ashtynguela/amaze-x/blob/main/engine/lunar-map.mjs): `engine/lunar-map.mjs`
- [Lunar scene model](https://github.com/ashtynguela/amaze-x/blob/main/engine/lunar-scene.mjs): `engine/lunar-scene.mjs`
- [Terrain service](https://github.com/ashtynguela/amaze-x/blob/main/server/terrain.mjs): `server/terrain.mjs`

### Mission planning

- [Landing planner](https://github.com/ashtynguela/amaze-x/blob/main/src/LandingPlanner.tsx): `src/LandingPlanner.tsx`
- [Mission timing](https://github.com/ashtynguela/amaze-x/blob/main/engine/mission-history.mjs): `engine/mission-history.mjs`
- [Landing windows](https://github.com/ashtynguela/amaze-x/blob/main/engine/landing-search.mjs): `engine/landing-search.mjs`
- [Scenario comparison](https://github.com/ashtynguela/amaze-x/blob/main/engine/comparison.mjs): `engine/comparison.mjs`
- [Analysis reports](https://github.com/ashtynguela/amaze-x/blob/main/engine/report.mjs): `engine/report.mjs`
- [Nearby sites](https://github.com/ashtynguela/amaze-x/blob/main/src/NearbySites.tsx): `src/NearbySites.tsx`

### Solar and orientation

- [Horizons client](https://github.com/ashtynguela/amaze-x/blob/main/server/horizons.mjs): `server/horizons.mjs`
- [Solar packets](https://github.com/ashtynguela/amaze-x/blob/main/server/solar.mjs): `server/solar.mjs`
- [Solar positions](https://github.com/ashtynguela/amaze-x/blob/main/engine/solar.mjs): `engine/solar.mjs`
- [Planet orientation](https://github.com/ashtynguela/amaze-x/blob/main/engine/planetOrientation.mjs): `engine/planetOrientation.mjs`
- [Lunar celestial state](https://github.com/ashtynguela/amaze-x/blob/main/engine/celestial-context.mjs): `engine/celestial-context.mjs`

### Data and assistant services

- [Rocky assistant UI](https://github.com/ashtynguela/amaze-x/blob/main/src/Rocky.tsx): `src/Rocky.tsx`
- [Assistant service](https://github.com/ashtynguela/amaze-x/blob/main/server/assistant.mjs): `server/assistant.mjs`
- [App action tools](https://github.com/ashtynguela/amaze-x/blob/main/server/app-tools.mjs): `server/app-tools.mjs`
- [HTTP API](https://github.com/ashtynguela/amaze-x/blob/main/server/index.mjs): `server/index.mjs`

### Other components

- **App user**
- **NASA/JPL data**

## Connections

- App user → App shell: uses (evidence: `README.md`)
- App shell → Session state: updates (evidence: `src/App.tsx`)
- App shell → Lunar views: renders (evidence: `src/App.tsx`)
- App shell → Landing planner: renders (evidence: `src/App.tsx`)
- App shell → Nearby sites: renders (evidence: `src/App.tsx`)
- App shell → Analysis reports: exports (evidence: `src/App.tsx`)
- App shell → Solar System view: shows (evidence: `README.md`)
- Lunar views → Sky conditions: evaluates (evidence: `src/World.tsx`)
- Lunar views → Lunar scene model: uses (evidence: `src/World.tsx`)
- Lunar views → Lunar map data: loads
- Lunar views → Lunar celestial state: requests state
- Globe and terrain → Session state: reads (evidence: `src/LunarGlobe.tsx`)
- Solar System view → Solar positions: positions bodies (evidence: `src/SolarSystem.tsx`)
- Solar System view → Planet orientation: orients bodies (evidence: `src/SolarSystem.tsx`)
- Solar System view → Lunar celestial state: uses (evidence: `src/SolarSystem.tsx`)
- Lunar celestial state → Solar positions: calculates from (evidence: `engine/celestial-context.mjs`)
- Lunar celestial state → Planet orientation: orients Moon (evidence: `engine/celestial-context.mjs`)
- Landing planner → Mission timing: uses timing (evidence: `src/LandingPlanner.tsx`)
- Landing planner → Landing windows: screens arrivals (evidence: `src/LandingPlanner.tsx`)
- Landing planner → Session state: reads (evidence: `src/LandingPlanner.tsx`)
- Nearby sites → Session state: reads (evidence: `src/NearbySites.tsx`)
- HTTP API → Solar packets: routes requests (evidence: `server/index.mjs`)
- HTTP API → Terrain service: routes requests (evidence: `server/index.mjs`)
- HTTP API → Assistant service: routes requests (evidence: `server/index.mjs`)
- Solar packets → Horizons client: fetches vectors (evidence: `server/solar.mjs`)
- Solar packets → Solar positions: uses (evidence: `server/solar.mjs`)
- Assistant service → App action tools: runs actions (evidence: `server/assistant.mjs`)
- Assistant service → Sky conditions: calculates conditions (evidence: `server/assistant.mjs`)
- App action tools → Mission timing: searches arrivals (evidence: `server/app-tools.mjs`)
- App action tools → Scenario comparison: compares sites (evidence: `server/app-tools.mjs`)
- Rocky assistant UI → App shell: requests actions (evidence: `src/Rocky.tsx`)
- Session state → HTTP API: fetches API data
- Horizons client → NASA/JPL data: requests ephemerides
- Terrain service → NASA/JPL data: reads terrain
