Skip to content

Architecture

Reedtrullz edited this page May 17, 2026 · 1 revision

Architecture

RFMC is an npm workspace monorepo:

  • shared/: TypeScript FMC state, page renderers, validation, navdata, training selectors, and display models.
  • src/: React 18 + Vite frontend, Zustand stores, CDU/MCDU components, cockpit instruments, PWA shell, and visual routes.
  • server/: Express/WebSocket bridge, backend FMC engine, aircraft adapters (PMDG, FBW mock).
  • e2e/: Playwright smoke, workflow, layout, visual, and high-resolution baseline tests.
  • docs/: Status, roadmap, scope, testing, release, and wiki source documentation.

Modes

Standalone/offline mode keeps state in the frontend Zustand store. No server required.

CONTROL mode uses the backend FMC engine as the display authority and sends updates through WebSocket. The frontend acts as a thin display client, sending keypresses and receiving display data.

Key Design Rules

  • New CDU/MCDU behavior should preserve frontend standalone and backend CONTROL-mode parity.
  • Physical keyboard LSK: F1–F6 target left LSK 1–6, F7–F12 target right LSK 1–6, Shift+F1–F6 alternate right LSK.
  • Visual snapshots protect render stability; they do not claim hardware pixel accuracy.
  • Shared display models (buildPfdDisplayModel, buildBoeingMcpDisplayModel, etc.) are the single source of truth for formatting.

Workspace Structure

shared/src/
  fmc/pages/        Page renderers (Boeing + Airbus)
  types/            Shared TypeScript types
  validation/       Input validators
  training/         buildTrainingProgress(), training selectors
  display/          buildPfdDisplayModel(), buildLnavState(), buildVnavPrediction(), etc.

src/
  components/CDU/   Boeing CDU, Airbus CDU components
  components/cockpit/ ND, PFD, MCP/FCU, cockpit layout
  store/            useFMCStore (Zustand)
  hooks/            useWebSocket, usePWA

server/src/
  fmc-engine.ts     Backend FMC engine
  adapters/         PMDG, FBW aircraft adapters
  index.ts          Express + WebSocket bridge

Clone this wiki locally