davps / create-react-app-redux-boilerplate

Boilerplate code and installation instructions to create a walking skeleton for a TDD process using create-react-app/Redux/TravisCI
MIT License
2 stars 2 forks source link

React/create-react-app/Redux/TravisCI/Heroku/VSCode boilerplate

Boilerplate code and installation instructions for a quick setup of a walking skeleton for a TDD process using create-react-app/Redux/TravisCI.

"A 'walking skeleton' is an implementation of the thinnest possible slice of real functionality that we can automatically build, deploy and test end-to-end." Source: Cockburn, Alistair. Crystal Clear: A Human-powered methodology for small teams, 2004.

It is ready to use with TDD with the basic setup for unit, integration and end to end tests.

Status
CI service Build Status
Tests Coverage Status

Live demo

View the live demo on Heroku or the individual UI components of my Storybook on Github Pages.

Tech stack

Usage

Start the server

npm start

Debug the tests

Open Visual Studio and debug. Run the tests by default.

If you want to run the integration tests too, type from the terminal:

npm test -- --coverage --no-cache

Run the Storybook

npm run storybook

Then open http://localhost:9009/

How to reuse this repository

Ensure requirements are met, then execute the following in a terminal.

Conventions

Steps

  git init
  git remote add origin https://github.com/davps/$REPOSITORY_NAME.git
  heroku create $HEROKU_APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git

Here are the instructions to create your Github token https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/

If travis is not installed yet, install it. For example, you can use these commands on a fresh installation of Ubuntu Server 16.04 LTS.

sudo apt-get update
sudo apt-get install rubygems-integration
sudo apt-get install bundler
sudo gem install travis

Then follow these instructions to create a encrypted private key of heroku:

For example, you can use this command

travis setup heroku

and it will override the values from .travis.yml and you will be done with this step.

In my case I have issues installing travis on my macbook so I used a different machine with ubuntu, with something like this (but with )

travis encrypt MY_HEROKU_AUTH_TOKEN -r davps/create-react-app-redux-boilerplate

(nothe that you need to replace MY_HEROKU_AUTH_TOKEN with your actual token, which you can get with the command $ heroku auth:token)

which will output this

Please add the following to your .travis.yml file:

  secure: "UlgPPgLdeoiRI3w+ptiEmOg6jC0eMOrYqmG0anGRaCJgCNTZyXKZu/3jIaUsK3PNCciKxqpNgdTDX+LIX1cp4DKQhDJ/Ww6fC2rOMZGay5jy0KOcN8JTZCNk+MEsmCRPBYWceCy1m3IpZ9KhtKPKcJ9gaazEPZJ9ASatlomIoAYTJP4OHqG+tG5HmpIkh+Z5KXPrPXhLVPrPJ+TpIKj2tirvF/CBTqXaFCgdVMMPi7upLkCxrBG0bL2X0Kpv/zZvj/AG2E+LUSoktsJwoBkfKCLgzpOf5bHZaumPWH1PHafTlAp3PqMZFmvlNnD4x4ZhzktdQr9fmfVjGb16S6BTrMeRHXV8H+ngGNokiTjhFuBcNzMK00ZXpEs/BMnPYrW9HCMBQKForyYtLzGZe3bSZ8SNN5ro931ZLxmZmnplYtgwtGIAF3HkT3NbOvBZ9OPYSz6h/SmeEtj01A5R75SULupFoHe4uYILTcQoKsPh/n0fLrqKgZDDTebh/6bp6J72/6ViQg5eSJo3V0vlFbI/qQhoogZDqK1eVz6yRcYw6rgwfp+JJWceM9sDdlF2rb+auLCSuKhdgyFaIHsLVzsfoVyvQlQ1AS3eV3fHJzzMHR+SZgDoSQEJUCVV2/FpETEP3KjIaRDjP2Augej7wfkSicZntM8qvYM7B+orYAnaOO0="

and then manually replace the actual secure: line of the .travis.yml file.

npm install
git add --all
git commit -m 'First commit'
git push -u origin master