Read through the readme, and if you are stuck, don't hesitate to ask in either #frontend or #craft in Slack. If you have made some smart improvement to the tooling or setup of in your Craft project, please contribute to this starter by making a pull request.
- Clone, or download this repository
- If you haven't already install global dependencies for the craft-starter.
- Run
npm install
to install NPM dependencies. - Run
docker-compose up
to start three containers (details found in docker-compose.yml):- Apache Server, to mirror production environment.
- Redis, used for caching logins included so that we mirror production.
- Mysql, the database.
- It might/will take some time for the containers to finish building and there will be no complete message. So, just wait a bit until the text stops flowing and then go to
http://localhost:5000/admin
to install Craft.
When you have docker-compose running in one terminal window please open a second window where you run npm run dev
. This will start a process that will be building our frontend dependencies. Our build setup provides a localhost:3000 address that shows the same as localhost:5000 but also has livereloading.
Edit CSS and JavaScript in the /web/
-folder. Webpack will compile, transpile, minify it into the web
folder, ready for production. If you put files in the assets-folder, Webpack will handle those too (see file-loader).
The main.css
is built into web/dist/main.dist.css
and it injects vendor prefixes and inlines smaller static resources (icon fonts for example).
The file web/js/main.js
is built into web/dist/main.dist.js
, and it uses Babel, allowing you to both write ES6 as well as using a Node.js style if you prefer.
Both files are included in ./templates/_layout.twig
When you want to login into Craft you'll need to go to localhost:5000/admin, because localhost:3000 is just a livereloading proxy that can't handle logins.
If you have cloned this project, the git remote origin
is set to the craft-starter repository. Unless you're actually working on improving the craft-starter, you should set the remote origin
to your project repository.
- Remove the current
origin
withgit remote rm origin
- Add the new origin with
git remote add origin [email protected]:netliferesearch/repository-name
- Push to the new origin with
git push --set-upstream origin master
Press this button to deploy to Heroku and be sure to select Europe as the region to deploy to.
To learn more about what's deployed see the app.json
file.
Running npm run composer
will spin up a docker container with composer installed so that you do neat things like npm run composer update
without having composer nor php-extensions installed.
- Before buying a license. Uncomment license.key in the file .gitignore. This will allow you to commit the license file to the repository.
- Buy the license.
- Commit the file to the repository.
We usually use S3 on Amazon Web Services. Ask @kodepoeten about access to a bucket.
Perform the following steps in a terminal: You only need to do this once per laptop.
- Start by installing brew
- Run
brew install heroku
for Heroku command line - Run
brew install nvm
for Node version manager. - Run
brew install mysql
for the MySQL command line tools. - Run
brew cask install docker
for Docker.
Peow peow!
- Amazon S3: Craft CMS doesn't support bucket location Frankfurt because it uses a newer authentication method.
- Get to know this project's
webpack.config.js
anddocker-compose.yml
. - Inside your old project start a new git branch for upgrading. And then try to copy over the build setup for asset building and docker container setup. You should also compare general.php and .htaccess setups to see if there are lessons to learn from the more up to date craft-starter.
- Try, try, try until you get it right. Be methodical and commit your progress steadily within the upgrade branch. After some thorough testing you can merge your "upgrade" branch back into master.