Deploying an application or a launchpad

An application generated by rapt build (or a launchpad by rapt launchpad) is a standalone folder: Node.js 22, a package.json, a Dockerfile, a Cloud Foundry manifest.yml. It deploys anywhere Node.js or a container runs (D50).

Two modes: the complete launchpad, or one application alone

The workspace has a launchpad (launchpad.json, titled "Launchpad") to which each application is added when it is created (D69). When shipping:

ModeCommandResult
Launchpad (all the applications)rapt launchpad launchpad.json --out out/launchpadthe launchpad and, in apps/<id>, each application built from its sources; docker compose up starts everything (one PostgreSQL per application) behind a single origin and a single sign-in
Application alone (standalone)rapt build my-project --out out/travelthe application without a launchpad: it does not depend on one (the shell bar only shows behind a launchpad)

In VS Code, RAP: Build the application… asks for the mode; RAP: Build the launchpad… builds the launchpad of the workspace directly.

rapt launchpad launchpad.json --out out/launchpad
cd out/launchpad
docker compose up --build          # http://localhost:8090/: the launchpad, the applications under /apps/<id>/

What to set outside localhost

VariableWhy
PUBLIC_URLThe address the users see (https://travel.example.com/): OIDC redirects. Derived from the route on Cloud Foundry.
AUTH_MODE=oidc, OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRETAn identity provider: SAP Cloud Identity Services (IAS), Keycloak, Microsoft Entra ID, Auth0… Never expose AUTH_MODE=none on a network.
SESSION_SECRETA long random value, the same for the launchpad and its applications.
DATABASE_URL (and DATABASE_CA)A PostgreSQL (14 or later) and, if needed, the certificate of its server. Derived from a bound PostgreSQL service on Cloud Foundry.
OIDC_REQUIRED_ROLEOptional: the role without which the application refuses access.

All the variables are in the generated .env.example. Secrets never go into manifest.yml nor into the repository.

Docker (VM, Kubernetes, Azure Container Apps, Google Cloud Run…)

rapt build my-project --out out/travel
cd out/travel
docker build -t travel .
docker run -p 8080:8080 --env-file .env travel

The generated docker-compose.yml starts the application with PostgreSQL (and Keycloak with --profile oidc): useful for a test server.

SAP BTP, Cloud Foundry environment

rapt build my-project --out out/travel && cd out/travel
cf create-service postgresql-db <plan> travel-db       # the name manifest.yml expects
# manifest.yml: fill in OIDC_ISSUER and OIDC_CLIENT_ID (IAS application with OpenID Connect)
cf push --no-start
cf set-env travel SESSION_SECRET "$(openssl rand -hex 32)"
cf set-env travel OIDC_CLIENT_SECRET <secret>
cf start travel

The runtime reads VCAP_APPLICATION (route → PUBLIC_URL) and VCAP_SERVICES (bound PostgreSQL → DATABASE_URL, DATABASE_CA). The Node.js buildpack installs the dependencies (vendor/ contains the runtime of Open RAP Runtime). Health check: /health.

For a launchpad: push each application (folders apps/<id> of rapt launchpad, or rapt build of each one), then give their routes to the launchpad (cf set-env launchpad APP_TRAVEL_URL https://travel.cfapps…); the launchpad and its applications share SESSION_SECRET and the same OIDC client.

A machine of the network

npm install && npm start             # listens on 0.0.0.0:8080 (HOST, PORT)

During development, rapt dev --host 0.0.0.0 also opens the development server to the network (colleagues, phone), still without sign-in: keep it to a trusted network.

HTTPS

The application speaks HTTP; TLS terminates in front of it (Cloud Foundry router, Kubernetes ingress, nginx or Caddy reverse proxy, managed service of the cloud). PUBLIC_URL gives the HTTPS address.

Publishing a version of Open RAP Runtime (maintainers)

The versions are managed by Changesets (D77). The five packages — @open-rap/cli (the rapt command), @open-rap/model, @open-rap/compiler, @open-rap/runtime and the VS Code extension — share one version.

  1. Each pull request that changes what ships (the sources of a package, docs/, the dependencies of a published package) adds a changeset: pnpm changeset, the bump (patch for a fix, minor for a feature, major) and one line for the changelog. A change that must not be released records it with pnpm changeset add --empty. The CI refuses a pull request without one (scripts/require-changeset.mjs).
  2. On main, the Changesets workflow (.github/workflows/changesets.yml) keeps a Version packages pull request open: the next version of the five packages, their CHANGELOG.md, and the version copied into RUNTIME_VERSION and the reference snapshot (pnpm changeset:version).
  3. Merging the Version packages pull request releases: the workflow tags the version vX.Y.Z on the merge commit and runs release.yml on the tag — the VS Code extension (GitHub release with the .vsix and the notes of the changelogs, the Visual Studio Marketplace, Open VSX), the CLI on npm (D65), then the website.

pnpm check:version checks that every file carries the same version (the CI runs it), and release.yml refuses a tag that is not the committed version.

No token: trusted publishing (D78)

The repository stores no token for the registries. release.yml asks GitHub for an identity token of the job (id-token: write); each registry exchanges it for a short-lived credential, provided this repository and the workflow file release.yml are declared as its trusted publisher. To set up once:

Without the variable, the Marketplace or Open VSX step is skipped; the GitHub release and npm are always published. A version already on a registry is skipped (--skip-duplicate, npm view), so a failed release is simply re-run.

The only stored credential is the private key of the GitHub App of the release train (variable RELEASE_APP_ID, secret RELEASE_APP_PRIVATE_KEY, as in LISA): with it, the Version packages pull request is opened by the App and the CI runs on it. Without it, the train still works with the GITHUB_TOKEN, and the CI only runs once the pull request is merged.

By hand, for a release the train did not start: Actions → Release → Run workflow with the committed version (0.2.0), or git tag v0.2.0 && git push origin v0.2.0 on the commit of that version.

To build the .vsix locally:

pnpm install && pnpm build
cd packages/vscode && pnpm run package    # open-rap-runtime-vscode.vsix (~31 MB)

pnpm run package compiles the extension (esbuild), prepares rapt/ (scripts/stage-rapt.mjs: packages of the repository and dependencies installed from the npm registry, useless files removed), then calls vsce package.