Skip to main content

Web Application — Container

This C3 Component view opens the Web Application container and shows the browser-owned session, pre-flight, world initialization, flight, recovery, and outcome paths.

loading...

Components​

ComponentResponsibility
Nginx static serverReceives HTTP from Kubernetes Ingress and serves the Vite SPA, SPA fallback, and health endpoint
Keycloak session clientRuns OIDC/OAuth 2.0 Authorization Code with PKCE, refreshes tokens, protects application routes, and restores the intended route
Pre-flight and launch configuratorConsumes bundled governed aircraft, world, and condition catalogues; selects controls and camera; binds every snapshot to the application revision; validates and summarizes the complete launch configuration
Flight deck and world bootstrapOwns flight-attempt identity, launch, pause, resume, end, retry, and restart; initializes the selected world, terrain asset, physics profile, environment snapshot, and failure boundary before the render loop starts
Input and runtime-binding controllerMaps keyboard, mouse, and gamepad input into bounded typed control state and rejects controls that are not part of the active binding contract
Authoritative deterministic flight runtimeAdvances Rapier dynamics at a fixed 60 Hz step, applies class-specific production physics, wind, collisions, world-boundary policy, and recovery decisions, and emits the authoritative flight frame
R3F world and aircraft compositorLoads governed aircraft and terrain assets, applies the world-space contract, composes airfield or water infrastructure, maintains production camera rigs, and renders the selected world
Flight-state and recovery presenterProjects authoritative frames into instruments, telemetry, environment state, control response, boundary warnings, and recovery guidance without becoming a second physics authority
Attempt and outcome coordinatorPreserves the active attempt through completion, failure, and abort; applies governed retry semantics; and creates a new provenance-linked attempt for deliberate restart
Pilot data API clientLoads pilot profile, preferences, progress, and outcomes over HTTPS/JSON
Persistence API clientPersists the selected preferences together with progress and outcomes over HTTPS/JSON

Pre-flight flow​

  1. The Keycloak session client establishes the pilot identity.
  2. The API client loads profile and preferences; the configurator reads the revision-bound governed catalogues compiled into the Web Application.
  3. The pilot selects aircraft, world, conditions, controls, and camera.
  4. The configurator binds each selected snapshot to the active source revision, validates the complete selection, and presents one review summary.
  5. The flight deck creates an attempt identity and reserves world initialization for the exact world, terrain, physics, catalogue, and source-revision tuple.

Flight flow​

  1. World bootstrap loads and validates the governed terrain asset and physics profile before exposing a ready session world.
  2. The input controller publishes bounded typed control state from the active runtime-binding contract.
  3. The authoritative runtime advances aircraft forces, wind, collision, and recovery state at a fixed 60 Hz step.
  4. The R3F compositor aligns governed terrain and aircraft assets to the world-space contract, updates production cameras, and renders the authoritative pose.
  5. The presenter projects the authoritative frame into instruments, warnings, environment state, and recovery guidance.
  6. The outcome coordinator preserves the attempt identity through completion, failure, and abort; applies the governed retry contract; and creates a new provenance-linked attempt for deliberate restart.
  7. The outcome coordinator supplies progress and the final outcome to the Persistence API client. The browser-local flight path does not depend on Socket.IO.

Inactive socket scaffold​

The repository contains a typed Socket.IO client library, and Kubernetes routes /socket.io to the API. The Release 1 application composition does not connect that library into the flight path, while the API has no production flight-command forwarder. Architecture therefore does not model it as an active Web Application component or required runtime relationship.

Fail-closed boundaries​

BoundaryFailure behavior
Launch configurationReject missing, disabled, stale-revision, or mismatched aircraft, world, control, camera, terrain, physics, and catalogue references before flight
World initializationCancel replaced initialization, dispose partially created resources, and render a stable world diagnostic instead of a partial scene
Asset and world-space compositionReject invalid manifests, empty geometry, attribution or role mismatches, unavailable camera anchors, and terrain/collision misalignment
Physics and frame lifecycleKeep one authoritative fixed-step state; convert world, camera, asset, and frame errors into typed diagnostics rather than continuing with divergent state
Completion persistenceKeep the terminal attempt state, report persistence failure, and withhold the saved debrief and progress checkpoint until the write succeeds

These links make the C3 implementation boundary reciprocal with the governed product records. Status remains visible in each reader; implementation evidence does not approve a Proposed Feature or requirement.

ConcernFeatureRequirementCanonical Tasks
React/Vite browser foundationAEROSIM-FT-41FR-0048TASK-0011, TASK-0012, TASK-0013
Three.js and React Three Fiber renderingAEROSIM-FT-45FR-0052TASK-0025, TASK-0026, TASK-0027, TASK-0139
Rapier fixed-step flight physicsAEROSIM-FT-46FR-0053TASK-0028, TASK-0029, TASK-0030

Implementation anchors​

ComponentPrincipal implementation paths
Pre-flight and launch configuratorapplications/web/src/preflight/, applications/web/src/session/launch/
Flight deck and world bootstrapapplications/web/src/App.tsx, applications/web/src/flight/FlightCanvas.tsx, applications/web/src/flight/world/initialize-session-world.ts
Authoritative deterministic flight runtimeapplications/web/src/flight/authoritative-flight-state.ts, applications/web/src/flight/physics/
R3F world and aircraft compositorapplications/web/src/flight/SceneRoot.tsx, applications/web/src/flight/world/, applications/web/src/flight/assets/, applications/web/src/flight/cameras/
Flight-state and recovery presenterapplications/web/src/flight/presentation/, applications/web/src/flight/instruments/, applications/web/src/flight/warnings/, applications/web/src/flight/recovery/
Attempt and outcome coordinatorapplications/web/src/flight/session/, applications/web/src/flight/outcome/

Deployment boundary​

Public HTTPS terminates on Osgiliath. Osgiliath forwards HTTP to Kubernetes Ingress, which routes / over HTTP to this container's Nginx Service. Public URLs and browser-observed API protocols remain HTTPS/WSS; the internal proxy hop does not require an aerosim-tls Secret.