Framework

The framework is the runtime. When the product starts, create_splent_app builds one Flask application out of the product and its features, in the order the model gives. You do not run it by hand. Every product calls it.

What it does at boot

  1. Loads the configuration in layers, from the framework’s defaults through each feature’s settings and the product’s config.py to the environment. A stronger layer wins whatever order they load in, so a feature’s default never replaces what the product chose.
  2. Sets up what features rely on, such as the database, security headers, translations and the template engine.
  3. Loads the features in the model’s order. For each one it imports the package, registers its routes, models, hooks, services and commands, and applies its refinements to the features it extends.
  4. Sets up what depends on the features, such as sessions, the keys, the background tasks and CSRF protection, and wraps the app in its health probes, /healthz and /readyz.

Each feature migrates its own tables in the shared database, in the same order.

How it relates to the other layers

  • Product line. The model decides the load order.
  • Features. The framework provides the registries features fill, such as template hooks, the service locator, signals, assets, menus, the admin panel, readiness checks and the audit trail, and runs their background tasks.
  • Product. It reads which features to load from the product’s pyproject.toml.
  • Infrastructure. In development it runs under Flask’s server and reloads on changes. In production it runs under gunicorn inside the image.

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es