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.3
- Additional PHP modules: php-pgsql, php-gd, php-mbstring, php-curl
- NodeJS >= 12 & npm >= 6
npm install uglify-js uglifycss node-sass -g
- PostgreSQL 9.1 or later
- Install necessary dependencies with:
composer install --dev
- Execute the init file with:
common/config/main-local.phpand add your database connection information (host, dbname, username, password)
- run all yii2 db migrations
- startup local PHP server with
- visit http://localhost:8080/signup and create a new user
- log in, start working
We have built-in support for minimizing JS and CSS assets. This is optional in both the dev and prod environments but is strongly recommended in prod to reduce the page load time. The following steps should be sufficient:
- Ensure the npm packages
uglifycssare installed via
npm install uglify-js uglifycss -g
- Swap the commented and uncommented code blocks in
- Run the asset compression by executing
Note: It's best to avoid executing scripts as root whenever possible. Follow NPM's instructions to set up a global NPM folder for a non-root user.
That should result the browser downloading published asset bundles instead of each JS/CSS file individually.
Testing is provided by Codeception unit tests. The necessary libraries should have already been installed by Composer. First, the test database and user must be created:
- Create a PostgreSQL database and user for tests via the following commands:
CREATE DATABASE fsatest; CREATE USER fsatest WITH SUPERUSER PASSWORD 'test123'; GRANT ALL PRIVILEGES ON DATABASE "fsatest" TO fsatest;
If you choose to modify the name of db or user or the password, be sure to also modify the corresponding value in
- Next, scaffold the test configuration files with:
- To run the tests, execute:
To view the code coverage of these tests run: (the xdebug extension is required for generation of code coverage)
The authoritative instance of this application is deployed at https://fasterscaleapp.com using Capistrano. A recipe for that can be found in
config/deploy.rb. In-depth Production deployment instructions can be found at PRODUCTION.md.
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.