whirlwin / fript-web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fript-web

Local development

  1. Install dependencies

    $ npm install
  2. Create a .env file with the required environment variables

- DB_NAME
- DB_HOST
- DB_PORT
- DB_USER
- DB_PASSWORD
- ENV 
- FACEBOOK_APP_ID
- FACEBOOK_APP_SECRET

You may also add either of these optional environment variables:

- EARLY_ACCESS_SIGNUP

Alternatively, create a file .env.production if needed

3: Start the app locally

$ npm start
  1. Inspect the service document at localhost:4000

DB

Connecting

1: Download Heroku CLI and PostgreSQL

2: Log in to Heroku

heroku login

3: Connect to a database using psql

# staging db:
npm run psql:st

# production db:
npm run psql:prod

Migrations

  1. Create a new DB migration

    1. Create a new table migration

      npm run create-table-migration <tableName>
    2. Populate the table if desirable

      npm run create-insert-migration <tableName>
  2. Edit the migrations file in ./db/migrations

  3. Run the migrations against the server

npm run migrate-up

About


Languages

Language:JavaScript 87.2%Language:HTML 10.4%Language:Shell 2.1%Language:CSS 0.3%Language:Makefile 0.1%