Skip to main content

Module server

Module server 

Source
Expand description

Loopback-only HTTP backend for the SeatTrellis desktop app.

Serves the compiled React workbench (clients/web/dist) and exposes the native endpoints the workbench’s teacher flow needs end-to-end: roster upload & preview, class generation (which also creates an editable draft), the command-driven seating editor, export, and the static catalogs.

The HTTP transport is axum/hyper/tokio (M1-04): crate::http adapts every request into the legacy [Request] shape and dispatches through [route], so the business layer and its tests are unchanged. Bounded concurrency, 64 MiB body limit (413) and graceful shutdown come from the maintained stack instead of a hand-rolled parser.

Security posture (from-zero standards):

  • Binds loopback only (127.0.0.1); never exposes a LAN address.
  • No CORS headers are ever emitted; clients must already be same-origin.
  • Static files are confined to the configured web root; .. traversal and percent-encoded escapes are rejected, and canonical paths are re-checked.
  • Errors are coarse (404 not found) and never leak internal paths.
  • No unwrap/expect on the request path; all failures become HTTP errors.
  • Session/token/Host checks are the M1-05 milestone (not yet landed).

Structs§

Server
The running backend: a bound loopback listener plus the web root and the in-process stores shared across connection threads.
ServerConfig
Validated settings for the local backend.

Enums§

ServerError
Errors surfaced by resolve_web_root and Server::bind.

Functions§

resolve_web_root
Locate a complete workbench build (index.html present) from, in order: