/blrplt

Reactive web app boilerplate

Primary LanguageJavaScriptMIT LicenseMIT

blrplt

My ES6 / node.js boilerplate.

Available branches

master branch

Usage

  1. Download and unzip desired branch (see below)
  2. npm update
  3. gulp
  4. Navigate to http://localhost:3001

pg branch

Usage

  1. Execute docker-compose from within docker folder:

     cd docker
     docker-compose up
    

    This should build images and start containers:

    • blrplt-app with application code and dev tools
    • blrplt-pg with PostgreSQL database
  2. Install all npm modules:

     docker exec -it blrplt-app bash
     npm install
    
  3. Run gulp

     docker exec -it blrplt-app bash
     gulp
    
  4. Navigate to http://localhost:3001

Applying changes to database

When app is stared, following steps are executed:

  1. Scan sql folder for *.sql files matching /^[0-9]{12}(-[^\.]+)?\.sql$/ pattern
  2. For each file check if timestamp (first part of filename) is present in delta_sql table
  3. Execute file's content using psql if not already present in delta_sql table
  4. Update delta_sql table with executed file's timestamp

This ensures consistent development of database schema. Update can also be forced by executing dst/server/lib/sql.js directly.