Learn how to customize templates to fit your specific needs
Templates provided by create-vlang-app are designed to be customizable. This guide shows how to adapt generated V projects — from module layout and tooling to dependencies and environment settings.
After scaffolding, reorganize modules to match your domain. Common patterns across CVA templates:
Prefer top-level V modules (health/, greet/) — nested src/features/ paths do not import cleanly in V.
Keep module name, version, and dependencies in v.mod; run v install after edits.
Every starter ships a docs/ tree — extend AUTHORING / PROJECT_STRUCTURE instead of duplicating rules in README.
Keep *_test.v next to the code under test and run v test ..
Templates ship with v.mod, Makefile targets, and fmt/vet defaults you can tune:
Module {
name: 'my_app'
description: 'My V application'
version: '0.1.0'
license: 'MIT'
dependencies: []
}Add VPM dependencies here, then run v install. Growth starters already declare real vsl / vtl / rxv deps.
Manage dependencies with VPM after scaffolding:
# Edit v.mod dependencies, then: v install # Install a specific module into ~/.vmodules v install vsl # Refresh after lock/path changes v install
For Docker, Postgres, or CI wiring, prefer scaffolding with the matching extension rather than hand-copying fragments.
If you want extensions on an existing project, you can manually port the files from cva-templates/extensions or re-scaffold with the desired combination:
template/ overlay onto your project and reconcile conflicts.Different CVA templates have distinct extension points:
v-sqlite or v-postgres during scaffold.v-docker and github-setup for containers + setup-v CI.create-vlang-app my-api \ --template web-server \ --addons v-docker github-setup v-postgres
For deeper changes, adjust runtime configuration and deployment artifacts:
Use .env locally when an extension provides samples (never commit secrets):
# .env.example (from v-postgres / v-sqlite overlays) DATABASE_URL=postgres://user:pass@localhost:5432/app PORT=8080
When you scaffold with v-docker, customize Dockerfile, compose files, and health checks for your deployment target. Rebuild with docker compose up --build after changes.