Skip to content

Repository files navigation

infinity-website

The Infinity Simulations website — a Leptos CSR single-page app compiled to WebAssembly and served from Cloudflare Pages.

Prerequisites

  • Rust 1.96+ with the wasm target: rustup target add wasm32-unknown-unknown
  • Trunk 0.21+: cargo install --locked trunk
  • kivro — supplies build-time config (see below)
  • Node — only for deploying (npx wrangler)

Trunk downloads its own tailwindcss and wasm-opt on first run; nothing else to install.

Sibling checkout

The component library is a path dependency, so it has to sit next to this repo:

github/
├── infinity-website/     # this repo
└── infinity-ui-wasm/     # https://github.com/infinity-MSFS/infinity-ui

Cargo.toml, tailwind.config.js, and input.css all reference ../infinity-ui-wasm. Without it, nothing builds.

Configuration

Endpoints and Auth0 client config are read from the environment at compile time and baked into the wasm. They're declared in .kivro.toml and stored with kivro:

Variable Purpose
CDN_WORKER_URL CDN worker; falls back to the public production URL
SUPPORT_API_URL Support ticket backend
AUTH0_DOMAIN Auth0 tenant
AUTH0_CLIENT_ID Auth0 SPA client
AUTH0_AUDIENCE Auth0 API audience

None of these are secrets — a browser can read every one out of the shipped bundle. They live in kivro so the values stay out of git and so each environment can point at its own backends.

Set them once:

kivro set AUTH0_DOMAIN        # repeat for each variable above
kivro status                  # confirms nothing is missing

Then prefix any build with kivro run --, which injects them for the duration of that command. Missing variables don't fail the build — you get a cargo:warning and a bundle that runs signed out with dead endpoints.

Closed beta

/beta runs the closed beta in two stages, both on the same route because a tester is told to come back to it after a decision:

  1. Apply — a DC-10 systems questionnaire, a few written questions, then contact details and a case for why we should pick them. The multiple choice is graded by the CDN worker, so the answer key is never in this bundle and the recorded score is one the worker computed rather than one the browser asserted. A low score is recorded, not a blocker. The written answers are never scored — they are what a reviewer actually reads.
  2. Sign — once accepted, the NDA and beta test agreement appear as cards linking to /beta/sign/:doc, which renders the document, gates signing on actually scrolling to the end, and collects the signer's legal name, address and contact details alongside a drawn or typed signature. Those details are what make the agreement enforceable against a person rather than a handle, and they are prefilled on the second document from the first.
  3. Approved — signing is not the finish line. Both documents go back to staff for a final check, and only that approval assigns the Auth0 beta role and releases the build. accepted unlocks paperwork; approved is a tester.

/beta/admin is the review queue, gated on the developer claim: the pending applications, each wrong answer next to the right one, the written answers, the signatures on file, and the accept → approve → reject controls. Signed paperwork exports as a PDF — the NDA, the contract, or both — generated by the worker and handed to the browser as a download. It also has a destructive Remove application, which deletes the record, the signatures and the role so an account is back to square one and can apply again; applying is one-shot per account, so this is how you walk the flow twice on your own login. The gate here is UX; the worker checks the same claim on every call.

Which stage someone sees comes from GET /v1/beta/dc10/status; the stepper is presentation only. Everything behind it — question bank, document text, applications, signatures, accept/reject — lives in infinity-cdn-worker, whose README covers the endpoints and how to edit the content without a deploy.

Develop

kivro run -- trunk serve

Serves on http://localhost:3035 with hot reload, watching this crate and the sibling infinity-ui sources.

Build

kivro run -- trunk build --release

Output lands in dist/. Always use --release: the debug wasm is ~22 MB, versus a few MB optimized, and Cloudflare rejects files over 25 MiB.

Deploy

./scripts/deploy.ps1                    # production
./scripts/deploy.ps1 -Branch my-feature # preview deployment
./scripts/deploy.ps1 -Env prod          # build against a different kivro env

The script checks config, builds a release bundle, verifies the artifacts, and Direct Uploads dist/ to Cloudflare Pages via wrangler. We build locally rather than on Cloudflare because their build image ships no Rust toolchain and a cold release build overruns their time budget.

public/_redirects rewrites every path to index.html so the client-side router handles deep links; public/_headers pins the content-hashed assets and keeps the shell uncached. Both are copied into dist/ by Trunk — the deploy script refuses to upload without them.

When adding a new domain, add it to the Auth0 application's Allowed Callback URLs, Allowed Logout URLs, and Allowed Web Origins, or sign-in breaks on that host.

License

MIT — see LICENSE. The bundled auth0-spa-js build in public/vendor/ is MIT licensed by Auth0; its notice is alongside it.

About

Infinity Simulations website

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages