- Install dependencies:
npm install - Create development and test databases:
createdb thingful,createdb thingful-test - Create database user:
createuser thingful - Grant privileges to new user in
psql:GRANT ALL PRIVILEGES ON DATABASE thingful TO thingfulGRANT ALL PRIVILEGES ON DATABASE "thingful-test" TO thingful
- Prepare environment file:
cp example.env .env - Replace values in
.envwith your custom values. - Bootstrap development database:
npm run migrate - Bootstrap test database:
npm run migrate:test
For tests involving time to run properly, your Postgres database must be configured to run in the UTC timezone.
- Locate the
postgresql.conffile for your Postgres installation.- OS X, Homebrew:
/usr/local/var/postgres/postgresql.conf
- OS X, Homebrew:
- Uncomment the
timezoneline and set it toUTCas follows:
# - Locale and Formatting -
datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
timezone = 'UTC'
#timezone_abbreviations = 'Default' # Select the set of available time zone
- To seed the database for development:
psql -U thingful -d thingful -a -f seeds/seed.thingful_tables.sql - To clear seed data:
psql -U thingful -d thingful -a -f seeds/trunc.thingful_tables.sql
- Start application for development:
npm run dev - Run tests:
npm test