product:create

Scaffold a new product inside the workspace.

product:create does NOT build a runnable product. It only generates the scaffolding. It writes the directory skeleton (Docker files, scripts, src/, pyproject.toml, UVL scaffold) with zero features selected and nothing built. There are no installed dependencies, no database, no containers, and no running server at this point.

Turning the scaffold into a working application is a separate, later sequence.

  1. product:select. Make it the active product
  2. product:configure. Choose its features
  3. product:resolve. Link the selected features
  4. product:derive --dev. The command that actually builds and launches the product (Docker images, DB, migrations, server)

Usage

splent product:create <product_name>

Example

splent product:create sample_splent_app

The product name must be unique inside the workspace and must be a valid Python identifier (lowercase, underscores).

If the CRC32-based port generation produces ports that collide with an existing product in the workspace, a warning is displayed. Review the generated Docker files and adjust ports if needed.


Description

Generates a fully scaffolded product from official Jinja templates. No manual setup is required.

The template context includes a network_name variable (defaults to splent_network) used in generated Compose files.

During creation, the command prompts you to select one of the SPL models the workspace knows. If the model is not on disk it is fetched from UVLHub, and the DOI is recorded in the new product under [tool.splent.spl_model] so any clone can resolve it. Pass --spl <name> --spl-doi <doi> to name a model this workspace has never seen.

After creation, the product has no features. Configure them with product:configure, or add them individually with feature:attach or feature:add.


Generated structure

<workspace>/
└── <product_name>/
    ├── docker/
    │   ├── .env.dev.example
    │   ├── .env.prod.example
    │   ├── docker-compose.dev.yml
    │   ├── docker-compose.prod.yml
    │   ├── Dockerfile.<product_name>.dev
    │   └── Dockerfile.<product_name>.prod
    ├── entrypoints/
    │   ├── entrypoint.dev.sh
    │   └── entrypoint.prod.sh
    ├── scripts/
    │   ├── 00_core_requirements_dev.sh
    │   ├── 00_install_features.sh
    │   ├── 01_compile_assets.sh
    │   ├── 02_0_db_wait_connection.sh
    │   ├── 02_1_db_create_db_test.sh
    │   ├── 02_2_db_create_splent_migrations.sh
    │   ├── 03_initialize_migrations.sh
    │   ├── 04_handle_migrations.sh
    │   ├── 05_0_start_app_dev.sh
    │   └── 05_1_start_app_prod.sh
    ├── uvl/
    │   └── <product_name>.uvl          ← UVL variability model scaffold
    ├── src/
    │   └── <product_name>/
    │       ├── __init__.py
    │       ├── config.py
    │       ├── errors.py
    │       ├── logging.py
    │       ├── static/
    │       └── templates/
    ├── pyproject.toml
    ├── package.json
    ├── .gitignore
    ├── LICENSE
    └── README.md

Key generated files

pyproject.toml (product metadata)

[project]
name = "<product_name>"
version = "0.0.1"
requires-python = ">=3.13"

[tool.splent]
spl = "<spl_name>"
features = []

The spl field references the SPL from the catalog. Features are populated via product:configure or manually with feature:attach / feature:add.

Startup scripts

The startup pipeline runs in numbered order.

Script Purpose
00_core_requirements_dev.sh Install core Python dependencies
00_install_features.sh Pip-install all declared features (state becomes installed)
01_compile_assets.sh Build frontend assets (Webpack)
02_0_db_wait_connection.sh Wait for MariaDB to be ready
02_1_db_create_db_test.sh Create the test database
02_2_db_create_splent_migrations.sh Create the splent_migrations tracking table
03_initialize_migrations.sh Run splent db:migrate (generate migration files)
04_handle_migrations.sh Run splent db:upgrade (state becomes migrated)
05_0_start_app_dev.sh Start Flask dev server (state becomes active)

Requirements

  • A valid workspace must exist.
  • The command must be executed inside the SPLENT CLI environment.

Next steps after creation

splent product:select <product_name>
splent product:configure
splent product:derive --dev

See the Tutorials for the complete walkthrough.


Back to top

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