How thealexube/opentower works
OpenTower is a browser-based ATC simulator. The controller chooses a shift or approach scenario, handles pilot calls by text or voice, and issues clearances; the simulation updates aircraft and incidents, while the selected scope and radio UI present the results and a final debrief. The graph separates tower and TRACON simulation, shared airport/radio logic, and browser presentation. Source excerpts show the main wiring and key dependencies; other documented features, including offline PWA behavior, are represented where supported, without assuming unsampled implementation details.
Main entry points: ui.js UI and game loop · main.js Application composition · engine.js Tower simulation · tracon.js TRACON simulation
Components 20
Browser application
- UI and game loop
src/ui.js - Application composition
src/main.js - Shift scenarios
src/scenarios.js - Best-score state
src/scenario-state.js
Simulation modes
- Tower simulation
src/engine.js - TRACON simulation
src/tracon.js
Shared ATC logic
- Airport routes
src/airport.js - Airport and aircraft data
src/config.js - Radio parser and readbacks
src/phraseology.js - Weather and runway choice
src/weather.js
Scopes and radio
- Tower scope renderer
src/render.js - Approach radar renderer
src/tracon-renderer.js - Scope projection and picking
src/scope-renderer.js - English and Spanish UI
src/i18n.js - Pilot speech controls
src/voice.js
Browser services
- NWS weather service
- Browser speech APIs
- Offline PWA cache
sw.js - Browser local storage
Other components
- Air traffic controller
Connections 29
- Air traffic controller → UI and game loop: operates
README.md - Application composition → UI and game loop: creates app
src/main.js - Application composition → Tower simulation: provides engine
src/main.js - Application composition → TRACON simulation: provides engine
src/main.js - Application composition → Tower scope renderer: provides renderer
src/main.js - Application composition → Approach radar renderer: provides renderer
src/main.js - UI and game loop → Shift scenarios: selects scenario
src/ui.js - UI and game loop → Best-score state: keys best score
src/ui.js - UI and game loop → Tower simulation: sends clearances
README.md - UI and game loop → TRACON simulation: sends clearances
README.md - UI and game loop → Tower scope renderer: displays scope
README.md - UI and game loop → Approach radar renderer: displays radar
README.md - UI and game loop → Weather and runway choice: fetches weather
src/ui.js - UI and game loop → Pilot speech controls: configures voice
src/ui.js - UI and game loop → English and Spanish UI: applies language
src/ui.js - UI and game loop → Browser local storage: reads and writes
README.md - Tower simulation → Airport routes: uses routes
src/engine.js - Tower simulation → Radio parser and readbacks: parses instructions
src/engine.js - Tower simulation → Airport and aircraft data: uses airport data
src/engine.js - TRACON simulation → Radio parser and readbacks: matches callsigns
src/tracon.js - TRACON simulation → Airport and aircraft data: uses airport data
src/tracon.js - TRACON simulation → Weather and runway choice: chooses runway
src/tracon.js - Weather and runway choice → NWS weather service: fetches observations
src/weather.js - Tower scope renderer → Scope projection and picking: extends renderer
src/render.js - Tower scope renderer → Airport routes: uses final inset
src/render.js - Tower scope renderer → Airport and aircraft data: draws airport
src/render.js - Approach radar renderer → Scope projection and picking: extends renderer
src/tracon-renderer.js - Pilot speech controls → Browser speech APIs: uses speech APIs
README.md - Offline PWA cache → Browser speech APIs: caches app offline