regolithed / react-bedrock

React and Redux Boilerplate
4 stars 2 forks source link

Bedrock

Build Status Stories in Ready

Bedrock is a React-Redux starter kit.

Table of Contents

  1. Requirements
  2. Development
    1. Environment Variables
    2. Installing Dependencies
    3. Linting Setup
    4. Tasks
    5. Database
  3. Team
  4. Contributing

Requirements

Development

Environment Variables

Bedrock utilizes environment variables for running the application locally and in production. Environment variables can be declared locally by adding them to your .profile

export DATABASE_URL=postgres://user:pass@localhost

Installing Dependencies & Running

From within the root directory:

npm install

Linting Setup

ESLint is used for linting as it plays nicely with React and JSX. Bedrock linting adheres to the Airbnb Stlye Guide and the react plugin (both are included as dev-dependencies). The ESLint settings can be seen in .eslintrc.json. First, install ESLint globally:

npm install -g eslint

Next, add the following packages for integration with SublimeText. The easiest way to add these is via "Package Control":

Note: Restart Sublime Text!!!

Tasks

From within the root directory:

// Run local development environment
npm start

// Run tests
npm test

Database

From within the root directory

// Intialize postgres database
initdb db/

// Create Local Databases
createdb development
createdb test

// Verify knex CLI
knex --version
// If not installed
npm install knex -g

// Get latest version of database
knex migrate:latest

//If testing
knex migrate:latest --env test

// Update database
knex migrate:make addNewFeatureNameToTableName

An Example migration file

exports.up = (knex, Promise) => {
  return Promise.all([
    knex.schema.table('todos', (table) => {
      table.string('somethingElse').notNullable();
    }),
  ]);
};

exports.down = (knex, Promise) => {
  return Promise.all([
    knex.schema.table('todos', (table) => {
      table.dropColumn('somethingElse');
    }),
  ]);
};

Roadmap

View the project roadmap here.

Team

Contributing

See CONTRIBUTING.md for contribution guidelines.