# ramjani09/orbitra architecture

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

- Interactive diagram: https://gitdiagram.com/ramjani09/orbitra
- Repository: https://github.com/ramjani09/orbitra

## Overview

Orbitra’s main workflow starts with a user opening the browser app: the frontend loads satellite elements, propagates orbital state, and renders an interactive Earth view with selectable satellites and analytics. The UI also retrieves space-weather and agency-mission data and sends assistant prompts through the backend, with client-side fallbacks for weather and AI responses. The README documents capabilities beyond the sampled implementation; the graph includes those supported by the tree and excerpts, but does not infer unsampled UI wiring.

Main entry points: [`src/main.js`](https://github.com/ramjani09/orbitra/blob/main/src/main.js) (App coordination), [`server/index.js`](https://github.com/ramjani09/orbitra/blob/main/server/index.js) (Express API), [`src/earth.js`](https://github.com/ramjani09/orbitra/blob/main/src/earth.js) (3D Earth view), [`src/services/spaceWeather.js`](https://github.com/ramjani09/orbitra/blob/main/src/services/spaceWeather.js) (Weather service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["App coordination<br/>[main.js]"]
end

subgraph group_orbital["Orbital tracking"]
  node_earth["3D Earth view<br/>[earth.js]"]
  node_engine["Orbital mechanics<br/>[orbitEngine.js]"]
end

subgraph group_data["Intelligence services"]
  node_satdata[("Satellite catalog<br/>[celestrak.js]")]
  node_weather["Weather service<br/>[spaceWeather.js]"]
  node_assistant["AI assistant client<br/>[aiAssistant.js]"]
end

subgraph group_backend["Backend API"]
  node_api["Express API<br/>[index.js]"]
  node_weathercache[("Weather cache<br/>[index.js]")]
  node_missions[("Agency missions<br/>[index.js]")]
  node_airesponse["AI response engine<br/>[index.js]"]
end

node_user(("User"))
node_noaa(("NOAA SWPC"))
node_celestrak(("CelesTrak"))
node_browser(("Browser UI"))

node_user -->|"uses"| node_browser
node_browser -->|"starts"| node_app
node_app -->|"starts view"| node_earth
node_app -->|"loads elements"| node_satdata
node_satdata -->|"fetches TLEs"| node_celestrak
node_app -->|"loads weather"| node_weather
node_weather -->|"requests data"| node_api
node_weather -.->|"fallback fetch"| node_noaa
node_app -->|"sends prompt"| node_assistant
node_assistant -->|"posts prompt"| node_api
node_assistant -->|"returns reply"| node_app
node_app -->|"computes analytics"| node_engine
node_app -->|"sets satellites"| node_earth
node_earth -->|"propagates orbit"| node_engine
node_earth -->|"selects satellite"| node_app
node_api -->|"reads"| node_weathercache
node_api -->|"serves dataset"| node_missions
node_api -->|"dispatches prompt"| node_airesponse

click node_app "https://github.com/ramjani09/orbitra/blob/main/src/main.js"
click node_earth "https://github.com/ramjani09/orbitra/blob/main/src/earth.js"
click node_engine "https://github.com/ramjani09/orbitra/blob/main/src/orbitEngine.js"
click node_satdata "https://github.com/ramjani09/orbitra/blob/main/src/services/celestrak.js"
click node_weather "https://github.com/ramjani09/orbitra/blob/main/src/services/spaceWeather.js"
click node_assistant "https://github.com/ramjani09/orbitra/blob/main/src/services/aiAssistant.js"
click node_api "https://github.com/ramjani09/orbitra/blob/main/server/index.js"
click node_weathercache "https://github.com/ramjani09/orbitra/blob/main/server/index.js"
click node_missions "https://github.com/ramjani09/orbitra/blob/main/server/index.js"
click node_airesponse "https://github.com/ramjani09/orbitra/blob/main/server/index.js"

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_user,node_browser toneBlue
class node_earth,node_engine toneAmber
class node_satdata,node_weather,node_assistant toneMint
class node_api,node_weathercache,node_missions,node_airesponse toneRose
class node_noaa,node_celestrak toneIndigo
```

## Components

### Frontend experience

- [App coordination](https://github.com/ramjani09/orbitra/blob/main/src/main.js): `src/main.js`

### Orbital tracking

- [3D Earth view](https://github.com/ramjani09/orbitra/blob/main/src/earth.js): `src/earth.js`
- [Orbital mechanics](https://github.com/ramjani09/orbitra/blob/main/src/orbitEngine.js): `src/orbitEngine.js`

### Intelligence services

- [Satellite catalog](https://github.com/ramjani09/orbitra/blob/main/src/services/celestrak.js): `src/services/celestrak.js`
- [Weather service](https://github.com/ramjani09/orbitra/blob/main/src/services/spaceWeather.js): `src/services/spaceWeather.js`
- [AI assistant client](https://github.com/ramjani09/orbitra/blob/main/src/services/aiAssistant.js): `src/services/aiAssistant.js`

### Backend API

- [Express API](https://github.com/ramjani09/orbitra/blob/main/server/index.js): `server/index.js`
- [Weather cache](https://github.com/ramjani09/orbitra/blob/main/server/index.js): `server/index.js`
- [Agency missions](https://github.com/ramjani09/orbitra/blob/main/server/index.js): `server/index.js`
- [AI response engine](https://github.com/ramjani09/orbitra/blob/main/server/index.js): `server/index.js`

### Other components

- **User**
- **NOAA SWPC**
- **CelesTrak**
- **Browser UI**

## Connections

- User → Browser UI: uses
- Browser UI → App coordination: starts
- App coordination → 3D Earth view: starts view
- App coordination → Satellite catalog: loads elements
- Satellite catalog → CelesTrak: fetches TLEs
- App coordination → Weather service: loads weather
- Weather service → Express API: requests data
- Weather service → NOAA SWPC: fallback fetch
- App coordination → AI assistant client: sends prompt
- AI assistant client → Express API: posts prompt
- AI assistant client → App coordination: returns reply
- App coordination → Orbital mechanics: computes analytics
- App coordination → 3D Earth view: sets satellites
- 3D Earth view → Orbital mechanics: propagates orbit
- 3D Earth view → App coordination: selects satellite
- Express API → Weather cache: reads
- Express API → Agency missions: serves dataset
- Express API → AI response engine: dispatches prompt
