-
Install vagrant
-
Install ansible
-
Clone the project
git clone https://github.com/thelabtw/lab-assistant.git -
Start the vagrant vm
vagrant up && vagrant provision -
Log onto the vm
vagrant ssh -
Find the project files
cd /vagrant -
Install dependencies
npm install -
Email configuration [Optional]
1. Run `which sendmail` in a terminal 2. Add EMAIL_SERVER="Path to sendmail" to environment vars 3. Turn on the toggle `email.sendEmails` in each specific environment (config/default.json, config/staging.json, config/production.json) -
Run the tests
npm test -
Run the acceptance tests
1. First set up a admin email and admin password: export ACCEPTANCE_EMAIL=some email here export ACCEPTANCE_PASSWORD=some password here 2. Start the server: npm start 3. Then run: npm run acceptanceTests -
Start the server
npm start -
Re-bundling the UI
The frontend code must be re-bundled whenever it changes;
npm startserves the last bundled version of the UI. We have apostinstalltask that bundles any timenpm installis run (i.e. on deployment).When developing, the easiest way to keep the front-end up to date is to run the following command in a separate shell, which will watch the code and re-bundle on changes. This can be run outside of the Vagrant VM, if you have
npminstalled on your host machine.npm run bundle
-
Run server side tests
npm run serverTests -
Run client side tests
npm run componentTests -
Run a specific server side test
NODE_ENV=test node --harmony node_modules/jasmine/bin/jasmine.js spec/integration/membersSpec.js -
Run smoke tests against an external target
NODE_ENV=test INSTANCE_URL=http://myinstance.mydomain.com node --harmony node_modules/jasmine/bin/jasmine.js spec/integration
-
Migrate the database (run automatically as part and npm start or npm test)
./node_modules/sequelize-cli/bin/sequelize db:migrate -
Create a new migration
./node_modules/sequelize-cli/bin/sequelize migration:create --config config/db.json --name <migration_name> -
Create an admin user to access the organiser views
npm run createAdmin
-
heroku pg:backups capture --app <app_name>
-
curl -o db/dumps/latest.dump
heroku pg:backups public-url -
(in the vm) pg_restore --verbose --clean --no-acl --no-owner -h localhost -U lab-assistant -d lab-assistant db/dumps/latest.dump
Happy hacking!
- Install plugin
-
Install webstorm
-
Open preferences -> Languages and frameworks
-
Change javascript to ECMAScript 6
-
Setup run configuration to node and "javascript/file" to be bin/www
-
Optionally install vagrant plugin