Slide 1

Slide 1 text

Boilerplates to Accelerate Development Sean Smith

Slide 2

Slide 2 text

Who am I? • Solo developer https://caffeinecreations.ca • Website 101 Podcast https://website101podcast.com • Toronto Craft Slack https://caffeinecreations.slack.com/ • Photography Enthusiast https://vero.co/createsean

Slide 3

Slide 3 text

Overview • What is a boilerplate? • What to include and exclude • Documentation • Using Packagist

Slide 4

Slide 4 text

What is a Boilerplate? • Boilerplate is code or configuration that can be used over and over in order to save time. • It’s a template for your site building process • DRY

Slide 5

Slide 5 text

cuts out the repetition, I wouldn't make the salt and pepper for a recipe Kevin Nicholson - Freelancer

Slide 6

Slide 6 text

Utilizing a Craft CMS boilerplate for our web projects streamlines the development process and provides a solid foundation to build from. More importantly, it allows our team to focus on creating unique designs while expediting project timelines and enhancing overall workflow efficiency. Ashleigh – Project Manager

Slide 7

Slide 7 text

My Motivation • Tired of recreating the same configurations and settings over and over • Frustrated with opening different sites to crib code or settings • Save time – several hours at the beginning of a project

Slide 8

Slide 8 text

The Goal • The goal is to save you time when starting a new project. • DRY – code, config, channels, & fields

Slide 9

Slide 9 text

What to Include • Build process Vite, Laravel Mix, etc.. • Common site elements such as navbar, news section, homepage, contact page, etc • Content builder with common block types such as copy, video embed, related entries, slider • Hero options slider, basic, enhanced

Slide 10

Slide 10 text

What to Include • Plugins commonly used on every site you build CKEditor, Retcon, SEOmatic, Sprig, Knock Knock • Developer QOL plugins such as: Asset Rev, Environment Label, Control Panel CSS • Templates multiple options prebuilt and just uncomment. i.e. A standard navbar with dropdowns or an off-canvas menu

Slide 11

Slide 11 text

What to Exclude • Fields and sections that are likely to be one offs • Advanced Functionality multifaceted search, complex forms • Plugins that you do not use on every site For example Google Maps,

Slide 12

Slide 12 text

Documentation • Documentation Important to keep this updated • Code – include examples to help get set up or instructions for something that may not be obvious • Open to the public Be verbose and write even more documentation

Slide 13

Slide 13 text

Packagist • https://packagist.org • Useful if you want to make it easy for anyone to install with one line of code. • Running the create command will install vendor packages • Without packagist you can clone and do a few extra steps.

Slide 14

Slide 14 text

Packagist • You can also have the dotenv created and run craft commands as part of the install process. Add the following to the scripts section of your composer.json file. "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php craft setup/security-key", "@php craft setup/app-id" ] }

Slide 15

Slide 15 text

Unseen Advantages • Conventions set standards and best practices • Accessibility prebuilt components are accessible • Documentation easy to onboard other developers

Slide 16

Slide 16 text

Disadvantages

Slide 17

Slide 17 text

Demo • Launch Demo • View starter github

Slide 18

Slide 18 text

Website 101 Podcast Podcast Episode about boilerplates https://tinyurl.com/boilerplates-for-web

Slide 19

Slide 19 text

My Boilerplate https://github.com/CreateSean/craft-starter One command – requires setting up packagist composer create-project createsean/craft-starter .

Slide 20

Slide 20 text

Get Started • Use my starter • Search Packagist and use another starter • Fork a starter and customize to your liking • Build a new starter from scratch

Slide 21

Slide 21 text

Resources • https://packagist.org • https://website101podcast.com • https://caffeinecreations.slack.com/ • https://github.com/CreateSean/craft-starter