fortytwo-studio/craft-cms-boilerplate

This is a boilerplate for Craft CMS

v2.0.1 2025-05-02 12:26 UTC

README

This is a boilerplate for a Craft 5 CMS install with a few plugins already installed, custom file structure, and some pages with nav and a footer.

Usage

Firstly you need to create a database on your localhost.

To set up the boilerplate, you can use composer:

composer create-project fortytwo-studio/craft-cms-boilerplate [path]
  1. Alternatively you can clone the repo: https://github.com/fortytwostudio/craft-cms-boilerplate
  2. Run composer install
    • The post-install-cmd hook will run the setup, db import, npm install and finally removes the post-install-cmd scripts
  3. Run npm install

ViteJS

ViteJs is utilised in the project to watch and build sass and js. Therefore you will need to have vite-cli installed to rebuild files. You can install it with node: npm install -D vite.

After that, just use npm run dev in the terminal to turn on the file watchers.

!! Before deploying changes to staging or production, make sure to run npm run build !!

Plugins installed

Bootstrap

Bootstrap is installed as a node module and is imported via:

  • CSS: @webroot/src/css/style.css
  • JS: @webroot/src/js/main.js

Splide (sliders)

Splide is installed as a node module and is imported and initialised in:
@webroot/src/js/libraries/splide.js

vanilla-lazyload (lazyload)

vanilla-lazyload is installed as a node module and is imported and initialised in:
@webroot/src/js/libraries/lazy-load.js

JQuery

JQuery is installed as a node module. Can be imported into JS files via:
import $ from 'jquery';

Dependencies