Pair: Sultana + Sacha
src: https://courses.thinkful.com/auth-jwt-v1/checkpoint/2#assignment
branch: checkpoint-2
src: https://courses.thinkful.com/auth-jwt-v1/checkpoint/3#assignment
branch: checkpoint-3
src: https://courses.thinkful.com/auth-jwt-v1/checkpoint/4#assignment
branch: checkpoint-4
aside: Instructor' gist on Data Protection & Hashing Resources
src: https://courses.thinkful.com/auth-jwt-v1/checkpoint/5#assignment
branch: checkpoint-5
src: https://courses.thinkful.com/auth-jwt-v1/checkpoint/6#assignment
branch: checkpoint-6
- 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 thingful
GRANT ALL PRIVILEGES ON DATABASE "thingful-test" TO thingful
- Prepare environment file:
cp example.env .env
- Replace values in
.env
with 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.conf
file for your Postgres installation.- OS X, Homebrew:
/usr/local/var/postgres/postgresql.conf
- OS X, Homebrew:
- Uncomment the
timezone
line and set it toUTC
as 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
Things Endpoints
GET /api/things
GET /api/things/:thing_id
GET /api/things/:thing_id/reviews
Reviews Endpoints
POST /api/reviews