The Faster Scale App
An online version of Michael Dye's Faster Relapse Awareness Scale
These instructions will help you get a local installation set up for development and testing purposes. See the deployment instructions for how to deploy this to a live system.
- PHP >= 7.1
- A SASS compiler. We recommend the npm project
node-sass. Once npm is installed on your machine type
npm i node-sass -g.
- PostgreSQL 9.1 or later (Theoretically any type of SQL compatible with Yii2's ActiveRecord might work, but we've only tested this on PostgreSQL)
- Clone this repo with:
git clone email@example.com:CorWatts/fasterscale.git && cd fasterscale
- Install necessary dependencies with:
composer install --dev
- Execute the init file
./init --env=Developmentwith the environment set to Development option
site/config/main-local.phpand add a cookie validation key in the $config variable
<?php $config = [ 'components' => [ 'request' => [ 'cookieValidationKey' => 'devcookiekey' ], [...other good stuff...] ] ];
common/config/main-local.phpand edit the default database connection information in the $config variable
<?php $config = [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => '[DB_CONNECTION_STRING]', 'username' => '[DB_USERNAME]', 'password' => '[DB_PASSWORD]', 'charset' => 'utf8', ], [...other good stuff...] } };
- run all yii2 db migrations
- startup local PHP server with
- visit http://localhost:8080/signup and create a new user
- log in, start working
Running the Tests
Testing is provided by Codeception unit tests. The necessary libraries should have already been installed by Composer. First, the testing files must be scaffolded by running:
To run the tests, ensure you're in the base directory of this repository and execute:
To view the code coverage of these tests run: (XDebug is required for generation of code coverage)
We have built-in support for minimizing JS and CSS assets. The following steps should be sufficient:
- Install the the npm packages
npm install uglify-js uglifycss -g
- Swap the commented and uncommented code blocks in
- Run the asset compression by executing
That should result the browser downloading published asset bundles instead of each JS/CSS file individually.
This application is deployed live on https://fasterscaleapp.com using Capistrano. A recipe for that can be found in
config/deploy.rb. Additional instructions will be added in the near future.
This application is under the BSD-3 license. See LICENSE.md for details.
The FASTER Relapse Awareness Scale is copyrighted by Michael Dye and Patricia Fancher. We have been granted permission to use it.
Want to contribute? Wonderful! We're excited to hear any and every idea you have about the Faster Scale App. If you're struggling to come up with a task of your own to work on, take a look at our issues list and feel free to tackle any of the unassigned issues.