This Sulu CMS skeleton is the perfect way to decrease your initial setup time drastically!
- PHP 8.2
- MariaDB 10.8.2
- Symfony 6.3
- Sulu 2.5
- Node 18
- Webpack Encore
- Typescript
- Bootstrap 5
- Bazinga Translator
- LuxonJS
- Axios
- Vanilla Cookieconsent
- Ansible Deploy Playbook
- Docker >= v20
- NVM.sh (If you don't have it, just run
make install-nvm
in your project root) - Gas Mask
- In your project root, open the
.env
file and set all parameters to your liking. - If you change the database name or password, you'll have to change that in
application/.env
as well. See parameterDATABASE_URL
. - Go to
application/config/webspaces/default.xml
and make a few changes:- Rename the file to customize the webspace name. (e.g. mycompany.xml)
- Open the file and change
<name>
to some label and set<key>
to the same value as the file name. (Marked with TODO) - Scroll down and look for "portals". You'll see one domain for each environment. Set the local domain to the same as you set in your .env file before.
- Run
make setup
to initialize the database, build the backend and the frontend.
This skeleton already contains an Ansible Playbook for deployment. You'll have to customize a few things to use it:
- Under
ansible/hosts
, set your server name, ssh user and key path. - In
ansible/deploy-prod.yml
make the following changes (marked with TODO):- Set the base_dir and sulu_storage according to your server setup (sulu_storage should match the path in your .env.prod).
- Set your user:group & your httpd / Apache / Nginx etc. user in the permissions section
- All the way at the bottom, you see the opcache reset tool. It is recommended to use it on deploy, as the Opcache can be quite stubborn to clear. If you'd like to use it, get it from here: https://github.com/gordalina/cachetool
If your project is set up and you'd like to continue your work, simply run make up
to start the containers.
The frontend lives in application/assets/website
. Folder explanations:
fonts
Font files (woff / ttf / etc.)images
SVGs / static images to be included by SCSS / Inline SVGmodules
If your Sulu module needs JS, it should go here. Styles that only concern this specific module belong here too.scss
Styles go here.bootstrap
Configuration & Customizationfonts
Font-Face style definitions for the font files mentioned abovemixins
SCSS mixinspartials
Repetitive SCSS goes here to be included elsewhereapp.scss
Entry point. You should not put styles here.variables.scss
Contains SCSS variables to be globally available in all SCSS filesinject.scss
As the name implies, this file is injected into every SCSS file while building to make SCSS variables and mixins publicly available. WARNING Do not put anything in here that produces CSS output (anything but mixins & variables). This will increase your frontend size significantly!
utils
Contains helper scripts / libraries / methods, e.g. translate(), which can be used to retrieve translations from the backendapp.ts
The entrypoint, you'll need to include your scripts / modules here to be loaded.
nvm install
This can be used as well asnvm use
. The difference: It installs the version if missing.npm install
npm run watch
ornpm run dev
(single-time dev build) ornpm run build
(prod build)
make bash
starts a bash inside the PHP container, for running symfony commands etc.
make composer-install
runs composer install inside the PHP container.
The frontend comes with a svg-inline plugin. Use it to include SVGs into your stylesheets, as data urls:
@include svg-load(my-icon-black, 'website/images/icon-black.svg');
@include svg-load(my-icon-white, 'website/images/icon-black.svg') {
path {
fill: $color-white /* You can change colors on the fly! */
}
};
.icon-black {
background-image: svg-inline(my-icon-black);
}
.icon-white {
background-image: svg-inline(my-icon-white);
}