server library

The Fluvie render API server.

Pulls in dart:io, shelf, and minio, so it is NOT web-safe — a Flutter app should import package:fluvie_server/client.dart instead. Use serverConfigFromEnvironment + buildServerDependencies + serveFluvieApi to start a server (see bin/fluvie_server.dart).

Classes

FileJobStore
A JobStore that writes one JSON file per job under a directory, so jobs and their download links survive a restart.
RetentionReport
What one retention sweep did (or would do, for a dry run).
RetentionScheduler
Runs a RetentionService sweep on a fixed interval.
RetentionService
Deletes expired render files and their job records.
S3Config
Connection settings for an S3-compatible bucket (AWS, MinIO, R2, B2, Spaces).
ServerConfig
The full server configuration, resolved once from the process environment by serverConfigFromEnvironment.
ServerDependencies
The collaborators the HTTP layer needs, bundled so the router and app builder take one argument.

Enums

StorageBackend
Which storage backend serves rendered files.

Functions

buildApp(ServerDependencies deps) → Handler
Composes the full request handler: CORS, JSON error mapping, then the router.
buildServerDependencies(ServerConfig config, {String schemaJson = '{}'}) ServerDependencies
Builds the ServerDependencies graph from config: the file store (local or S3), a file-backed job store, the pipeline render runner + queue, retention, and the download-token signer.
jobStoreFor(ServerConfig config) FileJobStore
The file store the FileJobStore needs, so a caller can reconcile jobs on boot without rebuilding the whole graph.
serveFluvieApi(ServerDependencies deps) Future<HttpServer>
Binds buildApp to the configured host/port and starts serving.
serverConfigFromEnvironment(Map<String, String> env) ServerConfig
Parses a ServerConfig from env (typically Platform.environment).

Exceptions / Errors

ServerConfigException
Thrown when the environment is missing a required value or holds a bad one.