# Airport Cyber Resilience Simulator — V2 · Offline Windows Build

A fully self-contained Windows executable of the simulator. The Python runtime,
all dependencies, the web frontend, vendored JavaScript libraries, vendored
fonts and the JSON data are packed into a single `.exe`. **No Python, no Docker
and no internet connection are required to run it.**

## Run it

Double-click:

```
dist\AirportCyberSim.exe
```

A console window opens showing the local address, and the kiosk launches in your
default browser (it auto-selects port 8000, or the next free port). Close the
console window to stop the simulator.

> First launch note: single-file builds unpack to a temp folder on start, so the
> very first launch takes ~1–2 seconds. Windows SmartScreen may show an
> "unknown publisher" prompt for an unsigned exe — choose *More info → Run
> anyway*. Code-signing removes this.

## What "offline" means here

Every asset is served locally by the bundled server — verified to contain **zero
external URLs**:

- React, ReactDOM, htm and GSAP are vendored under `src/static/vendor/`.
- Orbitron and Rajdhani fonts are vendored under `src/static/fonts/`
  (SIL Open Font License) and wired up via `src/static/fonts.css` — the previous
  Google Fonts CDN link has been removed.
- All airport / infrastructure / playbook data is bundled JSON.

## Rebuilding the executable

Only needed if you change the source under `src/`.

Requirements (build time only): Python 3.11+, and PyInstaller
(`pip install pyinstaller`).

```powershell
.\build_exe.ps1            # single-file  -> dist\AirportCyberSim.exe
.\build_exe.ps1 -OneDir    # folder build -> dist\AirportCyberSim\  (faster startup)
```

The `-OneDir` variant produces a folder (exe + `_internal` dependencies) instead
of one file. It starts instantly (no unpack step) and is often the better choice
for a fixed exhibition kiosk; copy the whole `dist\AirportCyberSim\` folder to
the target machine.

## Folder layout

```
airport-cyber-sim-v2-exe/
├── build_exe.ps1          # PyInstaller build script
├── README.md
├── dist/
│   └── AirportCyberSim.exe # the self-contained, offline executable
└── src/                    # source that gets bundled
    ├── run.py              # launcher (starts uvicorn + opens the browser)
    ├── main.py             # FastAPI app + simulation engine (frozen-path aware)
    ├── requirements.txt
    ├── data/               # airports.json, infrastructure.json, playbooks.json
    └── static/             # index.html, app.js, styles.css, fonts.css, vendor/, fonts/
```

This is a standalone copy of the V2 application; the original
`airport-cyber-sim-v2/` (Docker/dev version) is unaffected.
