A new, laravel-ly application that allows users to check if they have blocks on their college account.
This application serves as a simple front end for the Data API, pulling data from the student
endpoint.
This project requires access to the following resources:
- Access to the BC Data API
- SimpleSAMLphp must be installed and configured on the same server on which this project is installed.
- Globals v3.x must be available locally
Note: Symfony HTTP Foundation version 4.4 and above break SimpleSAMLphp integration. To prevent this from breaking, the version is pegged to ~4.3.8 in composer.json; when this issue is fixed, this dependency should no longer be specified.
Using Laravel's Homestead VM is a great way to get this up and running in a local environment.
You can also use Laravel's php artisan serve
command, but I have not found a good way to make Globals load properly, so you may need to find workarounds to get this method to work.
- Install Homestead and set it up to serve both your application and Globals.
Example partial config file:
folders:
- map: ~/GitProjects/registrationblock
to: /home/vagrant/code/registrationblock
- map: ~/GitProjects/globals/g
to: /home/vagrant/code/g
sites:
- map: registrationblock.test
to: /home/vagrant/code/registrationblock/public
php: "7.1"
- map: globals.test
to: /home/vagrant/code/g
php: "7.1"
-
Install Laravel. At this time, the command is
composer global require laravel/installer
-
Copy .env.example to .env - this is your local configuration file, and should never be committed
-
Run
php artisan key:generate
to generate a local app key -
Run
composer install
to load dependencies -
Complete the .env config file with the following attributes:
APP_ENV
should generally belocal
for local development. This will disable the SimpleSAMLphp login system, and instead pull data for the test user hardcoded inapp/Http/Middleware/SimpleSAMLphp.php
.staging
should be used for staging/test, andproduction
for production.APP_KEY
should be already set for you by step 4- APP_URL` should be set to match your Homestead config (step 1)
GLOBALS_PATH
should match the globals path in your Homestead config (step 1)GLOBALS_URI
should be the URI of globals used to fetch stylesheets, etc.GLOBALS_VERSION
is a cache-buster, and can be set to whatever you wantDATAAPI_CLIENT_ID
andDATAAPI_CLIENT_KEY
can be generated through the Data API's admin interface.DATAAPI_BASE_URI
should be the full base URL of the API endpoints, something like https://protected.example.com/data/api/v1/internal/- All
SIMPLESAMLPHP_*
options can be left blank, as login is disabled for local environments. - Other options can be left at default, as they are not directly used.
At Bellevue College this is set up to deploy through Azure DevOps Pipelines. If you are manually deploying, keep the following in mind:
- Run
composer install --no-dev
to remove dev-only dependencies before you deploy - The main application code should be deployed in a directory that is not served
- The contents of the
public
folder should be deployed to a publicly available folder on the web server, and the paths in public/index.php should be adjusted to point to the directory configured in step 1. - Make sure your .env file is set up for production
APP_ENV
should be set toproduction
to enable sign onSIMPLESAMLPHP_PATH
should point to the filesystem path of the SimpleSAMLphp library on the server, aka/var/simplesaml/lib/_autoload.php
. Note that SimpleSAMLphp must be fully installed and operational before first.SIMPLESAML_SP
should be set as the Service Provider name used- currently this isbc-adfs-sp
SIMPLESAML_ATTR_USERNAME
should be set to the key that contains the username of the user in the SAML claim information.
Master | Dev |
---|---|