Skip to content

feat: standalone WASM build and demo - #43

Closed
sathishkottravel wants to merge 2 commits into
Navigraph:mainfrom
sathishkottravel:feat/standalone-mode
Closed

sathishkottravel wants to merge 2 commits into
Navigraph:mainfrom
sathishkottravel:feat/standalone-mode

Conversation

@sathishkottravel

Copy link
Copy Markdown

Summary

Adds a standalone build of the WASM module that runs outside the simulator and serves mock navigation data, plus a demo that uses it.

Standalone build

  • Splits the Rust code into a shared core and a platform adapter (msfs or standalone), selected with a Cargo feature.
  • bun run build:wasm:standalone builds the module in Docker (no MSFS SDK needed). It generates mock navigation data from the example database and embeds it. Output: dist/standalone/msfs_navigation_data_interface.wasm.
  • The JS interface now talks to the module through a transport: CommBusTransport in the sim, or StandaloneTransport, which runs the standalone module in browsers and Bun/Node.

example/standalone-demo

  • A script that prints some mock data (bun run demo:standalone).
  • A NestJS HTTP API with Swagger UI at /docs (bun run demo:standalone:serve). It has endpoints for the database, airports (plus runways, procedures, gates and frequencies) and enroute lookups.
  • The business logic is in a service with no NestJS or HTTP code; all controllers are in one file.

Testing

  1. bun run build:wasm:standalone
  2. bun run demo:standalone
  3. bun run demo:standalone:serve, then open http://localhost:3000/docs
  4. cd example/standalone-demo && bun test: 28 tests. The integration tests run against the real module once it's built.

🤖 Generated with Claude Code

sathishkottravel and others added 2 commits September 26, 2026 03:43
Split the Rust code into a shared core and a platform adapter (msfs or
standalone, selected with a Cargo feature). The standalone build runs
outside the sim and serves mock navigation data embedded in the module.

On the TS side, the interface now talks to the module through a
transport: CommBusTransport in the sim, or StandaloneTransport which
loads and drives the standalone module in browsers and Bun/Node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add example/standalone-demo, which runs the standalone WASM module
outside the sim through the JS interface:

- A script printing some mock navigation data (bun run demo:standalone)
- A NestJS HTTP API serving the mock data, with Swagger UI generated from
  the controllers (bun run demo:standalone:serve)

The business logic lives in a framework-free service, and the
controllers only map routes to it. Tests cover the service and the HTTP
layer against an in-memory fake, and the real module when it is built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sathishkottravel
sathishkottravel requested a review from a team as a code owner September 26, 2026 02:26
@sathishkottravel

Copy link
Copy Markdown
Author

Opened here by mistake, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant