rust-web-server 18.10.0

Single-binary web server and reverse proxy: automatic HTTPS (Let's Encrypt), HTTP/1.1, HTTP/2 and HTTP/3, load balancing, auth and rate limiting, configured in one TOML file. Also a Rust library: routing, middleware, MCP server, ORM, background jobs. No hyper, no Tower; HTTP/2 and HTTP/3 framing via h2 and quinn.
Documentation
/* rws admin: the rws8.tech theme (site/src/theme.css) plus this app's
   layout. Spacing, type, radii and motion come from the theme's tokens. */
@import "../../site/src/theme.css";

/* Latin subsets only, inlined into this stylesheet by the build. */
@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("@fontsource-variable/geist/files/geist-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("@fontsource-variable/geist-mono/files/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --ok: light-dark(#3f6b2a, #9fcf86);
  --warn: light-dark(#8a5a00, #f0c060);
  --bad: var(--md-sys-color-error);
  --muted: var(--md-sys-color-on-surface-variant);
  --line: var(--md-sys-color-outline-variant);
  --panel: var(--md-sys-color-surface-container-low);
}

body { min-height: 100dvh; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
.top {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-200);
  padding: var(--space-100) var(--space-300);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--space-75); font-weight: 600; font-size: var(--text-base); line-height: var(--leading-base); }
.brand-mark { width: 24px; height: 24px; border-radius: var(--md-sys-shape-corner-small); background: var(--rws-orange); }
.top .spacer { flex: 1; }
.top .meta { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); font-family: var(--font-mono); }
.side { border-right: 1px solid var(--line); padding: var(--space-200) var(--space-75); }
.bottom-nav { display: none; }
main:focus { outline: none; }
main { padding: var(--space-400) var(--space-300) var(--space-700); max-width: 1120px; width: 100%; box-sizing: border-box; }

@media (max-width: 839px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .bottom-nav { display: block; position: sticky; bottom: 0; z-index: 5; }
  main { padding: var(--space-300) var(--space-200) var(--space-900); }
  .top { padding: var(--space-100) var(--space-200); }
  .top .meta { display: none; }
}

[slot="icon"] { width: 24px; height: 24px; }
.icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.icon svg { width: 100%; height: 100%; fill: currentColor; }

/* ── page furniture ────────────────────────────────────────────────────── */
h1 { font-size: var(--text-2xl); line-height: var(--leading-2xl); margin-bottom: var(--space-75); }
h2 { font-size: var(--text-lg); line-height: var(--leading-lg); }
.lede { color: var(--muted); margin: 0 0 var(--space-400); max-width: 680px; }
.section { margin-top: var(--space-500); }
.section > h2 { margin-bottom: var(--space-200); }
.grid { display: grid; gap: var(--space-200); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.row { display: flex; align-items: center; gap: var(--space-200); flex-wrap: wrap; }

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  padding: var(--space-200);
}
.tile .label { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); }
.tile .value { font-size: var(--text-2xl); line-height: var(--leading-2xl); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: var(--space-50); overflow-wrap: anywhere; }
.tile .value.mono { font-family: var(--font-mono); font-size: var(--text-base); line-height: var(--leading-base); font-weight: 500; }

/* Status: always an icon and a word, never colour alone. */
.status { display: inline-flex; align-items: center; gap: var(--space-50); font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 600; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.bad { color: var(--bad); }
.status.muted { color: var(--muted); font-weight: 500; }

/* Tables: a real <table> for screen readers, scrolling inside its box. */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--md-sys-shape-corner-large); }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); line-height: var(--leading-sm); }
th, td { text-align: left; padding: var(--space-100) var(--space-200); border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; background: var(--panel); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: var(--font-mono); overflow-wrap: anywhere; }

.empty {
  border: 1px dashed var(--line); border-radius: var(--md-sys-shape-corner-large);
  padding: var(--space-400) var(--space-300); color: var(--muted); max-width: 680px;
}
.empty strong { color: var(--md-sys-color-on-surface); display: block; margin-bottom: var(--space-50); }
.empty code { font-size: var(--text-sm); }

.error-text { color: var(--bad); font-size: var(--text-sm); line-height: var(--leading-sm); margin: var(--space-75) 0 0; }

/* ── login ─────────────────────────────────────────────────────────────── */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-300) var(--space-200); box-sizing: border-box; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { display: flex; align-items: center; gap: var(--space-75); }
.login-card form { display: grid; gap: var(--space-200); margin-top: var(--space-300); }
.login-card p { color: var(--muted); margin: 0; }

/* ── chart (dataviz: one series, 2px line, recessive grid, hover layer) ─ */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 180px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 12px; font-family: var(--font-mono); }
.chart .series { fill: none; stroke: var(--md-sys-color-primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .crosshair { stroke: var(--md-sys-color-outline); stroke-width: 1; }
.chart .dot { fill: var(--md-sys-color-primary); stroke: var(--md-sys-color-surface); stroke-width: 2; }
.chart .tip {
  position: absolute; top: 0; pointer-events: none; transform: translateX(-50%);
  background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface);
  border-radius: var(--md-sys-shape-corner-medium); padding: var(--space-50) var(--space-75);
  font-size: var(--text-xs); line-height: var(--leading-xs); white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* ── logs ──────────────────────────────────────────────────────────────── */
.log {
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: var(--leading-xs);
  background: var(--md-sys-color-surface-container-lowest); border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large); padding: var(--space-100);
  height: 60dvh; overflow: auto; margin: 0;
}
.log div { white-space: pre-wrap; overflow-wrap: anywhere; padding: var(--space-25) 0; border-bottom: 1px solid var(--line); }
.log div.err { color: var(--bad); }

lit-material-text-field { min-width: 0; }
.filter { width: 100%; max-width: 420px; margin-bottom: var(--space-200); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
lit-material-alert { display: block; margin-bottom: var(--space-300); }