The repository is moved to https://github.com/WorldHealthOrganization/step-by-step-digital
Step By Step is a Drupal distribution for an evidence based support program for people with depression and stress.
User documentation can be found in the docs/
folder.
- Composer
- PHP 7.4+
For more details, check Drupal 9 system requirements.
This is the quickest way to setup Step By Step project.
Run the command below to create a new Composer project for Step By Step.
composer create-project systemseed/stepbystep-project stepbystep --stability=dev --repository="{\"url\": \"git@github.com:systemseed/stepbystep-project.git\", \"type\": \"vcs\"}"
During installation, you may be asked for a GitHub auth token. Follow Composer instructions to generate GitHub token and provide it when asked by Composer installer.
Install your Step By Step site like any other Drupal website using the install.php script or drush.
Example Drush command:
drush site:install stepbystep --account-name=sbssuperadmin --site-name="Step by Step" --yes
You can add Step By Step into another Composer file (for example, the one
generated by drupal/recommended-project
).
Ensure all required repositories are addded in the repositories
array. You can
find up-to-date list in composer.json of the template project.
Ensure minimum stability of your composer project is set to dev
:
composer config minimum-stability dev
Require Step By Step profile package:
composer req systemseed/stepbystep:"^9.0.1"
Install your Step By Step site like any other Drupal website.
The profile comes with preconfigured development mode for quick testing on dev
environments. The development mode is powered by config_split
module.
To enable development mode, you need to perform the following steps.
Install devel_php
:
composer req --dev drupal/devel_php
Enable development config split and test users by adding the following lines in settings.php:
$settings['config_sync_directory'] = '../config/sync';
$config["config_split.config_split.development"]["status"] = TRUE;
Export your current configuration in ./config/sync
:
drush config-export
Copy preconfigured config splits into your config folder:
cp -r web/profiles/contrib/stepbystep/config/split config/
Clear cache, run config import, run cron:
drush cr
drush config-import
drush cron
The development mode enables:
- Quick registration with dev+YOURNAME@whostepbystep.oeg email addresses
- Test users for each existing role with password set to
stepbystep
:
Before running the site on production the following configuration must be reviewed:
- SMTP settings for sending emails (/admin/config/system/smtp)
- Twilio (or other) SMS gateway (/admin/config/smsframework/gateways/twilio)
- Score levels that a user has to reach to be offered an E-helper (/admin/content/questionnaires/ehelper)
The update process for each release should be first tested on non-production environment.
Update codebase using Composer:
composer update --with-all-dependencies systemseed/stepbystep
Apply database and config updates:
drush updatedb
Review Update helper checklist (/admin/config/development/update-helper). Export active site configuration in files and review changes. You may want to skip some updates if your Step by Step installation is customised.
Step by Step installation profile doesn't come with composer.lock
file, so you
can update patch versions of Drupal core without updating the entire profile.
Example:
composer update --with-all-dependencies drupal/core-recommended drupal/core-composer-scaffold drupal/core-project-message
To develop the profile on your development environment, install the package from source:
composer req systemseed/stepbystep:"9.x-dev" --prefer-source
PHP code should pass PHPCS checks:
phpcs --standard=Drupal --ignore=node_modules,vendor,dist,js,*.md .
New configuration should be put in profile's config folder.
Configuration changes should be organised in Drupal update hooks using the Update helper module. Follow instructions for distributions provided by the Update helper module.
To contribute to the frontend and to Material SBS theme, Node.js is required.
Go to the frontend app folder:
cd modules/sbs_application/js
Download dependencies:
npm install
Disable CSS/JS preprocessing in Drupal and start "watch" mode to make changes and see them on page refresh:
npm run watch
When the changes are ready, run linter and fix any found issues:
npm run format
npm run lint
Build the final JS assets:
npm run build
The development process is the same as for the frontend app.
Go to the theme folder:
cd theme/material_sbs
Download dependencies:
npm install
Disable CSS/JS preprocessing in Drupal and start "watch" mode to make changes and see them on page refresh:
npm run watch
Build the final JS assets:
npm run build
Circle CI installs clean Drupal from Composer template, runs code checks and basic tests to ensure the distribution can be installed.
See .circleci/config.yml
file for details.
Major Step By Step release versions match supported Drupal core version, e.g. 9.0.0 release is compatible with Drupal 9.
Minor and patch versions should be released using Semantic Versioning.
To make a new release:
- Test the upgrade path and document it in CHANGELOG.md.
- Make sure CI build is green (all automated checks should pass).
- Make sure CHANGELOG.md is up-to-date with all introduced changes.
- Create a new tag in git and crete a new release in Github.