- Python 57.6%
- Jinja 21.5%
- TypeScript 14.2%
- CSS 3.2%
- Go Template 1.6%
- Other 1.9%
fix(template): frontend package named after the project See merge request ienw/dilab/policies/vliegwiel!22 |
||
|---|---|---|
| compliance | ||
| docs | ||
| scripts | ||
| src/vliegwiel | ||
| template | ||
| tests | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .pre-commit-config.yaml | ||
| copier.yml | ||
| LICENSE | ||
| NOTICE | ||
| pyproject.toml | ||
| README.md | ||
| start.py | ||
| uv.lock | ||
Vliegwiel
A Copier template for web applications: one container image with a FastAPI backend and a React frontend built from NL Design System components, PostgreSQL, sign-in through OpenID Connect (Keycloak locally), and a Helm chart for Kubernetes or OpenShift, deployed with GitOps. Open source from the first commit.
NotaBene, meeting minutes from a recording, is built on it and shows what a full application on this template looks like: background workers, object storage, a brand and content overlay per deployment, and a deployment repository set up from the generated documentation.
Vliegwiel is maintained by the Ministry of Infrastructure and Water Management (IenW) for its own projects. Some choices suit Dutch government work (NL Design System, the EUPL licence, BIO-oriented audit logging), but it is not a standard or a requirement for anyone: use it, fork it or take parts of it. The defaults (licence, copyright holder) can all be changed when generating a project. Questions, ideas and security reports: codebase.dilab@minienw.nl.
Installing
Working on Vliegwiel itself, or generating projects often: clone this repository and install the CLI editable, once:
uv tool install --editable .
vliegwiel "Mijn Project"
vliegwiel then always runs from this checkout — pull, or edit the template,
and the next run uses it, uncommitted changes included; no reinstall needed.
Just using Vliegwiel: a regular install bundles a snapshot of the template into the tool, so it works without a checkout:
uv tool install . # from this repo, or `uv tool install git+<repository URL>`
vliegwiel "Mijn Project"
Re-run uv tool install . --reinstall to pick up template changes.
Without installing anything, uv run start.py from this repository does the
same: it is a compatibility shim around the same CLI (src/vliegwiel/cli.py),
running in the project's own synced venv. Since that runs inside this
repository, pass --output (or type a path at the destination prompt) so the
project lands outside this repository; vliegwiel refuses to create one inside it.
Creating a project
The first argument is the human-readable project name — shown in the app
header and README — not the slug. The slug (folder name, GitLab project name,
Docker image tag) is derived from it: NotaBene → nota-bene,
Mijn Project → mijn-project. You're then prompted to confirm
or override the derived slug, the destination, and (if you didn't pass
--description) the description.
The destination defaults to ./<slug> in the current directory, so run
vliegwiel from the folder the project should go in, for example the local
mirror of your Git group layout. It installs
locked Python/Node dependencies and Git hooks, then prints the commands to
start it. Prerequisites: uv, Node 24+, Git,
Docker Compose v2. No GitLab project or live deployment is created.
After setup, vliegwiel opens a new shell inside the generated project, so you
can start it right away; exit returns to where you were. Pass --no-shell to
skip that (it is also skipped when stdin is not a terminal).
cd mijn-project # only needed later, or with --no-shell
docker compose up --build --wait # detached
docker compose up --build # attached, streaming logs — handy for a demo
Open http://localhost:8080 and choose the local user, administrator, or type any name to log in as a fresh test identity.
Skip every prompt for scripted use — pass --slug, --description and
--output up front:
uv run start.py "Mijn Project" --slug mijn-project --description "Een nieuwe digitale dienst" \
--output /path/to/mijn-project --generate-only
The CLI does not prompt for the open-source answers; it uses the defaults
(EUPL-1.2, Ministerie van Infrastructuur en Waterstaat, no security contact
or repository URL yet). Fill in security_contact and repository_url before
publishing: edit .copier-answers.yml and run uvx copier update, or pass
them with uvx copier copy --data security_contact=... /path/to/vliegwiel ....
Changed your mind about the name or slug after generating? Copier has no
rename command — edit .copier-answers.yml and the corresponding files
(project.json, README.md, the folder name itself) by hand, or delete and
regenerate if nothing has been customized yet.
For interactive prompts without any of start.py's defaults or setup steps:
uvx copier copy /path/to/vliegwiel /path/to/mijn-project
What is included
- Open source from the first commit:
LICENSE(EUPL-1.2 by default, the Dutch government's preferred licence; Apache-2.0 as an alternative),NOTICE,SECURITY.md,CONTRIBUTING.md(public repository as a read-only mirror ofmain) andpubliccode.yml. The image shipsLICENSEandNOTICE. - Responsive React/TypeScript frontend built from NL Design System components,
neutral by default (NLDS Start theme). An organisation's house style (an NLDS
theme, logo, fonts) is an overlay per deployment
(a ConfigMap on the platform), so the code contains no
brand assets; see the generated
docs/branding.md. - Organisation content (privacy statement, help page, contact address, banner)
as a second overlay per deployment, with neutral placeholders and an optional
per-user acknowledgement of the privacy statement version; see the generated
docs/content.md. - FastAPI, SQLAlchemy, Alembic and private notes demonstrating DB persistence.
- Explicit local dev/admin identities; optional real local Keycloak with PKCE.
- One environment-variable prefix per project (question
env_prefix, defaultAPP_), used by the backend, Compose, the Helm chart and the docs. - Optional background tasks (question
workers, CLI--workers): Celery workers and beat from the same image, RabbitMQ in Compose, one chart Deployment per worker plus a single beat. The template keeps oneuv.lockper variant; CI checks both. - Runtime frontend settings, single-image production build, local hot reload.
- uv/pnpm lockfiles (pnpm, like NL Design System), strict mypy, Ruff McCabe <= 4 and 85% branch-coverage gate.
- Mandatory local checks and matching GitLab CI checks; branch protections must still be configured on GitLab.
- MkDocs and AGENTS.md (read directly by Claude Code, Codex and other tools; no tool-specific instruction files).
- Application-owned Helm chart; deployment-repo examples for tst/acc/prd and Argo app-of-apps. A registry proxy for base images (such as Harbor) is an explicit CI build argument.
- Standard audit schema, transactional audit persistence, append-only DB guard, safe central JSON events, and BIO-oriented decision/evidence/runbook templates.
Design choices
Copier is used for its update workflow. Cookiecutter would still generate files, but propagating improvements into existing projects is the key requirement here. Keep questions few: name and description first. Celery and split frontend deployment should become separately tested profiles only when needed; file storage (S3: RustFS locally) already ships by default since most projects need it.
The initial profile is intentionally opinionated. Application code and its chart stay together; deployment repositories own environment values and approvals. Promote an immutable image together with its corresponding chart commit. Avoid turning one universal chart into a growing list of product-specific exceptions.
Build and deploy come from the shared ci-templates (CI_TEMPLATE), with a
standalone fallback in ci/standalone.yml for forks without it; see the
generated docs/deployment.md.
Testing this template
uv sync
uv run python scripts/check.py # lint, type-check and test start.py/scripts/tests
uv run pre-commit run --all-files # same, plus generic file hygiene hooks
.gitlab-ci.yml runs the same checks, then generates a project from the
current commit and runs its checks (Python, frontend, MkDocs, Helm) as a
regression gate — a template change that would break every generated project
fails this repo's own CI, not the next real project.
Template maintenance
The template's look is neutral; an organisation's house style is a brand overlay
(see the generated docs/branding.md). See styling updates for how
central changes reach existing projects.
Releases are Git tags (v0.5.0) following semantic versioning: a fix only
raises the patch number, a new backwards-compatible feature the minor number,
and a change that existing projects must adapt to the major number (from 1.0;
before that, the minor number, with the change in the tag message). The tag,
pyproject.toml and vliegwiel.__version__ carry the same version.
copier update moves a project from the tag in its .copier-answers.yml to
the latest one. Generated projects must commit .copier-answers.yml and their
initial output. From a clean project branch, use uvx copier update, review
conflicts, regenerate neither live secrets nor environment decisions, and run all
checks. Updates are reviewed code changes, never unattended production upgrades.
Run the acceptance procedure in docs/validation.md.
The initial validation results record what was tested
and what still needs platform acceptance.
Compliance documentation (BIO mapping and evidence, decisions, DPIA, AIIA,
runbooks) is not part of the application, which may become public. Generate it
as a separate, internal repository with vliegwiel "Mijn Project" --compliance
(or kind=compliance in Copier); see compliance/docs/index.md
for the implemented controls and outstanding responsibilities.