- React for rendering
- Redux for application state
- SuperAgent for AJAX calls
- Mocha is our test harness
- Expect is our assertion library
- Enzyme to help with testing React components
- Webpack for bundling our app
For initial setup, the repository needs to be forked and cloned, and dependencies need to be install using npm (package manager). To do so, visit the github repository page and fork the repo. Once forked, run the following commands:
git clone https://github.com/YOUR_USER_NAME/ui-boilerplate.git
cd ui-boilerplate
npm install
We use npm as our task manager and webpack for our bundling and dev testing. To run the app in development, use the following command:
npm start
The application will be accessible at http://localhost:3000/. Changes will automatically load in once saved.
Tests are located alongside their source code with the suffix .test.js
. Most components can be tested with shallow rendering, which isolates the component to just itself and its immediate children and is the recommended way to test.
Before submitting a pull request, make sure your change passes tests and linting. You can invoke the tests and linter with:
npm test
Tests and linting can both be run in "watch" mode, rerunning when a file changes:
npm run test:watch
npm run lint:watch
For deployment, we bundle our application into four distinct parts:
app.[hash].js
- The application JavaScript we writevendor.[hash].js
- The external JavaScript libraries we depend onstyles.[hash].css
- The css file for our applicationindex.html
- The basic HTML we need to house our JavaScript app
To generate a dist
folder ready for deployment, run:
npm run build
This will generate the above files, plus source map files for the JavaScript and CSS files.