# orchardify
So what does our catalogue sound like?


## Requirements
* Node with NPM
* Babel

## How it works
When setting up the application for the first time, all npm dependencies should be installed from `package.json` with the `npm install` command.

The `package.json` file also contains a `scripts` section which is used to deploy the app:

```javascript
  "scripts": {
    "start": "npm run watch-build & npm run watch-server",
    "watch-server": "./node_modules/.bin/nodemon -e js,json --watch server --exec './node_modules/.bin/babel-node' server",
    "watch-build": "./node_modules/.bin/nodemon -e js,json --watch components --watch sass --exec 'npm run' build",
    "build": "npm run style && npm run bundle",
    "test": "jest",
    "style": "./node_modules/.bin/node-sass ./sass/main.scss ./public/css/main.css",
    "bundle": "./node_modules/.bin/browserify components/application.js -t babelify --outfile public/js/hackathon.js"
  },


```
These run the various tasks for developing and deploying changes to the application and are run via npm. The steps are as follows:

#### Bundle the JS with `npm run bundle`
This command uses [Browserify](http://browserify.org/) to load external dependencies and concatenate the javascript files into a single file. It targets the `client/index.js` file that performs the initial React render command.

#### Compile the Sass with `npm run style`
.SCSS files must be converted to plain CSS for use in the browser. We use node-sass for this.

##### Run all of the above with `npm run build`
This will perform all three of these tasks.

#### Watch your files and server for changes with `npm start`
This will run the build and start the server each time a file is changed.

## Testing
Tests are written using the [Jest](https://facebook.github.io/jest/) testing framework that the React developers put together to make React unit testing painless and easy. Every JSX component should have a corresponding unit test in the `__tests__` folder. To run the tests, simply run `npm test`.
 Orchard.

## Deploy

To run the project use Babel Node to run the server file with `babel-node server`. If Babel Node is not installed globally than you can use the executable in node_modules/.bin.  If running locally, your app will by default be available at [http://localhost:3000](http://localhost:3000) which the console will inform you of as well.