Stack

The doc server is a Rust application. Four crates carry most of the weight:

  • Rust + Tokio — async runtime. #[tokio::main] in src/main.rs wires the runtime, spawns the sitemap and backup background tasks, and hands control to the SFX app.

  • Hotaru (~/FDS/hotaru/) — async HTTP server. Provides multipart parsing, cookies, TLS. Helpers used throughout the route handlers:

    • req.form_or_default().await — urlencoded POST body (and multipart text fields when the urlencoded action is empty).
    • req.files_or_default().await — multipart file parts.
    • files.get_first_file(name) — pull a named upload.
    • file.data() / file.filename() — bytes and original filename of an uploaded file.
    • req.query(name) — query-string value.
  • Akari — templating crate. Tag syntax:

    • -[ if cond ]- … -[ end ]-
    • -[ for x in list ]- … -[ end ]-
    • -[ insert var ]-

    Two constraints worth memorizing because they affect every template change:

    • No else branch. Write two ifs with inverted conditions instead.
    • No auto HTML-escaping. The caller escapes every user-derived string before it ever reaches the template. See html_escape in src/content.rs.
  • SFX — Akari endpoint! macro framework layered on Hotaru. Provides op::lang_or_none, op::default_lang, op::pageprop, and route registration via the endpoint! macro. Endpoint bodies are async-capable (you can .await inside).

Together these give a thin per-request flow: Hotaru parses, SFX dispatches, the type-specific renderer in src/content/ produces HTML, and Akari assembles the page via templates/base/base.html.