# thaneshiyyappan/lunar_learning_portal architecture

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

- Interactive diagram: https://gitdiagram.com/thaneshiyyappan/lunar_learning_portal
- Repository: https://github.com/thaneshiyyappan/lunar_learning_portal

## Overview

Moon Base Alpha is a browser-based lunar-base survival mission trainer with 3D exploration, resource management, hazards, and astronaut learning activities. The main workflow is to launch a mission, survive the timed resource simulation while responding to hazards and operating life-support/agriculture tools, then complete learning modules and earn a certificate. The graph distinguishes mission orchestration, simulation systems, 3D/audio presentation, and learning. Evidence is limited to the supplied excerpts and source index; unsampled implementation details are omitted or left unlinked.

Main entry points: [`src/main.js`](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/main.js) (App coordinator), [`src/game/GameEngine.js`](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/GameEngine.js) (Mission engine), [`src/learning/CapsuleManager.js`](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/learning/CapsuleManager.js) (Capsule navigation), [`src/learning/LearningUI.js`](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/learning/LearningUI.js) (Learning modules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mission app"]
  node_app["App coordinator<br/>[main.js]"]
end

subgraph group_simulation["Mission simulation"]
  node_engine["Mission engine<br/>[GameEngine.js]"]
  node_hud["Mission HUD<br/>[HUD.js]"]
  node_events["Dynamic hazards<br/>[Events.js]"]
  node_defense["Asteroid defense<br/>[AsteroidDefense.js]"]
  node_oxygen["Oxygen monitor<br/>[OxygenMonitor.js]"]
  node_food["Food planting<br/>[FoodPlanting.js]"]
end

subgraph group_presentation["3D and audio"]
  node_scene["Lunar scene<br/>[SceneManager.js]"]
  node_audio["Audio effects<br/>[AudioManager.js]"]
end

subgraph group_learning["Learning and awards"]
  node_capsule["Capsule navigation<br/>[CapsuleManager.js]"]
  node_learningui["Learning modules<br/>[LearningUI.js]"]
  node_lessons["Lesson content<br/>[lessons.json]"]
  node_certificate["Certificate<br/>[Certificate.js]"]
end

node_astronaut(("Astronaut"))

node_astronaut -.->|"starts mission"| node_app
node_app -->|"creates"| node_audio
node_app -->|"creates"| node_scene
node_app -->|"creates"| node_engine
node_app -->|"creates"| node_hud
node_app -->|"creates"| node_events
node_app -->|"creates"| node_defense
node_app -->|"creates"| node_oxygen
node_app -->|"creates"| node_food
node_app -->|"creates"| node_capsule
node_app -.->|"initializes"| node_learningui
node_app -.->|"initializes"| node_certificate
node_app -->|"loads"| node_lessons
node_events -->|"changes mission state"| node_engine
node_events -->|"spawns meteors"| node_scene
node_events -->|"plays alarms"| node_audio
node_defense -->|"fires laser"| node_scene
node_defense -->|"awards XP"| node_engine
node_oxygen -->|"updates oxygen"| node_engine
node_food -->|"updates food"| node_engine
node_capsule -->|"moves camera"| node_scene
node_capsule -->|"opens module"| node_learningui
node_capsule -->|"logs activity"| node_engine
node_capsule -->|"plays cues"| node_audio
node_learningui -->|"awards XP"| node_engine
node_learningui -->|"plays cues"| node_audio
node_learningui -.->|"uses"| node_certificate

click node_app "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/main.js"
click node_engine "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/GameEngine.js"
click node_hud "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/HUD.js"
click node_events "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/Events.js"
click node_defense "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/AsteroidDefense.js"
click node_oxygen "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/OxygenMonitor.js"
click node_food "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/FoodPlanting.js"
click node_scene "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/core/SceneManager.js"
click node_audio "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/core/AudioManager.js"
click node_capsule "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/learning/CapsuleManager.js"
click node_learningui "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/learning/LearningUI.js"
click node_lessons "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/data/lessons.json"
click node_certificate "https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/ui/Certificate.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 toneBlue
class node_engine,node_hud,node_events,node_defense,node_oxygen,node_food toneAmber
class node_scene,node_audio toneMint
class node_capsule,node_learningui,node_lessons,node_certificate toneRose
class node_astronaut toneIndigo
```

## Components

### Mission app

- [App coordinator](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/main.js): `src/main.js`

### Mission simulation

- [Mission engine](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/GameEngine.js): `src/game/GameEngine.js`
- [Mission HUD](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/HUD.js): `src/game/HUD.js`
- [Dynamic hazards](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/Events.js): `src/game/Events.js`
- [Asteroid defense](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/AsteroidDefense.js): `src/game/AsteroidDefense.js`
- [Oxygen monitor](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/OxygenMonitor.js): `src/game/OxygenMonitor.js`
- [Food planting](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/game/FoodPlanting.js): `src/game/FoodPlanting.js`

### 3D and audio

- [Lunar scene](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/core/SceneManager.js): `src/core/SceneManager.js`
- [Audio effects](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/core/AudioManager.js): `src/core/AudioManager.js`

### Learning and awards

- [Capsule navigation](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/learning/CapsuleManager.js): `src/learning/CapsuleManager.js`
- [Learning modules](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/learning/LearningUI.js): `src/learning/LearningUI.js`
- [Lesson content](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/data/lessons.json): `src/data/lessons.json`
- [Certificate](https://github.com/thaneshiyyappan/lunar_learning_portal/blob/main/src/ui/Certificate.js): `src/ui/Certificate.js`

### Other components

- **Astronaut**

## Connections

- Astronaut → App coordinator: starts mission
- App coordinator → Audio effects: creates (evidence: `src/main.js`)
- App coordinator → Lunar scene: creates (evidence: `src/main.js`)
- App coordinator → Mission engine: creates (evidence: `src/main.js`)
- App coordinator → Mission HUD: creates (evidence: `src/main.js`)
- App coordinator → Dynamic hazards: creates (evidence: `src/main.js`)
- App coordinator → Asteroid defense: creates (evidence: `src/main.js`)
- App coordinator → Oxygen monitor: creates (evidence: `src/main.js`)
- App coordinator → Food planting: creates (evidence: `src/main.js`)
- App coordinator → Capsule navigation: creates (evidence: `src/main.js`)
- App coordinator → Learning modules: initializes (evidence: `src/main.js`)
- App coordinator → Certificate: initializes (evidence: `src/main.js`)
- App coordinator → Lesson content: loads (evidence: `src/main.js`)
- Dynamic hazards → Mission engine: changes mission state (evidence: `src/game/Events.js`)
- Dynamic hazards → Lunar scene: spawns meteors (evidence: `src/game/Events.js`)
- Dynamic hazards → Audio effects: plays alarms (evidence: `src/game/Events.js`)
- Asteroid defense → Lunar scene: fires laser (evidence: `src/game/AsteroidDefense.js`)
- Asteroid defense → Mission engine: awards XP (evidence: `src/game/AsteroidDefense.js`)
- Oxygen monitor → Mission engine: updates oxygen (evidence: `src/game/OxygenMonitor.js`)
- Food planting → Mission engine: updates food (evidence: `src/game/FoodPlanting.js`)
- Capsule navigation → Lunar scene: moves camera (evidence: `src/learning/CapsuleManager.js`)
- Capsule navigation → Learning modules: opens module (evidence: `src/learning/CapsuleManager.js`)
- Capsule navigation → Mission engine: logs activity (evidence: `src/learning/CapsuleManager.js`)
- Capsule navigation → Audio effects: plays cues (evidence: `src/learning/CapsuleManager.js`)
- Learning modules → Mission engine: awards XP (evidence: `src/learning/LearningUI.js`)
- Learning modules → Audio effects: plays cues (evidence: `src/learning/LearningUI.js`)
- Learning modules → Certificate: uses
