npm install knex -g
npm install nodemon -g
npm install bower -g
npm install gulp -g
createdb princeton-users-development
createdb princeton-surveys-development
cp .env{.example,}
npm install
nodemon
The application requires a facebook client id, client secret and callback url to work properly. If you prefer to get the application up and running without the facebook credentials, you may add the SKIP_FACEBOOK_STRATEGY
environment variable. There is an example in the .env.example
file.
To build the code for development, open a terminal window and type:
gulp dev
Allow the gulp script to continue to run. In a separate tab, run:
nodemon
The app requires two databases, so most Knex commands won't just work. To that end, there are custom database migration scripts:
To migrate to the latest version, run:
node server/db/migrate.js
To migrate just one database run:
node server/db/migrate.js users
To rollback just one database run:
node server/db/migrate.js users rollback
To create new migrations for the users database, run:
node server/db/make-migration.js users migration-name
To create new migrations for the surveys database, run:
node server/db/make-migration.js surveys migration-name
./server/db/reset-database.sh
The test suite uses Mocha, Chai and Supertest.
To prepare the test database, run:
node server/db/prepare.js
To run server tests, run:
npm test
To run integration tests, first run the server:
gulp dev
nodemon
Then run protractor:
npm run protractor