/react-redux-postgres

Builds on React Redux example, includes JWT token auth, Postgres storage, and docker options

Primary LanguageJavaScript

react-redux-postgres-starter

Prerequisites

Node.js >= v6 must be installed.

Installation

  • Running npm install in the app's root directory will install everything you need for development.

Development Server

Running Tests

  • npm test will run the tests once.

  • npm run test:coverage will run the tests using PhantomJS and produce a coverage report in coverage/.

  • npm run test:browser will run the tests using Chrome

  • npm run test:watch will run the tests on every change.

Linting

  • is built in - that said you can run npm run lint

Building

  • npm run build creates a production build by default. Produces a 'build' directory. That directory is removed every time.

    To create a development build, set the NODE_ENV environment variable to development while running this command.

  • npm run dev will run dev with tests watch

Running docker

docker build -t sgentile/node-web-app .

image will then be listed by docker: docker images

Run the image

docker run -d -p 8000:8000 -v $(pwd):/usr/src/app --name node-web-app sgentile/node-web-app

Print the output of your app

Get container Id

docker ps

#print app output

docker logs <container_id>

to go inside the container:

docker exec -it <container_id> /bin/bash

docker-compose build web docker-compose up web

use http://localhost:8000 for docker

running locally without docker: npm run dev - you'll need a postgres instance