├── .gitignore ├── app ├── scss │ ├── app.scss │ ├── _variables.scss │ ├── _base.scss │ ├── _toolkit.scss │ ├── _mixins.scss │ └── _functions.scss ├── favicon.ico ├── dispatcher │ └── AppDispatcher.js ├── components │ ├── App │ │ ├── _App.scss │ │ └── App.jsx │ ├── Menu │ │ ├── _Menu.scss │ │ ├── Menu.jsx │ │ ├── MenuItem.jsx │ │ └── __tests__ │ │ │ └── Menu-test.jsx │ ├── Footer │ │ ├── _Footer.scss │ │ ├── Footer.jsx │ │ └── __tests__ │ │ │ └── Footer-test.jsx │ └── Body │ │ ├── _Body.scss │ │ └── Body.jsx ├── app.tests.js ├── constants │ └── AppConstants.js ├── app.jsx ├── util │ └── WebAPI.js ├── index.html ├── actions │ └── AppActions.js └── stores │ ├── BaseStore.js │ ├── ItemsStore.js │ └── __tests__ │ └── BaseStore-test.js ├── .travis.yml ├── webpack ├── config.test.js ├── plugins.js ├── config.js └── loaders.js ├── .editorconfig ├── karma.conf.js ├── dev-server.js ├── LICENSE ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /build 3 | *.log* 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /app/scss/app.scss: -------------------------------------------------------------------------------- 1 | /* app.scss */ 2 | 3 | @import "base"; 4 | -------------------------------------------------------------------------------- /app/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | /* _variables.scss */ 2 | 3 | $border-color: #eee; 4 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badsyntax/react-seed/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | script: 5 | - npm run test-travis 6 | -------------------------------------------------------------------------------- /app/dispatcher/AppDispatcher.js: -------------------------------------------------------------------------------- 1 | import Flux from 'flux'; 2 | 3 | export default new Flux.Dispatcher(); 4 | -------------------------------------------------------------------------------- /app/scss/_base.scss: -------------------------------------------------------------------------------- 1 | /* _base.scss */ 2 | 3 | html, body { 4 | margin: 0; 5 | min-height: 100%; 6 | } 7 | -------------------------------------------------------------------------------- /app/scss/_toolkit.scss: -------------------------------------------------------------------------------- 1 | /* _toolkit.scss */ 2 | 3 | @import "functions"; 4 | @import "mixins"; 5 | @import "variables"; 6 | -------------------------------------------------------------------------------- /app/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | /* _mixins.scss */ 2 | 3 | @mixin my-padding-mixin($some-number) { 4 | padding: $some-number; 5 | } 6 | -------------------------------------------------------------------------------- /app/components/App/_App.scss: -------------------------------------------------------------------------------- 1 | @import "toolkit"; 2 | 3 | .app { 4 | font-size: inherit; 5 | @include my-padding-mixin(20px); 6 | } 7 | -------------------------------------------------------------------------------- /app/app.tests.js: -------------------------------------------------------------------------------- 1 | import 'babel-core/polyfill'; 2 | 3 | let context = require.context('.', true, /-test\.jsx?$/); 4 | context.keys().forEach(context); 5 | -------------------------------------------------------------------------------- /app/components/Menu/_Menu.scss: -------------------------------------------------------------------------------- 1 | .menu { 2 | background: #eee; 3 | border-radius: 8px; 4 | padding: 10px 10px 10px 40px; 5 | width: 200px; 6 | } 7 | -------------------------------------------------------------------------------- /webpack/config.test.js: -------------------------------------------------------------------------------- 1 | var config = require('./config'); 2 | 3 | delete config.context; 4 | delete config.entry; 5 | delete config.output; 6 | delete config.devServer; 7 | 8 | module.exports = config; 9 | -------------------------------------------------------------------------------- /app/components/Footer/_Footer.scss: -------------------------------------------------------------------------------- 1 | @import "toolkit"; 2 | 3 | .footer { 4 | border-top: 1px solid #eee; 5 | display: flex; // testing Autoprefixer 6 | font-size: inherit; 7 | margin-top: 20px; 8 | padding-top: 20px; 9 | } 10 | -------------------------------------------------------------------------------- /app/components/Body/_Body.scss: -------------------------------------------------------------------------------- 1 | @import "toolkit"; 2 | 3 | .body { 4 | font-size: inherit; 5 | padding: 20px; 6 | } 7 | 8 | .header { 9 | border-bottom: 1px solid $border-color; 10 | margin: 0 0 20px 0; 11 | padding-bottom: 20px; 12 | } 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.{js,json,jshintrc,html,jsx}] 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /app/constants/AppConstants.js: -------------------------------------------------------------------------------- 1 | import pkg from '../../package'; 2 | 3 | export const DEBUG = (process.env.NODE_ENV !== 'production'); 4 | export const APP_TITLE = pkg.name; 5 | export const ITEMS_GET_SUCCESS = 'ITEMS_GET_SUCCESS'; 6 | export const ITEMS_GET_ERROR = 'ITEMS_GET_ERROR'; 7 | export const ITEMS_UPDATED = 'ITEMS_UPDATED'; 8 | -------------------------------------------------------------------------------- /app/app.jsx: -------------------------------------------------------------------------------- 1 | import './favicon.ico'; 2 | import './index.html'; 3 | import 'babel-core/polyfill'; 4 | import 'normalize.css/normalize.css'; 5 | import './scss/app.scss'; 6 | 7 | import React from 'react'; 8 | import App from './components/App/App'; 9 | 10 | React.render( 11 | , 12 | document.getElementById('app') 13 | ); 14 | -------------------------------------------------------------------------------- /app/util/WebAPI.js: -------------------------------------------------------------------------------- 1 | export default { 2 | getItems() { 3 | return new Promise((resolve) => { 4 | setTimeout(() => { 5 | resolve(['Item 1', 'Item 2', 'Item 3'].map((item, i) => { 6 | return { 7 | id: i, 8 | label: item 9 | }; 10 | })); 11 | }, 500); 12 | }); 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /app/components/Footer/Footer.jsx: -------------------------------------------------------------------------------- 1 | import styles from './_Footer.scss'; 2 | import React from 'react'; 3 | 4 | export default class Footer extends React.Component { 5 | render() { 6 | var year = (new Date()).getFullYear(); 7 | return ( 8 | 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/scss/_functions.scss: -------------------------------------------------------------------------------- 1 | /* _functions.scss */ 2 | 3 | /** NOTE: this function is only useful when importing Sass files with Sass instead 4 | of requiring the Sass files with the webpack sass-loader. */ 5 | $imported-once-files: (); 6 | @function import-once($filename) { 7 | @if index($imported-once-files, $filename) { 8 | @return false; 9 | } 10 | $imported-once-files: append($imported-once-files, $filename); 11 | @return true; 12 | } 13 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= title %> 7 | <% if (debug === false) { %> 8 | 9 | <% } %> 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/components/Footer/__tests__/Footer-test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react/addons'; 2 | import Footer from '../Footer.jsx'; 3 | import { expect } from 'chai'; 4 | 5 | let { TestUtils } = React.addons; 6 | 7 | describe('Footer', () => { 8 | it('Should have the correct footer element', () => { 9 | let footer = TestUtils.renderIntoDocument( 10 |