Getting Started

Becoming a Contributor

To get started as developer or contributor to the Elentra Platform you are required to have:
  1. 1.
    An active GitHub.com account
  2. 2.
    An approved Elentra Contributor Agreement
  3. 3.
    A suitable developer workstation
You should also be setup with:
  1. 1.
    Access to our Slack Team at https://elentra.slack.com and the #developers channel
  2. 2.
    Access to our Jira tracker at https://elentra.atlassian.net
  3. 3.
    Subscription to our [email protected] and [email protected] mailing lists
While this documentation is intended to get you up and running as quickly as possible, you may still run into unforeseen corners of the stack. If you have questions then please reach out to us on Slack or the Developer mailing list. We won't bite.

Register with GitHub

If you do not already have an account on GitHub.com, or you would like a separate work-specific account, then please visit https://github.com and sign up for a new account.
Regardless of whether you would like to use your existing account or create a new one, it is important that you know your correct GitHub.com username and that have you provided your full name within the Your Profile > Settings section on GitHub. Failure to do this may result in delays of approval.
You must have two-factor authentication enabled for your GitHub account in order to join the ElentraProject GitHub organization.

Sign the Elentra Contributor Agreement

Before gaining access to our source code repositories you must review and sign an Elentra Contributor Agreement. This agreement provides fall-back legal protection for the Elentra Consortium relating to any potential contributions you may make.
Please sign the Elentra Contributor Agreement in Adobe Sign where you will be asked for your full name, the institution you belong to, your e-mail address, and your GitHub.com username. Once your contributor request has been approved you will receive an invite from GitHub.com to join the ElentraProject organization.
If we have not responded to your contributor request within 1 business day, or if there is an urgent request, please feel free to contact Matt Simpson directly for follow-up.

Your Developer Workstation

While there is no required workstation configuration for Elentra Platform development, there are a number of technologies used by Elentra Consortium developers that dramatically increase productivity and reliability, and promote consistency. The vast majority of these applications are available for macOS, Windows 10+, and Linux workstations.

Workstation Setup Tutorial

Elentra Developer Workstation Setup Tutorial 20211201

Docker

The elentra-developer Docker environment is a lightweight, developer-friendly, virtualization layer that should be used to provide a local development environment that closely mimics your production Elentra environment.
While you could install and configure your own local version of Apache, MariaDB, and PHP, this Docker environment is intended to expedite the setup process for most developers and provide a consistent developer experience across macOS, Windows, and Linux workstations.
Please note that you really only need to install one per category listed below.
Category
Software
macOS
Windows
Linux
Virtualization
X
X
X
SCM
Git
X
X
X
Git Client
X
X
Git Client ($)
X
X
X
MariaDB GUI
X
MariaDB GUI
DBeaver
X
X
X
Text Editor
X
X
X
API Client
Postman
X
X
X
JavaScript Runtime
Node.js
X
X
X
Visual Diff
X
X
X
Visual Diff ($)
X
X
Diagram Designer ($)
DbSchema
X
X
X

Installing Elentra

Prerequisites

1. Install the software stack

Make sure that you have completely installed the Highly Recommended Software Stack listed above, otherwise a lot of this won't make sense.
macOS
macOS users can enjoy an expedited Highly Recommended Software Stack setup by running the following commands in Terminal:
1
# 1. Install xCode command line tools:
2
xcode-select --install
3
4
# 2. Install Homebrew:
5
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
6
7
# 3. Install Highly Recommended Software Stack
8
brew install --cask docker \
9
sourcetree \
10
sequel-ace \
11
visual-studio-code \
12
postman \
13
meld
14
15
# 4. Install LTS edition of Node.js via Node Version Manager (NVM).
16
brew install nvm
17
nvm install --lts
18
19
# 5. Optional Recommended Commercial Software
20
brew install --cask araxis-merge \
21
dbschema
22
23
Copied!

2. Configure your hosts file

Warning: This step can be painful to explain to new developers, so please bear with us. On the plus side it will eventually go away thanks to a not-yet-approved RFC standard that has already been adopted by Google Chrome.
While Google Chrome will automatically route *.localhost DNS requests to your local host, other supported browsers such Firefox, Edge, and potentially Safari may not.
You should add the following Elentra Platform hostnames to your hosts file, and potentially other Branded Edition hostname's as well (e.g., medtech-1x-me.localhost).
1
# Elentra ME Institutional Fork
2
127.0.0.1 elentra-1x-me.localhost
3
4
# Elentra ME Branded Edition
5
127.0.0.1 ys-elentra-1x-me.localhost
6
7
# Elentra Admissions + CPD
8
127.0.0.1 elentra-1x-admissions.localhost
9
127.0.0.1 elentra-1x-cpd.localhost
Copied!
macOS/Linux
Windows
1
sudo vim /etc/hosts
Copied!
As an Administrator open C:\Windows\System32\Drivers\etc\hosts with Notepad.

3. Create an SSH key and add it to GitHub

If you do not already have a 4096 bit SSH key on your workstation then you will need to generate one. Using either Terminal or Git Bash on your host desktop, run:
1
ssh-keygen -t rsa -b 4096
Copied!
The defaults provided by ssh-keygen should be fine, including the default ~/.ssh/id_rsa storage location and an empty passphrase (providing your workstation is properly secured).
Next, you must add your SSH public key to your GitHub profile in the SSH and GPG keys section. Using either Terminal or Git Bash on your host desktop, run:
1
cat ~/.ssh/id_rsa.pub
Copied!
If you run ssh [email protected] from within Terminal or Git Bash and it fails to authenticate with GitHub, then you have a problem.
Please make sure your SSH Public Key (~/.ssh/id_rsa.pub) has been added to GitHub's SSH and GPG keys section before proceeding.

Clone from GitHub

The Elentra (Admissions, ME, and CPD) source code is obtained via Git source control management from GitHub once your access request has been granted.
Are you running Windows? Before you clone our repositories you must disable Git's autocrlf feature for automatically converting line endings. If you don't do this, your container will not start successfully.
Run the following within Git Bash:
git config --global core.autocrlf false

Repository #1) Elentra Developer Docker Environment

Using either Terminal or Git Bash on your host desktop, clone the elentra-developer repository into a directory within your home directory (e.g., ~/Documents).
1
cd ~/Documents
2
git clone [email protected]:ElentraProject/elentra-developer.git
Copied!

Repository #2) Elentra ME

Using either Terminal or Git Bash on your host desktop, clone the elentra-1x-me repository from your Institutional Fork into the ~/Sites directory, and add the Elentra Consortium as an additional Git remote.
1
mkdir ~/Sites
2
cd ~/Sites
3
git clone [email protected]:YourInstitutionalFork/elentra-1x-me.git
4
cd elentra-1x-me
5
git remote add consortium [email protected]:ElentraProject/elentra-1x-me.git
6
git fetch consortium
Copied!

Repository #3) Elentra API

Next, clone the elentra-1x-api repository into the ~/Sites directory:
1
cd ~/Sites
2
git clone [email protected]:YourInstitutionalFork/elentra-1x-api.git
3
cd elentra-1x-api
4
git remote add consortium [email protected]:ElentraProject/elentra-1x-api.git
5
git fetch consortium
Copied!

Repository #4) Elentra JS

Next, clone the elentra-2x-js repository into the ~/Sites directory:
1
cd ~/Sites
2
git clone [email protected]:YourInstitutionalFork/elentra-2x-js.git
3
cd elentra-2x-js
4
git remote add consortium [email protected]:ElentraProject/elentra-2x-js.git
5
git fetch consortium
Copied!

Start the Docker Environment

Start the Elentra Developer Docker environment by running the developer setup command within the elentra-developer Docker directory:
1
cd ~/Documents/elentra-developer
2
./developer setup
Copied!
That should be it. Installation of the initial container may take a little while, but when it's complete you can connect to the bash shell of your container by typing:
1
# Primary container:
2
docker exec -it elentra-developer bash
3
4
# Supporting containers:
5
docker exec -it elentra-mariadb bash
6
docker exec -it elentra-redis bash
7
docker exec -it elentra-phpmyadmin bash
Copied!
The following directories are automatically mapped for you in elentra-developer:
Host Directory
Container Directory
~/Sites
/var/www/vhosts
./elentra-developer/resources/services/elentra/etc/httpd/vhosts.d
/etc/httpd/vhosts.d
./elentra-developer/resources/scripts
/root/.bin
~/.ssh/id_rsa
/root/.ssh/id_rsa
Are you running Windows? Unfortunately, you're going to have an issue with that last one. To work around this Windows permissions issue you will need copy your SSH key into the container by executing the following commands within the container bash shell:
1
docker exec -it elentra-developer bash
2
3
rm /root/.ssh/id_rsa
4
cp /run/secrets/ssh_private_key /root/.ssh/id_rsa
5
chmod 0400 /root/.ssh/id_rsa
Copied!

Not using Docker?

If you are not using our Docker environment make sure that:
  1. 1.
    Your development environment meets the System Requirements
  2. 2.
    You have created the databases on your host database server, and also created a user account with privileges to these new databases.
    1
    CREATE DATABASE `elentra_auth` CHARACTER SET utf8 COLLATE utf8_general_ci;
    2
    CREATE DATABASE `elentra_admissions` CHARACTER SET utf8 COLLATE utf8_general_ci;
    3
    CREATE DATABASE `elentra_cpd` CHARACTER SET utf8 COLLATE utf8_general_ci;
    4
    CREATE DATABASE `elentra_me` CHARACTER SET utf8 COLLATE utf8_general_ci;
    5
    CREATE DATABASE `elentra_me_clerkship` CHARACTER SET utf8 COLLATE utf8_general_ci;
    6
    7
    CREATE USER 'elentra'@'localhost' IDENTIFIED BY 'password';
    8
    9
    GRANT ALL ON elentra_auth.* TO 'elentra'@'localhost';
    10
    GRANT ALL ON elentra_admissions.* TO 'elentra'@'localhost';
    11
    GRANT ALL ON elentra_cpd.* TO 'elentra'@'localhost';
    12
    GRANT ALL ON elentra_me.* TO 'elentra'@'localhost';
    13
    GRANT ALL ON elentra_me_clerkship.* TO 'elentra'@'localhost';
    Copied!
  3. 3.
    You have configured your Apache installation with the appropriate local virtual hosts.

Authenticate with Private Packagist

Authenticating your elentra-developer Docker container, and possibly your host computer as well, is necessary in order to install the dependencies used by the Elentra Platform.
As of Elentra Admissions 0.9, Elentra ME 1.13, and Elentra CPD 1.1 our Composer dependencies are managed and installed through a commercial service called Private Packagist - https://packagist.com. This service mirrors our dependencies from their original location and provides a reliable, redundant, and consistent dependency source for our deployment processes.
Once you have obtained your Institutional Authorization Token, please run the following command (replacing dcdeef40... with your actual token) within your Docker container:
1
docker exec -it elentra-developer bash
2
3
composer config --global --auth http-basic.repo.packagist.com token dcdeef40...
Copied!

Install the Composer Dependencies

  1. 1.
    Within your elentra-developer Docker container, ensure that you have the develop Git branch checked out and that you are up to date:
1
docker exec -it elentra-developer bash
2
3
cd /var/www/vhosts/elentra-1x-me
4
git checkout develop
5
git pull
Copied!
2. Optionally, if you have cloned the elentra-1x-api repository and want to use this development version instead of the production version, then create a new file named composer-api-dev.json in your elentra-1x-me root directory:
1
docker exec -it elentra-developer bash
2
3
cd /var/www/vhosts/elentra-1x-me
4
touch composer-api-dev.json
Copied!
Add the following lines to this new composer-api-dev.json file, if you have created one:
1
{
2
"repositories": [
3
{
4
"type": "path",
5
"url": "../elentra-1x-api",
6
"options": {
7
"symlink": true
8
}
9
}
10
],
11
"require": {
12
"elentrapackages/elentra-1x-api": "dev-develop"
13
}
14
}
Copied!
3. Install the Composer dependencies:
1
composer install
Copied!
4. Optionally, to use the local elentra-1x-api, use composer update just for that package and then reset changes to the composer.lock file:
1
composer update elentrapackages/elentra-1x-api
2
git checkout -- composer.lock
Copied!

Proceed to Browser

If all went according to plan you can now visit this local Elentra ME installation using Chrome, Firefox, Safari, or Edge to proceed with the web-based setup: http://elentra-1x-me.localhost

Deploying Elentra

Deployer provides a consistent and reliable methodology that lets you deploy and roll-back new releases to your servers from your command line or from a CI/CD server.
These instructions assume that you are running the Elentra Developer Docker Environment, and that you have a fully functional Branded Edition cloned to your ~/Sites/ directory.

Prerequisites

  • Elentra Developer Docker Environment

Deployment

1
# Connect to the shell within elentra-developer.
2
docker exec -it elentra-developer bash
3
4
# Change to your Branded Edition directory.
5
cd /var/www/vhosts/ys-elentra-1x-me/deployment
6
7
# To deploy to staging (i.e., deploy the ys/staging branch):
8
dep deploy staging
9
10
# To deploy to production (i.e., deploy the ys/production branch):
11
dep deploy production
12
13
# To rollback to the previous release:
14
dep rollback production
Copied!
Last modified 1mo ago