# tbl4z3r/astrodetect architecture

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

- Interactive diagram: https://gitdiagram.com/tbl4z3r/astrodetect
- Repository: https://github.com/tbl4z3r/astrodetect

## Overview

AstroDetect is an educational web app for simulating exoplanet transits and interpreting their light-curve evidence. A user configures a scenario, the app validates it and generates observations, then presents synchronized orbit, transit, and curve views; the user can inspect measurements or run transit detection. Separate learning experiments and a science guide explain the model. The graph follows shown imports, calls, and README descriptions; unsampled UI internals and runtime details are represented only where the source index or excerpts support them.

Main entry points: [`AstroDetect/src/app/App.tsx`](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/app/App.tsx) (Workspace), [`AstroDetect/src/components/Orbit3D.tsx`](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/Orbit3D.tsx) (3D orbit view), [`AstroDetect/src/simulation/simulate.ts`](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/simulate.ts) (Scenario simulation), [`AstroDetect/src/components/ScienceGuide.tsx`](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/ScienceGuide.tsx) (Science guide)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_entry["Web entry<br/>[main.tsx]"]
  node_app["Workspace<br/>[App.tsx]"]
  node_playback["Playback state<br/>[usePlayback.ts]"]
  node_analysis_adapter["Measurement adapter"]
end

subgraph group_science["Simulation and analysis"]
  node_detector["Transit detector<br/>[index.ts]"]
  node_simulation["Scenario simulation<br/>[simulate.ts]"]
  node_validation["Scenario validation<br/>[validation.ts]"]
  node_orbit_math["Orbital geometry<br/>[orbit.ts]"]
  node_geometry["Physical geometry<br/>[geometry.ts]"]
  node_flux["Transit flux<br/>[flux.ts]"]
  node_random["Noise generation<br/>[random.ts]"]
  node_experiment_math["Experiment calculations<br/>[experimentMath.ts]"]
end

subgraph group_views["Visualization and learning"]
  node_scenario_ui["Scenario controls"]
  node_transit_view["Transit animation"]
  node_curve["Light curve<br/>[LightCurve.tsx]"]
  node_measurement["Measurement table"]
  node_playback_ui["Playback controls"]
  node_detection_ui["Detection panel<br/>[DetectionPanel.tsx]"]
  node_orbit_view["3D orbit view<br/>[Orbit3D.tsx]"]
  node_orbit_scene["Orbit scene renderer<br/>[orbitScene.ts]"]
  node_orbit_presentation["Orbit presentation"]
  node_learning["Learning experiments"]
  node_science_guide["Science guide<br/>[ScienceGuide.tsx]"]
  node_help["Help panel<br/>[HelpPanel.tsx]"]
end

subgraph group_shared["Shared model"]
  node_stellar_profiles["Stellar profiles<br/>[stellarProfiles.ts]"]
  node_contracts["Domain contracts<br/>[index.ts]"]
end

node_user(("Learner"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"simulates scenario"| node_simulation
node_app -->|"renders controls"| node_scenario_ui
node_app -->|"renders"| node_transit_view
node_app -->|"renders"| node_curve
node_app -->|"renders"| node_measurement
node_app -->|"renders"| node_orbit_view
node_app -->|"uses playback"| node_playback
node_playback_ui -.->|"controls time"| node_playback
node_app -->|"analyzes measurements"| node_analysis_adapter
node_analysis_adapter -->|"delegates analysis"| node_detector
node_app -->|"renders detector"| node_detection_ui
node_simulation -->|"validates scenario"| node_validation
node_simulation -->|"computes flux"| node_flux
node_simulation -->|"adds noise"| node_random
node_validation -->|"checks separation"| node_geometry
node_orbit_math -->|"validates scenario"| node_validation
node_orbit_math -->|"computes orbit size"| node_geometry
node_orbit_view -->|"gets position"| node_orbit_math
node_orbit_view -->|"computes scale"| node_geometry
node_orbit_view -->|"creates renderer"| node_orbit_scene
node_orbit_view -->|"uses display scale"| node_orbit_presentation
node_orbit_view -->|"gets star color"| node_stellar_profiles
node_science_guide -->|"calculates quantities"| node_experiment_math
node_science_guide -->|"gets star profile"| node_stellar_profiles
node_science_guide -->|"renders help"| node_help
node_learning -->|"uses profiles"| node_stellar_profiles
node_contracts -.->|"defines model inputs"| node_simulation

click node_entry "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/main.tsx"
click node_app "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/app/App.tsx"
click node_playback "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/app/usePlayback.ts"
click node_scenario_ui "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/ScenarioControls.tsx"
click node_transit_view "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/TransitAnimation.tsx"
click node_curve "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/LightCurve.tsx"
click node_measurement "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/MeasurementTable.tsx"
click node_playback_ui "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/PlaybackControls.tsx"
click node_detection_ui "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/DetectionPanel.tsx"
click node_analysis_adapter "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/app/analyzeMeasurements.ts"
click node_detector "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/analysis/index.ts"
click node_simulation "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/simulate.ts"
click node_validation "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/validation.ts"
click node_orbit_math "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/orbit.ts"
click node_geometry "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/geometry.ts"
click node_flux "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/flux.ts"
click node_random "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/random.ts"
click node_orbit_view "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/Orbit3D.tsx"
click node_orbit_scene "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/orbitScene.ts"
click node_orbit_presentation "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/orbitPresentation.ts"
click node_stellar_profiles "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/stellarProfiles.ts"
click node_learning "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/LearningExperiments.tsx"
click node_science_guide "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/ScienceGuide.tsx"
click node_experiment_math "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/experimentMath.ts"
click node_help "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/HelpPanel.tsx"
click node_contracts "https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/contracts/index.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_entry,node_app,node_playback,node_analysis_adapter toneBlue
class node_detector,node_simulation,node_validation,node_orbit_math,node_geometry,node_flux,node_random,node_experiment_math toneAmber
class node_scenario_ui,node_transit_view,node_curve,node_measurement,node_playback_ui,node_detection_ui,node_orbit_view,node_orbit_scene,node_orbit_presentation,node_learning,node_science_guide,node_help toneMint
class node_stellar_profiles,node_contracts toneRose
class node_user toneIndigo
```

## Components

### Application flow

- [Web entry](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/main.tsx): `AstroDetect/src/main.tsx`
- [Workspace](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/app/App.tsx): `AstroDetect/src/app/App.tsx`
- [Playback state](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/app/usePlayback.ts): `AstroDetect/src/app/usePlayback.ts`
- [Measurement adapter](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/app/analyzeMeasurements.ts): `AstroDetect/src/app/analyzeMeasurements.ts`

### Simulation and analysis

- [Transit detector](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/analysis/index.ts): `AstroDetect/src/analysis/index.ts`
- [Scenario simulation](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/simulate.ts): `AstroDetect/src/simulation/simulate.ts`
- [Scenario validation](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/validation.ts): `AstroDetect/src/simulation/validation.ts`
- [Orbital geometry](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/orbit.ts): `AstroDetect/src/simulation/orbit.ts`
- [Physical geometry](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/geometry.ts): `AstroDetect/src/simulation/geometry.ts`
- [Transit flux](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/flux.ts): `AstroDetect/src/simulation/flux.ts`
- [Noise generation](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/simulation/random.ts): `AstroDetect/src/simulation/random.ts`
- [Experiment calculations](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/experimentMath.ts): `AstroDetect/src/components/experimentMath.ts`

### Visualization and learning

- [Scenario controls](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/ScenarioControls.tsx): `AstroDetect/src/components/ScenarioControls.tsx`
- [Transit animation](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/TransitAnimation.tsx): `AstroDetect/src/components/TransitAnimation.tsx`
- [Light curve](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/LightCurve.tsx): `AstroDetect/src/components/LightCurve.tsx`
- [Measurement table](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/MeasurementTable.tsx): `AstroDetect/src/components/MeasurementTable.tsx`
- [Playback controls](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/PlaybackControls.tsx): `AstroDetect/src/components/PlaybackControls.tsx`
- [Detection panel](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/DetectionPanel.tsx): `AstroDetect/src/components/DetectionPanel.tsx`
- [3D orbit view](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/Orbit3D.tsx): `AstroDetect/src/components/Orbit3D.tsx`
- [Orbit scene renderer](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/orbitScene.ts): `AstroDetect/src/components/orbitScene.ts`
- [Orbit presentation](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/orbitPresentation.ts): `AstroDetect/src/components/orbitPresentation.ts`
- [Learning experiments](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/LearningExperiments.tsx): `AstroDetect/src/components/LearningExperiments.tsx`
- [Science guide](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/ScienceGuide.tsx): `AstroDetect/src/components/ScienceGuide.tsx`
- [Help panel](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/HelpPanel.tsx): `AstroDetect/src/components/HelpPanel.tsx`

### Shared model

- [Stellar profiles](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/components/stellarProfiles.ts): `AstroDetect/src/components/stellarProfiles.ts`
- [Domain contracts](https://github.com/tbl4z3r/astrodetect/blob/main/AstroDetect/src/contracts/index.ts): `AstroDetect/src/contracts/index.ts`

### Other components

- **Learner**

## Connections

- Learner → Web entry: opens app (evidence: `README.md`)
- Web entry → Workspace: renders (evidence: `AstroDetect/src/main.tsx`)
- Workspace → Scenario simulation: simulates scenario (evidence: `AstroDetect/src/app/App.tsx`)
- Workspace → Scenario controls: renders controls (evidence: `AstroDetect/src/app/App.tsx`)
- Workspace → Transit animation: renders (evidence: `AstroDetect/src/app/App.tsx`)
- Workspace → Light curve: renders (evidence: `AstroDetect/src/app/App.tsx`)
- Workspace → Measurement table: renders (evidence: `AstroDetect/src/app/App.tsx`)
- Workspace → 3D orbit view: renders (evidence: `AstroDetect/src/app/App.tsx`)
- Workspace → Playback state: uses playback (evidence: `AstroDetect/src/app/App.tsx`)
- Playback controls → Playback state: controls time
- Workspace → Measurement adapter: analyzes measurements (evidence: `AstroDetect/src/app/App.tsx`)
- Measurement adapter → Transit detector: delegates analysis (evidence: `AstroDetect/src/app/analyzeMeasurements.ts`)
- Workspace → Detection panel: renders detector (evidence: `AstroDetect/src/app/App.tsx`)
- Scenario simulation → Scenario validation: validates scenario (evidence: `AstroDetect/src/simulation/simulate.ts`)
- Scenario simulation → Transit flux: computes flux (evidence: `AstroDetect/src/simulation/simulate.ts`)
- Scenario simulation → Noise generation: adds noise (evidence: `AstroDetect/src/simulation/simulate.ts`)
- Scenario validation → Physical geometry: checks separation (evidence: `AstroDetect/src/simulation/validation.ts`)
- Orbital geometry → Scenario validation: validates scenario (evidence: `AstroDetect/src/simulation/orbit.ts`)
- Orbital geometry → Physical geometry: computes orbit size (evidence: `AstroDetect/src/simulation/orbit.ts`)
- 3D orbit view → Orbital geometry: gets position (evidence: `AstroDetect/src/components/Orbit3D.tsx`)
- 3D orbit view → Physical geometry: computes scale (evidence: `AstroDetect/src/components/Orbit3D.tsx`)
- 3D orbit view → Orbit scene renderer: creates renderer (evidence: `AstroDetect/src/components/Orbit3D.tsx`)
- 3D orbit view → Orbit presentation: uses display scale (evidence: `AstroDetect/src/components/Orbit3D.tsx`)
- 3D orbit view → Stellar profiles: gets star color (evidence: `AstroDetect/src/components/Orbit3D.tsx`)
- Science guide → Experiment calculations: calculates quantities (evidence: `AstroDetect/src/components/ScienceGuide.tsx`)
- Science guide → Stellar profiles: gets star profile (evidence: `AstroDetect/src/components/ScienceGuide.tsx`)
- Science guide → Help panel: renders help (evidence: `AstroDetect/src/components/ScienceGuide.tsx`)
- Learning experiments → Stellar profiles: uses profiles (evidence: `AstroDetect/src/components/LearningExperiments.tsx`)
- Domain contracts → Scenario simulation: defines model inputs (evidence: `AstroDetect/src/simulation/simulate.ts`)
