server

6 modules

  • server/app_backend.ts

    App backend types and factory — database initialization + auth migrations + deps.

    Provides AppBackend, CreateAppBackendOptions, and create_app_backend().

    Vocabulary: - AppDeps — stateless capabilities: injectable, swappable per environment - *Options — static values set at startup, per-factory configuration - Runtime state — mutable values (e.g., bootstrap_status) — NOT in deps or options

  • server/app_server.ts

    Server assembly factory.

    Consumers provide a pre-initialized AppBackend and options (session, origins, routes); create_app_server() handles middleware, bootstrap status, surface generation, and Hono app assembly.

  • server/env.ts

    Base server environment schema and validation.

    Provides BaseServerEnv — a shared Zod schema for common server env vars that apps can use directly or extend with app-specific fields.

    Generic env loading lives in env/load.ts.

  • server/startup.ts

    Composable startup summary helpers.

    Logs a human-readable summary from an AppSurface.

  • server/static.ts

    Static file serving middleware for SvelteKit static builds.

    Multi-step static serving: - Step 1: Exact path match (handles /, assets, images) - Step 2: .html fallback for clean URLs (/about/about.html) - Step 3 (optional): SPA fallback for client-side routes

  • server/validate_nginx.ts

    String-based nginx config validator for fuz_app deploy configs.

    Checks consumer NGINX_CONFIG template strings for required security properties. This is pattern matching on template strings, not a real nginx parser — it catches common security omissions but won't catch all possible misconfigurations.