# mathyslambert33-max/a320-n2 architecture

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

- Interactive diagram: https://gitdiagram.com/mathyslambert33-max/a320-n2
- Repository: https://github.com/mathyslambert33-max/a320-n2

## Overview

This repository implements an interactive A320ceo cockpit simulation: aircraft systems update shared simulation state, which cockpit controls and avionics expose to the user, with procedural audio as a parallel feedback channel. The sampled sources show the simulation bus, application shell, display framework, audio engine, and MCDU/FMGS path. Several avionics and system implementations are indexed but unsampled, so their internal call relationships are not asserted here.

Main entry points: [`src/app.ts`](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/app.ts) (App shell), [`src/core/sim.ts`](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/core/sim.ts) (Simulation bus), [`src/avionics/mcdu/fmgs/fmgs.ts`](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/fmgs/fmgs.ts) (FMGS flight management), [`src/audio/engine.ts`](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/audio/engine.ts) (Procedural audio engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_main["Runtime entry<br/>[main.ts]"]
  node_app["App shell<br/>[app.ts]"]
  node_sim[("Simulation bus<br/>[sim.ts]")]
  node_catalog["Control catalog<br/>[catalog.ts]"]
  node_settings["Player settings<br/>[settings.ts]"]
  node_displays["Display framework<br/>[framework.ts]"]
end

subgraph group_aircraft["Aircraft Systems"]
  node_systems["Aircraft systems"]
end

subgraph group_cockpit["3D Cockpit"]
  node_cockpitkit["Cockpit interaction kit<br/>[index.ts]"]
  node_panels["Panel assemblies<br/>[main.ts]"]
  node_overhead["Overhead panels"]
end

subgraph group_avionics["Avionics"]
  node_ecam["ECAM displays"]
  node_pfdnd["PFD and ND"]
  node_mcduui["MCDU interface<br/>[mcdu.ts]"]
  node_fmgs["FMGS flight management<br/>[fmgs.ts]"]
  node_flightplan["Flight plan model<br/>[flightplan.ts]"]
  node_navdb[("Navigation database<br/>[navdb.ts]")]
end

subgraph group_feedback["Audio"]
  node_audioentry["Audio module<br/>[index.ts]"]
  node_audioengine["Procedural audio engine<br/>[engine.ts]"]
  node_audioeffects["Audio voices and alerts<br/>[engines.ts]"]
end

node_pilot(("Pilot"))

node_pilot -.->|"interacts with"| node_app
node_main -->|"creates"| node_app
node_main -->|"uses"| node_catalog
node_app -->|"uses"| node_sim
node_app -->|"reads"| node_settings
node_app -->|"updates"| node_displays
node_app -->|"initializes"| node_cockpitkit
node_cockpitkit -->|"looks up controls"| node_catalog
node_panels -->|"builds with"| node_cockpitkit
node_systems -.->|"reads and writes"| node_sim
node_ecam -.->|"displays system state"| node_sim
node_pfdnd -.->|"uses flight state"| node_sim
node_mcduui -->|"uses"| node_fmgs
node_fmgs -->|"uses"| node_flightplan
node_fmgs -->|"queries"| node_navdb
node_navdb -->|"implements lookup API"| node_fmgs
node_audioentry -->|"creates"| node_audioengine
node_audioengine -->|"reads state and events"| node_sim
node_audioengine -->|"constructs voices"| node_audioeffects

click node_main "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/main.ts"
click node_app "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/app.ts"
click node_sim "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/core/sim.ts"
click node_catalog "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/core/catalog.ts"
click node_settings "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/core/settings.ts"
click node_displays "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/displays/framework.ts"
click node_systems "https://github.com/mathyslambert33-max/a320-n2/tree/main/src/systems"
click node_cockpitkit "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/cockpit/kit/index.ts"
click node_panels "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/cockpit/mainpanel/main.ts"
click node_overhead "https://github.com/mathyslambert33-max/a320-n2/tree/main/src/cockpit/overhead"
click node_ecam "https://github.com/mathyslambert33-max/a320-n2/tree/main/src/avionics/ecam"
click node_pfdnd "https://github.com/mathyslambert33-max/a320-n2/tree/main/src/avionics/pfdnd"
click node_mcduui "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/mcdu/mcdu.ts"
click node_fmgs "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/fmgs/fmgs.ts"
click node_flightplan "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/fmgs/flightplan.ts"
click node_navdb "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/navdb/navdb.ts"
click node_audioentry "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/audio/index.ts"
click node_audioengine "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/audio/engine.ts"
click node_audioeffects "https://github.com/mathyslambert33-max/a320-n2/blob/main/src/audio/voices/engines.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_app,node_sim,node_catalog,node_settings,node_displays toneBlue
class node_systems toneAmber
class node_cockpitkit,node_panels,node_overhead toneMint
class node_ecam,node_pfdnd,node_mcduui,node_fmgs,node_flightplan,node_navdb toneRose
class node_audioentry,node_audioengine,node_audioeffects,node_pilot toneIndigo
```

## Components

### Runtime

- [Runtime entry](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/main.ts): `src/main.ts`
- [App shell](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/app.ts): `src/app.ts`
- [Simulation bus](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/core/sim.ts): `src/core/sim.ts`
- [Control catalog](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/core/catalog.ts): `src/core/catalog.ts`
- [Player settings](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/core/settings.ts): `src/core/settings.ts`
- [Display framework](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/displays/framework.ts): `src/displays/framework.ts`

### Aircraft Systems

- [Aircraft systems](https://github.com/mathyslambert33-max/a320-n2/tree/main/src/systems): `src/systems`

### 3D Cockpit

- [Cockpit interaction kit](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/cockpit/kit/index.ts): `src/cockpit/kit/index.ts`
- [Panel assemblies](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/cockpit/mainpanel/main.ts): `src/cockpit/mainpanel/main.ts`
- [Overhead panels](https://github.com/mathyslambert33-max/a320-n2/tree/main/src/cockpit/overhead): `src/cockpit/overhead`

### Avionics

- [ECAM displays](https://github.com/mathyslambert33-max/a320-n2/tree/main/src/avionics/ecam): `src/avionics/ecam`
- [PFD and ND](https://github.com/mathyslambert33-max/a320-n2/tree/main/src/avionics/pfdnd): `src/avionics/pfdnd`
- [MCDU interface](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/mcdu/mcdu.ts): `src/avionics/mcdu/mcdu/mcdu.ts`
- [FMGS flight management](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/fmgs/fmgs.ts): `src/avionics/mcdu/fmgs/fmgs.ts`
- [Flight plan model](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/fmgs/flightplan.ts): `src/avionics/mcdu/fmgs/flightplan.ts`
- [Navigation database](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/avionics/mcdu/navdb/navdb.ts): `src/avionics/mcdu/navdb/navdb.ts`

### Audio

- [Audio module](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/audio/index.ts): `src/audio/index.ts`
- [Procedural audio engine](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/audio/engine.ts): `src/audio/engine.ts`
- [Audio voices and alerts](https://github.com/mathyslambert33-max/a320-n2/blob/main/src/audio/voices/engines.ts): `src/audio/voices/engines.ts`

### Other components

- **Pilot**

## Connections

- Pilot → App shell: interacts with
- Runtime entry → App shell: creates (evidence: `src/main.ts`)
- Runtime entry → Control catalog: uses (evidence: `src/main.ts`)
- App shell → Simulation bus: uses (evidence: `src/app.ts`)
- App shell → Player settings: reads (evidence: `src/app.ts`)
- App shell → Display framework: updates (evidence: `src/app.ts`)
- App shell → Cockpit interaction kit: initializes (evidence: `src/app.ts`)
- Cockpit interaction kit → Control catalog: looks up controls (evidence: `src/cockpit/kit/index.ts`)
- Panel assemblies → Cockpit interaction kit: builds with (evidence: `src/cockpit/mainpanel/main.ts`)
- Aircraft systems → Simulation bus: reads and writes (evidence: `src/systems/elec-hyd-fuel-apu/elec.ts`)
- ECAM displays → Simulation bus: displays system state
- PFD and ND → Simulation bus: uses flight state
- MCDU interface → FMGS flight management: uses (evidence: `src/avionics/mcdu/mcdu/mcdu.ts`)
- FMGS flight management → Flight plan model: uses (evidence: `src/avionics/mcdu/fmgs/fmgs.ts`)
- FMGS flight management → Navigation database: queries (evidence: `src/avionics/mcdu/fmgs/fmgs.ts`)
- Navigation database → FMGS flight management: implements lookup API (evidence: `src/avionics/mcdu/navdb/navdb.ts`)
- Audio module → Procedural audio engine: creates (evidence: `src/audio/index.ts`)
- Procedural audio engine → Simulation bus: reads state and events (evidence: `src/audio/engine.ts`)
- Procedural audio engine → Audio voices and alerts: constructs voices (evidence: `src/audio/engine.ts`)
