The goal of this project is to provide a fully working "boilerplate" (empty skeleton project) using the CraftCMS project.
To start a CraftCMS project with this Boilerplate, simply:
Use the Composer create-project command to install the boilerplate:
composer create-project --prefer-dist locomotivemtl/craft-boilerplate acmeCopy the .env.example.dev file to .env:
# Move into your project's directory
cd acme
# Setup valet to use PHP 8.2 only for this project
valet isolate --site acme 8.2
# Install the dependencies
valet composer install
# Run the valet installer.
valet php craft install
# Enable the Vite plugin
valet php craft plugin/install vite# Move into your project's directory
cd acme
# Start DDEV
ddev start
# Install the dependencies
ddev composer install
# Run the valet installer.
ddev craft install
# Enable the Vite plugin
ddev craft plugin/install viteDDEV is already setup to run Vite when the container is started.
Vite is a fast, modern build tool that speeds up development with instant hot reload and simplifies production bundling using native ES modules.
Add vite configurations to .env file
VITE_SERVER_URL="http://localhost"
VITE_SERVER_PORT=5173
# Make sure to set the environment to 'dev'. Otherwise, Craft won't be looking for the Vite server.
CRAFT_ENVIRONMENT=devnpm installStart your Vite server
npm run devVisit your project locally http://acme.test
PHP 8.2+ext-jsonext-pdoext-splext-mbstring
A couple of tips have been documented here in docs/development-tips.md. Take a look at them before you begin!