New boilerplate

This commit is contained in:
Christian Alfoni
2014-10-27 15:28:16 +01:00
parent 54bbfd3ce2
commit 633e48461c
29 changed files with 2609 additions and 29544 deletions

View File

@@ -1,38 +1,31 @@
## React FLUX Boilerplate
Based on the architecture suggestions from Facebook, this boilerplate will help you deal with it. It has included the
flux-react extension to React JS. Read more about FLUX over at [Facebook Flux](http://facebook.github.io/flux/) and I wrote a post about it too: [React JS and FLUX](http://christianalfoni.github.io/javascript/2014/08/20/react-js-and-flux.html).
Based on the architecture suggestions from Facebook, this boilerplate will help you deal with it. It has included the flux-react extension to React JS, [flux-react](https://github.com/christianalfoni/flux-react).
Read more about FLUX over at [Facebook Flux](http://facebook.github.io/flux/) and I wrote a post about it too: [React JS and FLUX](http://christianalfoni.github.io/javascript/2014/08/20/react-js-and-flux.html).
### How to use
* Clone the repo
* Run `npm install`
* Open `dev/index.html`, run `python -m SimpleHTTPServer` in the `dev` folder or set up your own server
* Open `build/index.html`, run `python -m SimpleHTTPServer` in the `build` folder or set up your own server
### Development
* Run `gulp`
* Any changes to `app` or `styles` folder will automatically rebuild to `dev` folder
### Tests
* Run `gulp test -'./tests/App-test.js'
* Open `test.html`
* Any changes done to the test file or files in `app` folder will autoreload the browser
* Any changes to `app` folder will automatically rebuild to `build` folder
### Run all tests with Karma
* Run `npm test`
Karma will launch PhantomJS and run the tests once. If you need to run tests in a GUI browser, either change `karma.conf.js` to use Chrome or Firefox, or manually start it with:
`./node_modules/karma/bin/karma start --single-run --browsers Chrome`
Karma will launch PhantomJS and run the tests once. If you need to run tests in a normal browser change karma.conf.js to use 'Chrome' as browser. You can also keep running the tests as you write them. Set `autoWatch: true` and `singleRun: false`.
### Minify the code, ready for production
* Run `gulp deploy`
* Run `gulp deploy` to deploy to `dist` folder
### Directory
* **app/**: Where you develop the application
* **dev/**: Where your automatically builds to. This is where you launch your app in development
* **build/**: Where your automatically builds to. This is where you launch your app in development
* **dist/**: Where the deployed code exists, ready for production
* **utils/**: Gulp tasks and other utils
* **styles/**: Where you put your css files
* **tests/**: Where you put your test files
* **gulpfile**: Gulp configuration
* **karma.conf.js**: Karma configuration