PMA2020 Datalab client
To get the application setup just:
- Clone the repository
- Create an
env.js
from the example atenv.js.example
- Run
npm install
to get dependencies - Run
bundle install
to get Middleman/Ruby dependencies
In order to make the app more flexible for differenet environments
(development, staging, production, etc) we utilize a env.js
file to
describe the environment for the client application. Your actual
env.js
should never be committed.
Currently the options are:
api_url
: The url you would like to use for the API. This will hard default tohttp://api.pma2020.org
environment
: The environment you are usingversion
: The version # of the client application. This should be incremented using Semantic Versioning on every deploy.
During development we are using Webpack to manage assets including Javascript and CSS files. Normally you would have to run a webpack server along side things but this is abstracted away via Middleman.
To run a development server just use the command:
middleman server
Unit Tests use Karma and Chai. To run,
- Ensure node dependencies are installed with
npm install
. - Run
npm run test:unit
. - Karma will instruct you to open a browser to run the tests.
Blackbox testing uses Selenium. To run,
- Ensure node dependencies are installed with
npm install
. - Can be run with default config using
npm test:selenium
.
To run all tests,
- Use the command
make test
ornpm run test
.
Note that if running all tests, some versions of Karma appear to have a bug where the server does not close automatically; therefore you should exit the first command automatically after it finishes.
The Datalab Client uses Amazon S3 for its hosting since it is just static content.
When you are ready to deploy a new version run these steps:
middleman build
- generates static assets that are uglified and minified to thebuild/
directory- Copy the static assets in the build folder to the Amazon S3 Bucket
- If the build does not automatically create an updated
env.js
inbuild/
, copy/patseenv.js.example
intobuild/
and change the name toenv.js
.
You can generate the JS documentation using:
npm run doc:gen