Skip to content

systemseed/stepbystep

Repository files navigation

CircleCI

The repository is moved to https://github.com/WorldHealthOrganization/step-by-step-digital

Step by step self help intervention

Step By Step is a Drupal distribution for an evidence based support program for people with depression and stress.

User documentation

User documentation can be found in the docs/ folder.

Installation

Requirements

  • Composer
  • PHP 7.4+

For more details, check Drupal 9 system requirements.

Installing from Composer template

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

Installing into another Composer project

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.

Enabling development mode (NOT FOR PRODUCTION!)

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:

Configuration

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)

Update

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.

Applying updates to Drupal core

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

Contribute

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.

Frontend app

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

Material SBS theme

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

CI

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.

Releases

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:

  1. Test the upgrade path and document it in CHANGELOG.md.
  2. Make sure CI build is green (all automated checks should pass).
  3. Make sure CHANGELOG.md is up-to-date with all introduced changes.
  4. Create a new tag in git and crete a new release in Github.

About

Step By Step Drupal installation profile

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •