myth-digital / craft-3-stack
Craft CMS
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Language:Twig
Type:project
Requires
- ext-gd: 7.3.27
- clubstudioltd/craft-asset-rev: 6.0.2
- craftcms/cms: 3.6.11
- craftcms/redactor: 2.8.5
- doublesecretagency/craft-cpcss: 2.3.0
- nystudio107/craft-minify: 1.2.10
- nystudio107/craft-seomatic: 3.3.37
- putyourlightson/craft-blitz: 3.8.0
- sebastianlenz/linkfield: 1.0.25
- spacecatninja/imager-x: v3.4.0
- vaersaagod/dospaces: 1.1
- verbb/default-dashboard: 1.0.8
- verbb/super-table: 2.6.7
- vlucas/phpdotenv: 2.4.0
This package is auto-updated.
Last update: 2025-03-14 10:49:04 UTC
README
This is a Craft CMS 3.x and Craft Commerce 3.x boilerplate Myth Digital use internally for projects. Originally inspired by Made By Shape Craft 3 boilerplate.
Requirements
- PHP 7.3+
- Composer 2.x.x
- Node 14.x.x
Install
composer create-project myth-digital/craft-3-stack
- Don't run,
./craft setup
, instead copy and edit the.env.example
file. - Once the
.env
is completed, run./craft install
- Generate the security key using
./craft setup/security-key
With Commerce
Follow the steps below to set up Commerce with your stack.
- Replace newly created config/project with config/project-stack-commerce folder
rm -rf config/project && mv config/project-stack-commerce config/project
- Run the project sync command to sync the db config
./craft project-config/apply
- Copy fallback images into dist folder.
cp src/images/* public/dist/images/
- Update templates directory whatever you wish your URL to be. Default is /shop.
[] To Do - Add better solution for fallback images
Settings / Globals
Some settings are required post-install in order to finalise setup.
- Enable VueJS in
Globals > Site
(Required for Commerce) - Update Shop Path global in
Globals > Commerce
. This should match the path of your templates directory. Ensure you use a forward slash before and after. For example:/shop/
. If you wish to have the shop at root level, just enter a forward slash/
.
Without Commerce
The stack ships default with Commerce.
- Replace newly created config/project with config/project-stack folder
rm -rf config/project && mv config/project-stack config/project
- Run the project sync command to sync the db config
./craft project-config/apply
- Run the removal script below to remove all of the commerce files.
[] To Do - Build script
npm Scripts
npm run dev
Your go to for local development
npm run prod
Generates production assets (Minify, favicon etc). Perfect for running on server.
npm run setup
If project already exists, this will pull, migrate and apply project config and run dev tasks
Whats included
- Craft CMS 3.x
- Craft Commerce 3.x
- CSS
- Javascript
- Templates
- Blocks
- Components
- Pages (With dynamic page types)
- Exceptions
- Plugins
- Freeform
- Config
- Customised
.env
file - Customised
general.php
- Project Config (Using
config/project.yaml
) - Plugin configs:
- Asset Rev
- Blitz
- Freeform
- Imager X
- Minify
- SEOMatic
- Customised
- Plugins
- Asset Rev
- Blitz
- Default Dashboard
- Imager X
- Link Field
- Minify
- Redactor
- SEOMatic
- DO Spaces
- CP CSS
- Super Table
- Webpayments
- Commerce Widgets
- Stripe
- Extras
- Scripts (To pull assets, db etc from different environments)
- .gitignore
- Packages
- SASS
- Javascript
- OS Files
- Craft CMS
- Caching
- Asset Source Folders
- Log files
- Editor directories and files
Terminology
Components
Components are small bits of a template, e.g. a button, input field that then either make up a block or a full template. Use the components
folder and name each component file by it's use case e.g. inputField.twig
.
Make sure to describe each component at the top of each component file so other developers know how it is used. If the component accepts any attributes, make sure you include a description of these at the top of each component (Camel Case) file (See the components/_example.twig
) file.
Blocks
Blocks are large chunks of markup, or made up of smaller components. E.g. a block could be a form, with button and input field components included. Use the blocks
folder and name each component file (Camel Case) by it's use case e.g. largeForm.twig
(If a SASS file exists for a block, use the same file name).
Blocks ideally should be selectable via a Matrix Field so CP users can pick and choose these per template. In some cases this might not be possible though, e.g. if the page is dynamically generated.
Roadmap
[] Add Google Workbox [] rel="preload" fonts via a Webpack task [] Move some Twig components in to VueJS