xm / starter_craft_3
Starter for creating Craft 5 sites at XM Media
Package info
github.com/xmmedia/starter_craft
Language:Twig
Type:project
pkg:composer/xm/starter_craft_3
Requires
- php: 8.5.*
- ext-intl: *
- born05/craft-assetusage: ^4.2.1
- craftcms/ckeditor: ^5.7.0
- craftcms/cms: ^5.10.14
- craftcms/contact-form: 3.1.0
- craftcms/contact-form-honeypot: 2.1.0
- ether/seo: 5.0.0
- hybridinteractive/craft-contact-form-extensions: 5.0.0
- nystudio107/craft-vite: ^5.0.2
- roave/security-advisories: dev-master
- stimmt/craft-mcp: ^1.4.0-beta.12@beta
- verbb/field-manager: ^4.0.4
- vlucas/phpdotenv: ^5.4
- wrav/oembed: ^3.2.2
Requires (Dev)
- craftcms/generator: ^2.2
- friendsofphp/php-cs-fixer: ^3.95
- friendsoftwig/twigcs: ^6.0
- phpstan/phpstan: ^2.2
- rector/rector: ^2.0
- yiisoft/yii2-shell: ^2.0.3
This package is auto-updated.
Last update: 2026-08-26 16:05:49 UTC
README
Used to create new projects using Craft CMS at XM Media.
Setting Up a New Site
- Create a new project:
composer create-project xm/starter_craft project-name --stability=dev --no-install --remove-vcs
- Update
composer.json:name,license(likelyproprietary) anddescription - Update
package.json:name,version,git.url,license,private - Setup dev server:
- If using InterWorx, run
./provision_site.shlocally — it provisions the whole site (see Provisioning a Site below) and runssetup_server.shfor you. To do it by hand instead, uploadsetup_server.shto the domain dir and run:sh ./setup_server.sh - Upload the files (exclude files that are OS dependent like
node_modules&.envor that are only for editing like.ideaand.gitand a lot of what's in.gitignore). - Install Composer (if not already installed)
- Install PHP packages/vendors:
php composer.phar install - Add
.env(copy.env.exampleand update). - Run
. ./node_setup.sh(this will setup node & install the JS packages – requires yarn to be installed). - Run
yarn build(for production) to compile JS & CSS files. - Give executable perms to bin dir:
chmod u+x craft - Ensure you have lando running.
- Within
lando ssh, install craft:./craft install/craft
- If using InterWorx, run
- Remove or update the
LICENSEfile. - Install Composer locally (if not installed globally).
- Composer install & update (locally):
composer install && composer update - Run
lando yarn && lando yarn up -R '**'locally. - Upload
composer.lockandyarn.lockand on the server, runphp composer.phar installand. ./node_setup.shagain. - Find and make changes near
@todo-craftcomments throughout the site. All changed files will need to uploaded to the server. - Create new favicons: realfavicongenerator.net
- Set the email Subject Text for contact form submissions in Settings > Contact Form (under Plugins).
- Delete or update the starter's
README.md. - Update site name:
- In Settings -> General
- In Settings -> Sites
- Globals -> Site Information
Dev site can be accessed at https://[domain]/
Craft admin is located at /admin
Provisioning a Site
For sites on an InterWorx server, ./provision_site.sh (run locally) does the whole setup:
1Password items, the SiteWorx account, the database, setup_server.sh, the PHP restart
sudoers entry, the Craft queue cron job and the GitLab CI/CD variables.
- Requires an ssh Host with passwordless sudo,
opsigned in,glabauthenticated andjqinstalled. - It asks whether you're provisioning staging or production, then prompts for everything else and shows a summary before making any changes.
- The remaining manual steps (DNS record, SSL certificate, CI public key,
shared/.env, first deploy, Craft database) are printed at the end. The DNS record doesn't need to exist beforehand — it's only needed before generating the SSL certificate.
Related scripts:
setup_server.sh– runs on the server as the site user, in the domain dir; creates thereleases/sharedstructure and symlinks. Normally run byprovision_site.sh.setup_gitlab_ci_vars.sh <group/project>– sets the GitLab CI/CD variables for one scope (staging or production). Can be run on its own; see--help.
System Requirements
- PHP 8.5+
- MySQL 8.4
- Node 24
- Yarn v4
Commands
Yarn commands run inside the Lando node container via lando yarn <command>, so the
Node version matches .nvmrc rather than whatever the host happens to have.
Running them on the host with yarn <command> still works.
- Install JS packages:
lando yarn install - Run all checks & fixes:
bin/check_full- Runs Rector & PHP CS Fixer (applying fixes), then
bin/check; run before pushing
- Runs Rector & PHP CS Fixer (applying fixes), then
- Check all code (no fixes):
bin/check- Runs linting (JS, CSS, YAML, Twig), PHP static analysis & security audits
- Dev JS/CSS server with HMR:
lando vite(runsyarn install, thenyarn dev, in thenodecontainer)- Assets are proxied through the appserver at
https://[domain]/vite-dev/so they're same-origin with the site — that's what lets the SVG icon sprite work without a polyfill (<use href>can't cross origins). Seelando_apache_vite.conf - Stop a server left running in the container:
lando vite-stop - A
503on a/vite-dev/…asset means the dev server isn't running — start it withlando vite - To run it on the host instead, just use
yarn dev— Apache falls back to a host-run dev server, so the URLs and behaviour are the same
- Assets are proxied through the appserver at
- Compile check:
lando yarn build:check- Builds to
node_modules/.build-check, so it's safe to run whilelando viteis running
- Builds to
- Production JS/CSS build:
lando yarn build- Don't use this to verify a change — it rewrites
public/build, clobbering the manifest a runninglando viterelies on
- Don't use this to verify a change — it rewrites
- Preview a production build:
lando yarn preview- Serves
public/buildathttps://localhost:9528/build/, mirroring the production paths (9528 is the only port thenodeservice publishes)
- Serves
- Linting:
- PHP CS Fixer:
lando composer cs:fix - Rector:
lando composer rector(dry run) orlando composer rector:fix - PHP Static Analysis (PHPStan):
lando composer static - Security audits:
lando yarn audit:moderateorlando yarn audit:high - Upgrade a JS package, ignoring the age gate:
lando yarn up:bypass <package>
There are no tests in the starter — add them (and their scripts) as a project needs them.
Incorporated Libraries & Tools
- Frontend – full list of dependencies can be found in package.json
- Vue 3 – frontend framework
- Vite – frontend build tool and dev server with HMR
- Tailwind CSS 4 – utility-first styling framework
- @tailwindcss/typography – prose styling plugin
- ESLint – checks JS for conventions & errors
- Stylelint – checks CSS for conventions & errors
- SVGO – optimizes SVG files
- Backend – full list of dependencies can be found in composer.json
- Craft CMS 5 – CMS framework
- Twig – server-side templating language
- CKEditor – rich text editor plugin for Craft
- Contact Form – contact form plugin for Craft
- Contact Form Honeypot – spam protection for contact forms
- Contact Form Extensions – additional contact form features
- SEO (Ether) – SEO plugin for Craft
- Field Manager (Verbb) – field management plugin for Craft
- oEmbed – oEmbed support for Craft
- Craft Vite – Vite integration for Craft CMS
- PHPStan – static analysis of PHP
- GitLab – CI/CD and deployment
- Dev Tools
Updating PHP version
- Change version in
composer.json. - Update the PHP version in the following files:
.lando.yml–config.phpandservices.appserver.type(if the Symfony recipe doesn't support the new version, you must override the appserver service withtype: php:X.X)setup_server.sh– 4 places.gitlab-ci.yml– 3 places (default image,SERVER_PHP_PATH, andphp-fpmservice name)php_cs.dist– add the new version or update the@PHP8#Migrationversion to match the current version.
- Run
lando rebuildto rebuild the Lando container with the new PHP version. - Run
lando composer updateorcomposer updateto update the PHP dependencies. If running locally without Lando, ensure your local PHP version matches the new version. - Update version in
README.mdandAGENTS.md.