ddev config --project-name testddev runs composer install, dev/build and frontend install and build on startup.
ddev startIf you want to run it manually, you can run:
ddev composer install
ddev yarn --cwd=themes/mytheme
ddev yarn --cwd=themes/mytheme build You can rename the theme to your own theme name.
- ./ddev/config.yml (post-start-hook command)
- app/config/theme.yml (ssviewer and vitehelper settings)
This starter uses vite and tailwindcss for frontend. Vite comes with a dev server and hot reloading; start it with:
ddev vite devOptimized DDEV commands are available for frontend development, utilizing Node.js within the container.
Note: These commands automatically detect the active theme from the Silverstripe configuration (SSViewer.themes). They will ignore special themes like $public or $default and use the first custom theme folder found in ./themes/.
- Start Vite Dev Server:
ddev vite dev
- Create Production Build:
ddev vite build
- Check Code Formatting:
ddev prettier check
- Automatically Fix Code Formatting:
ddev prettier write
Formatting covers JavaScript, CSS/SCSS, and Silverstripe templates (.ss).
The vite dev server needs the current server name set in a ENV variable:
VITE_DEV_SERVER_URL="https://starter-ddev.ddev.site:5173/"ddev sake db:build -for
ddev build To get a list of tasks run
ddev sake tasksTo get infos about a task run e.g.
ddev sake tasks:i18nTextCollectorTask -hInstall all packages locally
ddev composer installSS Shell is a tool to tinker around in CLI, based on PsyShell. You can open the shell using
ddev php vendor/bin/ssshell Or the even shorter version:
ddev tinker You can get DataObjects like in any code (e.g. Page::get()->byID(42)), run methods on objects, etc.
Inside ssshell you can run help to see a list of available commands.
Code Sniffer is a tool to detect violations of a defined coding standard (mostly PSR-12)
See phpcs.xml.dist for the ruleset used.
Detect violations
ddev composer run lintor
ddev lintThis command also runs prettier check to verify frontend formatting.
Fix most violations automatically
ddev composer run fixor the shortcut
ddev fixThis command also runs prettier write to format frontend assets.
PHP Static Code Analyzer is a tool to detect bugs in your code without running it. It can be used to detect type errors, dead code, and other issues.
Don't be too much annoyed by the errors. Rector can fix a lot of them automatically.
A level of 4 should be doable.
ddev composer run phpstanor
ddev stanRector is a tool to refactor code automatically. It can be used to upgrade code to a newer version of Silverstripe or PHP.
See rector.php for rules and configuration.
ddev composer run rector-dry #dry run
ddev composer run rectoror
ddev rector --dry-run #dry-run
ddev rector For the first time run it's recommended to refactor rule by rule. Run rector-dry to see which rules would be applied, then let rector change the code.
Prettier is a JavaScript tool for code formatting. It's configured in the base theme to format SS templates.
It's recommended to use it for all JavaScript and CSS files. It's also used to format SS templates in the base theme. See also the configuration file themes/mytheme/.prettierrc.
ddev prettier check #dry-run
ddev prettier write #change filesJack is a tool for checking and lifting composer dependencies. It's configured to check for outdated dependencies and lifter to update them automatically.
ddev jack breakpoint #check for outdated packages
ddev jack open-versions #allow newer, non breaking major versions
ddev jack raise-to-installed #update versions to the latest installed versionsThis starter template comes with a CI tool, that includes all the relevant tools for continuous integration:
- PHPUnit: unit tests
- PHPCS: code sniffer and linting for PHP code
- Prettier: code formatting for JavaScript, CSS and Silverstripe templates
- Rector: code update for PHP
- PHPStan: static analysis tool for PHP code
- Jack: composer updated checker and lifter
- ssslug module for SS6 (map marker)
- map element and mapbox field for backend
- Silverstripe Piwik SS6
- Address Extension for SiteConfig - show in Address.ss
- Adress/Contact Element
- implement ssshell and document usage
- cookieconsent default settings
ssh-copy-id user@yourserverAdd the deploy key to your github or gitlab repository
ssh user@yourserver
software install composer
vendor/bin/dep deploy:setup
- configure webroot
- create database on the server
- create .env in /releases/
- add SSL certificate
- switch https redirect on
vendor/bin/dep deployor
ddev composer deployA compact guide to quickly set up project-specific Node.js using nvm, PhpStorm, and DDEV.
- Open project in WSL, *not C:*
- Example path:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash source ~/.bashrc # Check DDEV Node version
ddev ssh node -v
# Install same version in WSL
nvm install <version>
nvm use <version>
# Optional: create .nvmrc for project
echo "<version>" > .nvmrc
nvm use File → Settings → Languages & Frameworks → JavaScript Runtime- Add WSL Node interpreter
- Distribution:
Ubuntu -
- Node path:
/home/<user>/.nvm/versions/node/v<version>/bin/node
- Node path:
- Package manager is auto-detected.
Settings → Languages & Frameworks → JavaScript → Code Quality Tools → ESLint `
- Node interpreter: WSL Node
- ESLint package:
themes/<mytheme>/node_modules/eslint - Prettier:
Settings → Languages & Frameworks → JavaScript → Prettier- Node interpreter: WSL Node
- Prettier package:
themes/<mytheme>/node_modules/prettier
- Use WSL Node as runtime
- Package manager: Custom → ddev npm
- Commands execute like:
bash ddev npm run dev
# .ddev/config.yaml
nodejs_version: "22" - Keep
.nvmrcsame as DDEV version.
which node
node -v
ddev npm -v - PhpStorm Run Script → should execute via
ddev npm run <script>.
- Always open projects from WSL, not Windows paths.
- nvm manages Node for IDE; DDEV handles container builds.
.nvmrcensures consistent Node across environments.- Avoids conflicts with local Windows Node versions.