This is a Craft CMS 5.x starter MadeByShape use internally for projects, that we open sourced so anybody can use it.
- Craft CMS 5.x Content management system
- DDEV Local development environment
- Vite 5.x Front end build tool with HMR
- Tailwind CSS 4.x Utility-first CSS framework
- Alpine.js 3.x Minimal JS framework
- Mailgun Email API
- Servd Craft CMS first hosting provider
- Craft Cloud Craft CMS hosting provider
- Templates
- Layout templates setup ready with header and footer globals
- Exception templates for 404, offline/maintenece and generic errors
- Page templates setup for use with matrix fields
- Email template for sending prettier system emails (Forgot password etc)
- Config
- Configs for all Craft CMS plugins
- Customised general config with required features that hook in to .env vars
- Env
- Customised .env file with Servd and Mailgun included
- Building
- HMR
- CSS and JS minified and purged
- Favicon is generated and auto inserted into the template
- Images compressed
- Sourcemaps generated
- Servd
- Setup to be used with Servd hosting platform
- Enabled for using static caching
- Craft Cloud
- Setup to be used with Craft Cloud hosting provider
- Enabled for using artifacts with Vite JS and Imager X
- Caching
- Uses Blitz to handle server caching and warming
- Blitz
- CKEditor
- Formie
- Imager X
- Mailgun
- Minify
- SEOMatic
- Servd Assets and Helpers
- Craft Cloud Extension
- Imager X Craft Cloud Transformer
- Sprig
- Vite
Create an empty folder and CD to it in terminal (If you plan to use Option 1 or 2).
If you have composer installed locally, open terminal and run:
composer create-project madebyshape/craft-cmsYou can clone the repo from Github using Git CLI:
git clone git@github.com:madebyshape/craft-cms.gitDownload a copy of this repo to your computer using the Code button above, and choosing Download ZIP. Move these files to your empty folder.
Firstly, edit .ddev/config.yaml and change the name to your project name.
Then, there are a few CLI commands (See more) we've created that allow starting DDEV, installing Craft CMS and installing dependencies (Node particularly). The one to get you started:
make installOnce you've followed step 2 and it's successfully ran through the steps, you'll need to start Vite which allows you to start using front end tooling:
make devWhen you're ready to go live, make sure you have npm installed on the server, then you can run the production command to minify, compress and build the front end assets:
npm run buildWe've create a few commands to make development easier. All these commands are ran in terminal:
| Command | Description |
|---|---|
make install |
Starts DDEV, Install Craft CMS and dependencies. |
make setup |
Use when starting to work on your project especially if your working in a team. |
make start |
Starts DDEV and Vite development process. |
make dev |
Starts Vite development process. |
make prod |
Run on production to start Vite build process - minify, compress etc. |
make clean |
Removes composer and node files ready for a clean install. |
make clean-logs |
Removes log files from /storage/logs for easier debugging. |
make update |
Smaller command that runs ddev exec php craft update all. |
make up 💅 |
Runs project config apply and migrations apply. |
make pull-db |
Pulls a database dump from a remote Servd environment into the local database. |
make tp |
Launches tableplus |
make l |
Launches the site |
make keys |
Adds APP_ID and SECURITY_KEY keys to .env |
make update-search-index |
Updates the search index for the project. |
The file system type is set in the .env file. It can be set to either local, servd or craftCloud depending on where you are hosting your project. local is good for local and also production if the files are hosted on the same server.
FILESYSTEM_TYPE=localTo access the database inside the DDEV environment, you can use TablePlus. You can use the following command to open TablePlus to export/import:
ddev tableplus
or
make tpThere is a few issues getting Vite, DDEV and Craft CMS running nicely together over HTTP, so always make sure you are using HTTPS. For DDEV just run:
ddev stop --all
mkcert -install
ddev start
ddev launch