This is the wirelab (wirecraft) boilerplate for all our Craft CMS projects.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Before installing you need the following software installed on your local machine:
- Composer (link)
- MySQL Server
- NodeJS (v14 LTS)
- PHP (7.4+ LTS)
git clone https://github.com/wirelab/wirecraft.git [projectname]
cd [projectname]
into the project- Create database using your favorite DBMS like Sequel Pro or MySQL Workbench or use the commands below.
mysql -u [username]
(add-p
if you have a password)create database [database-name];
- Create brand new git
rm .git
git init
git branch -m develop
- Create git repository on github
git remote add origin <url>
git push origin develop
- Run
composer install
- Run
npm install
- Setup the environment file
- Run
cp .env.example .env
to create the environment file.
- Run
- Run
./craft setup
- Can't run craft on MacOS? Make it an executable file:
sudo chmod +x craft
- Use as CMS username:
wirelab
- Generate a password using 1password or another password generator
- Can't run craft on MacOS? Make it an executable file:
- Run
npm run serve
and wait until it opens in your browser- It is normal to see a
HTTP 404 – Not Found – yii\web\NotFoundHttpException
, we need to setup the backend first.
- It is normal to see a
Then, we need to install all the plugins we use into your new project.
- Go to
http://localhost:1423/admin
and login using your credentials you set up earlier. - Click
Settings > Plugins
- Install all plugins
- Go to
Settings > Sections
and create a section calledHome
if it doesn't exist yet, link it to a template such aspages/_home
and set it as the default homepage.
To setup the rest of your project, checkout the Tutorials
Some usefull tips to debug in templates:
{{ dump(_context) }}
{{ dump(_context|keys) }}
{{ dump(myProductQuery.rawSQL()) }}
If you ever lose the overview of what template is used at what url, you can use this snippet in each template to show the template name as a regular html comment.
{% if craft.app.config.general.devMode %}
<!-- Template: {{ _self }} -->
{% endif %}
When encountering issues while setting up, or later on in the project, please checkout the wiki page with Known Issues.
Run npm run production
if you are ready for production, this will minify the javascript and css files.
deploying craft applications using GIT
craft cms project standards
This list is a list of plugins we regularly use for different purposes. It is preferable to stick to one of these plugins whenever you can.
- Navigation
- Page Parts
- SEO
- Forms
- Debugging
* Payed plugins
- Craft CMS (clean install)
- Basic folder structure
- Src folder with JS, TS and SCSS
- Starting files (
app.scss
/app.js
/index.ts
) - Standard mobile mixin ( already includes in
app.scss
) - Layout folder with
_master.twig
file, which contains basic layout file ( css and js includes aswell as seo plugin )
- Craft Plugins
- SEO
- Redactor
- Laravel Mix (for compiling css and js)
- ES6 functionality
- SCSS
- Copying static assets ( standard fonts and icons )
- Live server with hot reload (browsersync)
By Wirelab