The PERLS Web application contains the Learner web app, CMS, and a REST interface to drive data to and from the mobile application. The system is built on Drupal 9 and uses Docker containers to run services for easy configuration and deployment.
Ensure all the requirements are met and follow the install instructions to get started.
There are a few ways to deploy PERLS, but the simplest way would be to just use Docker and configure a non-root user.
Assuming you are on an Ubuntu 20+ machine with Docker and Docker-Compose installed:
- Download the Starter Content
git clone https://github.com/adlnet/perls
cd perls
- From the Starter Content, add the
files
folder anddb_backup.sql
to the project root cp .env.example .env
and configure your.env
file (see below)./scripts/build.sh -l -n
docker exec PERLS_php ./scripts/styles.sh
Once everything's up, the default login is just:
username: admin@example.com
password: password
and it should be accessible at perls.localhost:8000
.
Standing up a development environment is a bit more involved and requires things to be installed locally on your machine.
- Docker
- Composer
- PHP CodeSniffer
- Port 8000 (development) or port 80 (production) and 3306 must be available
The fastest way to set up your development environment is to have a starter database (i.e. synced from a staging environment).
After completion, you can reach your local environment at: http://perls.localhost:8000
Your working directory must contain a db_backup.sql
file.
./scripts/build.sh -l -n
You can still run the build script without a starter database. In this instance, Drupal will attempt to build the site from scratch and then save the database to db_backup.sql
(to save time on future builds). This will take a long time.
./scripts/build.sh -l
You can also define a stage
drush site alias and build your local development environment from an existing remote environment.
See the drush documentation on creating a site alias. With the site alias defined, you can execute:
./scripts/build.sh
If your staging environment requires an SSH key, you can place that in .ssh
.
The development environment is built by default when using the given .env
and build script.
If these have been modified, ensure the environment variable PROJECT_ENV
is set to dev
.
This allows certain modules and configurations to be installed which improve quality of life when developing.
PROJECT_ENV
DB_HOST
- Database host name. Default value ismariadb
DB_NAME
- Database name. Default value:drupal_perls
.DB_PASSWORD
- Database password. Default value isdrupal
.DB_HOST_PORT
- Database port. Default value is3306
.DB_USER
- Databse user. Default value isdrupal
.DB_DRIVER
- Database user. Default value ismysql
.SMTP_HOST
- SMTP server host name. Default value ismailhog
.SMTP_PORT
- SMTP server port. Default value is1025
.SMTP_FROM
- Sender email address. Default value isperls@dev.local
.
There are some service what you can configure from .env file.
LRS_HOST
- Host name of the LRS serverLRS_USERNAME
- Account nameLRS_PASSWORD
- Password of LRS accountFIREBASE_SERVER_KEY
- Server key for firebase service, which sends out push notifications.FIREBASE_SENDER_ID
- Served ID of firebase.UNSPLASH_APP_NAME
- Account name of unsplash free image service.UNSPLASH_ACCESS_KEY
- Access key of unsplash service.
SSO
SIMPLESAML_AUTH_SOURCE
- This key will store the authentication source configSIMPLESAML_CONFIG_DIR
- Where uploaded IdP metadata is storedSIMPLESAML_SSO_SP_METADATA_FILE
- Mame of the Service Provider metadata file downloaded from the web interface
docker exec PERLS_php ./scripts/styles.sh
Xdebug can be enabled by setting the ENABLE_XDEBUG
environment variable to true
on the PHP container in docker-compose.yml
and restarting the stack.
See Troubleshooting
This project has behat feature tests. They are best run from inside the PHP docker container. This can be achieved by running:
./scripts/test.sh
Code should be readible, portable, and standardize. Since the web application is based on Drupal, all custom code should be placed in the appropriate locations (either theme/custom or modules/custom). Changes should not be made to Drupal Core so other releases of Drupal can be easily updated.
The code should follow Drupal's coding standards which can be enforced with PHPCodeSniffer.
A good place to start writing a custom module in order to change/update functionality of Drupal, follow the Drupal documentation Creating custom modules. It contains a code skeleton, naming standards, and other information to get started.
When developing, follow the contribution guidelines and Drupal's guidelines.
See Maintenance
See Security
Created by Float. For more information, contact them at info@gowithfloat.com