Workspace Builder — Aquilia Documentation
Comprehensive guide and documentation for Workspace Builder in the Aquilia framework. View API reference, examples, and implementation patterns.
Workspace Builder aquilia.workspace — Workspace() fluent builder Workspace is the top-level fluent builder that defines your entire application — its name, modules, integrations, and environment config. Everything chains off a single Workspace("name") call and lives in workspace.py at the project root. Minimal example Workspace() constructor Param Default Description )} .env_config() Wires an AquilaConfig base class into the workspace. At runtime, the framework reads the AQ_ENV environment variable and selects the matching subclass automatically. The config is then converted to a ConfigLoader and made available to all subsystems. .module() Registers a Module in the workspace. A module is a logical boundary that groups controllers, services, routes, models, and middleware under a single URL prefix and optional fault domain. Each Module builder is converted to a ModuleConfig internally. You can register as many modules as you need — they are isolated from each other unless explicitly declared as dependencies. .integrate() Adds a typed integration dataclass to the workspace. Pass instances from aquilia.integrations — each one has __post_init__ validation and a _integration_type field the framework uses for routing. There is no old-style Integration.database() static method — use the typed dataclasses directly. Combining env_config with integrations .env_config() controls the environment-level settings (server, auth tokens, DB URL) through AquilaConfig subclasses. .integrate() controls the subsystem behaviour (connection pools, middleware, logging). They are complementary — use both together for the cleanest production setup. .security() — high-level flags High-level flags that enable entire middleware categories with sensible defaults. For fine-grained control (custom CORS origins, CSRF exemptions, rate-limit algorithms), use the typed integration dataclasses via .integrate() instead. Sessions shorthand You can also use .sessions() as a shorthand instead of .integrate(SessionIntegration(...)). Both are equivalent. .mlops() Shorthand to enable the Aquilia MLOps platform — model registry, serving, drift detection, and lineage tracking. Equivalent to .integrate(MlopsIntegration(...)). Full production workspace ))} )
Go to Homepage