Search by

madebyshape / craft-cms

madebyshape

Package info

github.com/madebyshape/craft-cms

pkg:composer/madebyshape/craft-cms

Statistics

Installs: 640

Dependents: 0

Suggesters: 0

Stars: 112

Open Issues: 14

5.3.0 2026-11-30 17:18 UTC

README

Craft CMS 5 Starter

This is a Craft CMS 5.x starter that MadeByShape use internally for projects. We open sourced it so anybody can use it.

Contents

The Stack

Requirements

Features

  • Templates
    • Layout templates setup ready with header and footer globals
    • Exception templates for 404, offline/maintenance and generic errors
    • Page templates setup for use with matrix fields
    • Email template for sending prettier system emails (Forgot password etc)
  • Fields
    • Predefined fields for text, rich text, media, video, links and page building (See all)
    • Video field lets editors choose a file upload or a YouTube/Vimeo URL
    • Aspect Ratio field matches the Imager X named transforms
  • Config
    • Configs for all Craft CMS plugins
    • Customised general config with required features that hook into .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
  • Device Testing
    • Test on phones and tablets via Tailscale Share or Funnel
    • Vite dev server assets served through the tunnel
  • Branch Switching
    • Switch branches with isolated DDEV projects per branch
    • Automatic snapshots before switching
    • Auto pulls database from Servd when the new branch is empty

Plugins

Craft CMS

  • Blitz
  • CKEditor
  • Formie
  • Imager X
  • LLM Ready
  • Mailgun
  • Matrix Block Anchor
  • Minify
  • Retcon
  • SEOMatic
  • Servd Assets and Helpers
  • Craft Cloud Extension
  • Imager X Craft Cloud Transformer
  • Sprig
  • Vite

Install

Create an empty folder and cd to it in your terminal (if you plan to use Option 1 or 2).

1a. Option 1: Composer

If you have Composer installed locally, open your terminal and run:

composer create-project madebyshape/craft-cms

1b. Option 2: Git

You can clone the repo from GitHub using the Git CLI:

git clone git@github.com:madebyshape/craft-cms.git

1c. Option 3: Manual

Download a copy of this repo to your computer using the Code button above, and choosing Download ZIP. Move these files to your empty folder.

2. Start DDEV, Install Craft CMS and dependencies

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 install

3. Starting Vite

Once step 2 has successfully completed, start Vite for front-end tooling:

make dev

Production

When you're ready to go live, make sure you have npm installed on the server, then run the production command to minify, compress and build the front-end assets:

npm run build
# or
make prod

CLI commands

We've created a few commands to make development easier. All commands are run in your terminal:

Setup

Command Description
make help List all commands
make install Full install (DDEV, Craft CMS, npm)
make keys Generate Craft security keys
make npm-install Install npm packages
make setup Pull latest + install dependencies

Development

Command Description
make cms Open the CMS in browser
make dev Start Vite dev server
make kill-vite Kill Vite processes
make l / make launch Open site in browser
make logs Follow today's Craft logs (web, console, queue)
make mp / make mailpit Open Mailpit
make prod Build front-end assets for production
make start Start DDEV + Vite
make switch-branch <name> Switch branch with isolated DDEV project
make urls List all URLs (site, CMS, Vite, Mailpit, database)

Craft

Command Description
make up Apply project config + migrations
make update Update Craft CMS + plugins
make update-search-index Rebuild search index

Database

Command Description
make export-db file=... Export the database to backups/ (file optional)
make import-db file=... Import a SQL dump
make pull-db Pull remote database (Servd)
make restore name=... Restore a snapshot (latest if no name)
make snapshot name=... Take a DDEV database snapshot (name optional)
make snapshots List DDEV database snapshots
make tp / make tableplus Open TablePlus

Sharing

Command Description
make funnel Share site via Tailscale Funnel (public)
make share Share site via Tailscale (private)

Maintenance

Command Description
make clean Reset vendor + node_modules
make clean-logs Clear log files

Fields

Fields included in the project config, ready to add to entry types.

Page building

Field Handle Type Notes
Blocks blocks Matrix Page builder used by the Page Blocks entry type
Block Anchor blockAnchor Matrix Block Anchor Name a block so it can be linked to with #name
Padding padding Dropdown Top & Bottom, Top, Bottom or None

Text

Field Handle Type Notes
Heading heading CKEditor
Text text Plain Text Single line
Text - Multiline textMultiline Plain Text Multiple lines
Text - Code textCode Plain Text Monospaced, for embed codes and snippets
Rich Text - Simple richTextSimple CKEditor Headings, bold, italic and links
Rich Text - Full richTextFull CKEditor Simple plus underline and lists
Rich Text - Longform richTextLongform CKEditor Full plus tables, embedded entries and source editing

Media

Field Handle Type Notes
Image image Assets One image, from the Images volume
Images images Assets Multiple images, from the Images volume
File file Assets One file, from the Files volume
Aspect Ratio aspectRatio Dropdown Values match the named transforms in config/imager-x-transforms.php
Video video Content Block Video - Source, Video - File or Video - URL, Video Thumbnail and Aspect Ratio
Video - Source videoSource Button Group File or URL. Shows Video - File or Video - URL to match
Video - File videoFile Assets One MP4 under 10MB, from the Videos volume
Video - URL videoUrl Link YouTube or Vimeo URL

Links

Field Handle Type Notes
Link / Button linkButton Link Entry, URL, asset, category, email or phone, with a label
Link / Button - No Label linkButtonNoLabel Link Entry or URL, without a label
Email email Link Email address
Phone phone Link Phone number

Other

Field Handle Type Notes
Date date Date
Form form Formie Forms Pick a Formie form
Lightswitch - On lightswitchOn Lightswitch On by default
Lightswitch - Off lightswitchOff Lightswitch Off by default
SEO seo SEOmatic Per-entry SEO settings

Nice to know

Switching branches

When you need to work on a different branch without disturbing your current DDEV database, use:

make switch-branch <branch>

This snapshots the current branch's database, stops the project, checks out the target branch, and spins up an isolated DDEV project named <project>-<branch> (using .ddev/config.local.yaml). If the new branch's database is empty, it's automatically pulled from Servd. Switching back to master or main removes the local config and returns to the default project.

Device Testing with Tailscale

You can test your local site on other devices (phones, tablets) using Tailscale. This gives you a real HTTPS URL that works on any device.

  • Tailscale installed and running on your Mac (the standalone or Homebrew version, not the Mac App Store version)
  • Funnel requires HTTPS certificates and the funnel node attribute enabled in your Tailscale admin console

The Tailscale commands (see CLI commands) automatically register the Tailscale hostname with DDEV's router and expose the Vite dev server so CSS/JS assets load correctly on remote devices. You'll need two terminals: one for the Tailscale tunnel and one for Vite.

File system type

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=local

Database

To 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 tp

Email

Locally, all outgoing mail is caught by Mailpit instead of being delivered, so password resets, Formie notifications and the like are safe to test. This is set in the dev block of config/app.php, which overrides Craft's mailer to send over SMTP to Mailpit (MAILPIT_SMTP_HOSTNAME / MAILPIT_SMTP_PORT in .env); edit that block to change or disable it. View caught mail with ddev mailpit (or make mp).

Note: The CP Settings → Email → Test button bypasses this override and uses your real (Mailgun) settings, so it errors locally. To send a test through Mailpit, run ddev craft mailer/test instead.

HTTPS recommended

There are 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

License keys

Plugin license keys are never committed. A pre-commit hook (.githooks/pre-commit) replaces any licenseKey in config/project/*.yaml with null, both in the commit and in the YAML file itself. Environment variable references (e.g. $BLITZ_LICENSE_KEY) are kept.

The same hook also raises the Craft CMS edition (system.edition) from Solo to Team, so a fresh local install never gets committed as Solo. Projects upgraded to Pro or Enterprise are never downgraded, and plugin editions are left alone.

The hook is enabled automatically by composer install. To enable it manually, run:

git config core.hooksPath .githooks