# kraso/sunsystem architecture

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

- Interactive diagram: https://gitdiagram.com/kraso/sunsystem
- Repository: https://github.com/kraso/sunsystem

## Overview

SunSystem is a multi-section astronomy application; its primary workflow is an interactive 3D Solar System simulation, alongside dedicated pages for lunar phases, statistics, the planetarium, constellation charts, missions, and other astronomical topics. The graph follows documented page entry points and source-indexed module dependencies. Some page implementations and runtime wiring were not sampled, so those relationships are documented at the README level rather than inferred from unsampled code.

Main entry points: [`src/main.ts`](https://github.com/kraso/sunsystem/blob/master/src/main.ts) (Simulation Bootstrap), [`src/scene/solar-system.ts`](https://github.com/kraso/sunsystem/blob/master/src/scene/solar-system.ts) (Solar System Scene), [`src/planetario-app.ts`](https://github.com/kraso/sunsystem/blob/master/src/planetario-app.ts) (Planetarium), [`src/ui/moon-panel.ts`](https://github.com/kraso/sunsystem/blob/master/src/ui/moon-panel.ts) (Moon Calendar And Gallery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Solar Simulation"]
  node_main["Simulation Bootstrap<br/>[main.ts]"]
  node_solar["Solar System Scene<br/>[solar-system.ts]"]
  node_body["Celestial Bodies<br/>[celestial-body.ts]"]
  node_raycaster["Body Selection<br/>[raycaster.ts]"]
end

subgraph group_engine["Simulation Engine"]
  node_orbit["Orbital Mechanics<br/>[orbit.ts]"]
  node_kepler["Kepler Solver<br/>[kepler.ts]"]
  node_time["Simulation Time<br/>[time-manager.ts]"]
end

subgraph group_presentation["Rendering And UI"]
  node_renderer["WebGL Renderer<br/>[renderer.ts]"]
  node_materials["Body Materials<br/>[materials.ts]"]
  node_texturegen["Procedural Textures<br/>[tex-terrestrial.ts]"]
  node_camera["Orbital Camera<br/>[orbital-camera.ts]"]
  node_timeui["Time Controls<br/>[time-controls.ts]"]
  node_labels["Body Labels<br/>[labels.ts]"]
  node_info["Body Info Panel<br/>[info-panel.ts]"]
end

subgraph group_sky["Sky And Moon"]
  node_moonapp["Moon Section<br/>[luna-app.ts]"]
  node_moonpanel["Moon Calendar And Gallery<br/>[moon-panel.ts]"]
  node_lunarphase["Lunar Calculations<br/>[lunar-phase.ts]"]
  node_moonviewer["Moon Viewer<br/>[moon-viewer.ts]"]
  node_planetarium["Planetarium<br/>[planetario-app.ts]"]
  node_skyview["Sky Dome Scene<br/>[planetarium.ts]"]
  node_observer["Observer Camera<br/>[observer-camera.ts]"]
end

subgraph group_sections["Astronomy Sections"]
  node_constellations["Constellation Charts"]
  node_missions["Mission History<br/>[misiones-app.ts]"]
  node_statistics["Body Statistics"]
  node_catastrophes["Stellar Catastrophes<br/>[phenomena-app.ts]"]
  node_minor["Minor Bodies"]
end

node_visitor(("Visitor"))
node_nasa["NASA Image Search"]

node_visitor -->|"opens simulation"| node_main
node_main -->|"creates scene"| node_solar
node_main -->|"creates renderer"| node_renderer
node_main -->|"creates camera"| node_camera
node_main -->|"creates picker"| node_raycaster
node_main -->|"creates clock"| node_time
node_main -->|"creates controls"| node_timeui
node_main -->|"creates labels"| node_labels
node_main -->|"creates panel"| node_info
node_solar -->|"constructs bodies"| node_body
node_solar -->|"calculates positions"| node_orbit
node_solar -->|"reads simulated time"| node_time
node_orbit -->|"uses solver"| node_kepler
node_body -->|"loads materials"| node_materials
node_body -->|"selects textures"| node_texturegen
node_visitor -->|"opens moon page"| node_moonapp
node_moonpanel -->|"calculates phases"| node_lunarphase
node_moonpanel -->|"creates viewer"| node_moonviewer
node_moonpanel -->|"searches images"| node_nasa
node_visitor -->|"opens planetarium"| node_planetarium
node_planetarium -->|"creates sky scene"| node_skyview
node_planetarium -->|"creates renderer"| node_renderer
node_planetarium -->|"creates camera"| node_observer
node_visitor -->|"opens charts"| node_constellations
node_visitor -->|"opens mission history"| node_missions
node_visitor -->|"opens statistics"| node_statistics
node_visitor -->|"opens section"| node_catastrophes
node_visitor -->|"opens section"| node_minor

click node_main "https://github.com/kraso/sunsystem/blob/master/src/main.ts"
click node_solar "https://github.com/kraso/sunsystem/blob/master/src/scene/solar-system.ts"
click node_body "https://github.com/kraso/sunsystem/blob/master/src/scene/celestial-body.ts"
click node_raycaster "https://github.com/kraso/sunsystem/blob/master/src/input/raycaster.ts"
click node_orbit "https://github.com/kraso/sunsystem/blob/master/src/core/orbit.ts"
click node_kepler "https://github.com/kraso/sunsystem/blob/master/src/core/kepler.ts"
click node_time "https://github.com/kraso/sunsystem/blob/master/src/core/time-manager.ts"
click node_renderer "https://github.com/kraso/sunsystem/blob/master/src/rendering/renderer.ts"
click node_materials "https://github.com/kraso/sunsystem/blob/master/src/rendering/materials.ts"
click node_texturegen "https://github.com/kraso/sunsystem/blob/master/src/rendering/tex-terrestrial.ts"
click node_camera "https://github.com/kraso/sunsystem/blob/master/src/camera/orbital-camera.ts"
click node_timeui "https://github.com/kraso/sunsystem/blob/master/src/ui/time-controls.ts"
click node_labels "https://github.com/kraso/sunsystem/blob/master/src/ui/labels.ts"
click node_info "https://github.com/kraso/sunsystem/blob/master/src/ui/info-panel.ts"
click node_moonapp "https://github.com/kraso/sunsystem/blob/master/src/luna-app.ts"
click node_moonpanel "https://github.com/kraso/sunsystem/blob/master/src/ui/moon-panel.ts"
click node_lunarphase "https://github.com/kraso/sunsystem/blob/master/src/core/lunar-phase.ts"
click node_moonviewer "https://github.com/kraso/sunsystem/blob/master/src/ui/moon-viewer.ts"
click node_planetarium "https://github.com/kraso/sunsystem/blob/master/src/planetario-app.ts"
click node_skyview "https://github.com/kraso/sunsystem/blob/master/src/scene/planetarium.ts"
click node_observer "https://github.com/kraso/sunsystem/blob/master/src/camera/observer-camera.ts"
click node_constellations "https://github.com/kraso/sunsystem/blob/master/src/constelaciones-app.ts"
click node_missions "https://github.com/kraso/sunsystem/blob/master/src/misiones-app.ts"
click node_statistics "https://github.com/kraso/sunsystem/blob/master/src/estadisticas-app.ts"
click node_catastrophes "https://github.com/kraso/sunsystem/blob/master/src/phenomena-app.ts"
click node_minor "https://github.com/kraso/sunsystem/blob/master/src/cuerpos-menores-app.ts"

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_main,node_solar,node_body,node_raycaster toneBlue
class node_orbit,node_kepler,node_time toneAmber
class node_renderer,node_materials,node_texturegen,node_camera,node_timeui,node_labels,node_info toneMint
class node_moonapp,node_moonpanel,node_lunarphase,node_moonviewer,node_planetarium,node_skyview,node_observer toneRose
class node_constellations,node_missions,node_statistics,node_catastrophes,node_minor,node_visitor,node_nasa toneIndigo
```

## Components

### Solar Simulation

- [Simulation Bootstrap](https://github.com/kraso/sunsystem/blob/master/src/main.ts): `src/main.ts`
- [Solar System Scene](https://github.com/kraso/sunsystem/blob/master/src/scene/solar-system.ts): `src/scene/solar-system.ts`
- [Celestial Bodies](https://github.com/kraso/sunsystem/blob/master/src/scene/celestial-body.ts): `src/scene/celestial-body.ts`
- [Body Selection](https://github.com/kraso/sunsystem/blob/master/src/input/raycaster.ts): `src/input/raycaster.ts`

### Simulation Engine

- [Orbital Mechanics](https://github.com/kraso/sunsystem/blob/master/src/core/orbit.ts): `src/core/orbit.ts`
- [Kepler Solver](https://github.com/kraso/sunsystem/blob/master/src/core/kepler.ts): `src/core/kepler.ts`
- [Simulation Time](https://github.com/kraso/sunsystem/blob/master/src/core/time-manager.ts): `src/core/time-manager.ts`

### Rendering And UI

- [WebGL Renderer](https://github.com/kraso/sunsystem/blob/master/src/rendering/renderer.ts): `src/rendering/renderer.ts`
- [Body Materials](https://github.com/kraso/sunsystem/blob/master/src/rendering/materials.ts): `src/rendering/materials.ts`
- [Procedural Textures](https://github.com/kraso/sunsystem/blob/master/src/rendering/tex-terrestrial.ts): `src/rendering/tex-terrestrial.ts`
- [Orbital Camera](https://github.com/kraso/sunsystem/blob/master/src/camera/orbital-camera.ts): `src/camera/orbital-camera.ts`
- [Time Controls](https://github.com/kraso/sunsystem/blob/master/src/ui/time-controls.ts): `src/ui/time-controls.ts`
- [Body Labels](https://github.com/kraso/sunsystem/blob/master/src/ui/labels.ts): `src/ui/labels.ts`
- [Body Info Panel](https://github.com/kraso/sunsystem/blob/master/src/ui/info-panel.ts): `src/ui/info-panel.ts`

### Sky And Moon

- [Moon Section](https://github.com/kraso/sunsystem/blob/master/src/luna-app.ts): `src/luna-app.ts`
- [Moon Calendar And Gallery](https://github.com/kraso/sunsystem/blob/master/src/ui/moon-panel.ts): `src/ui/moon-panel.ts`
- [Lunar Calculations](https://github.com/kraso/sunsystem/blob/master/src/core/lunar-phase.ts): `src/core/lunar-phase.ts`
- [Moon Viewer](https://github.com/kraso/sunsystem/blob/master/src/ui/moon-viewer.ts): `src/ui/moon-viewer.ts`
- [Planetarium](https://github.com/kraso/sunsystem/blob/master/src/planetario-app.ts): `src/planetario-app.ts`
- [Sky Dome Scene](https://github.com/kraso/sunsystem/blob/master/src/scene/planetarium.ts): `src/scene/planetarium.ts`
- [Observer Camera](https://github.com/kraso/sunsystem/blob/master/src/camera/observer-camera.ts): `src/camera/observer-camera.ts`

### Astronomy Sections

- [Constellation Charts](https://github.com/kraso/sunsystem/blob/master/src/constelaciones-app.ts): `src/constelaciones-app.ts`
- [Mission History](https://github.com/kraso/sunsystem/blob/master/src/misiones-app.ts): `src/misiones-app.ts`
- [Body Statistics](https://github.com/kraso/sunsystem/blob/master/src/estadisticas-app.ts): `src/estadisticas-app.ts`
- [Stellar Catastrophes](https://github.com/kraso/sunsystem/blob/master/src/phenomena-app.ts): `src/phenomena-app.ts`
- [Minor Bodies](https://github.com/kraso/sunsystem/blob/master/src/cuerpos-menores-app.ts): `src/cuerpos-menores-app.ts`

### Other components

- **Visitor**
- **NASA Image Search**

## Connections

- Visitor → Simulation Bootstrap: opens simulation (evidence: `README.md`)
- Simulation Bootstrap → Solar System Scene: creates scene (evidence: `src/main.ts`)
- Simulation Bootstrap → WebGL Renderer: creates renderer (evidence: `src/main.ts`)
- Simulation Bootstrap → Orbital Camera: creates camera (evidence: `src/main.ts`)
- Simulation Bootstrap → Body Selection: creates picker (evidence: `src/main.ts`)
- Simulation Bootstrap → Simulation Time: creates clock (evidence: `src/main.ts`)
- Simulation Bootstrap → Time Controls: creates controls (evidence: `src/main.ts`)
- Simulation Bootstrap → Body Labels: creates labels (evidence: `src/main.ts`)
- Simulation Bootstrap → Body Info Panel: creates panel (evidence: `src/main.ts`)
- Solar System Scene → Celestial Bodies: constructs bodies (evidence: `src/scene/solar-system.ts`)
- Solar System Scene → Orbital Mechanics: calculates positions (evidence: `src/scene/solar-system.ts`)
- Solar System Scene → Simulation Time: reads simulated time (evidence: `src/scene/solar-system.ts`)
- Orbital Mechanics → Kepler Solver: uses solver (evidence: `src/core/orbit.ts`)
- Celestial Bodies → Body Materials: loads materials (evidence: `src/scene/celestial-body.ts`)
- Celestial Bodies → Procedural Textures: selects textures (evidence: `src/scene/celestial-body.ts`)
- Visitor → Moon Section: opens moon page (evidence: `README.md`)
- Moon Calendar And Gallery → Lunar Calculations: calculates phases (evidence: `src/ui/moon-panel.ts`)
- Moon Calendar And Gallery → Moon Viewer: creates viewer (evidence: `src/ui/moon-panel.ts`)
- Moon Calendar And Gallery → NASA Image Search: searches images (evidence: `src/ui/moon-panel.ts`)
- Visitor → Planetarium: opens planetarium (evidence: `README.md`)
- Planetarium → Sky Dome Scene: creates sky scene (evidence: `src/planetario-app.ts`)
- Planetarium → WebGL Renderer: creates renderer (evidence: `src/planetario-app.ts`)
- Planetarium → Observer Camera: creates camera (evidence: `src/planetario-app.ts`)
- Visitor → Constellation Charts: opens charts (evidence: `README.md`)
- Visitor → Mission History: opens mission history (evidence: `README.md`)
- Visitor → Body Statistics: opens statistics (evidence: `README.md`)
- Visitor → Stellar Catastrophes: opens section (evidence: `README.md`)
- Visitor → Minor Bodies: opens section (evidence: `README.md`)
