[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\"react\", \"es2015\", \"stage-1\"]\n}\n"
  },
  {
    "path": ".editorconfig",
    "content": "# http://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\nmax_line_length = 80\ntrim_trailing_whitespace = true\n\n[*.md]\nmax_line_length = 0\ntrim_trailing_whitespace = false\n\n[COMMIT_EDITMSG]\nmax_line_length = 0"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"extends\": \"airbnb\",\n  \"parserOptions\": {\n    \"ecmaFeatures\": {\n      \"experimentalObjectRestSpread\": true\n    }\n  },\n  \"rules\": {\n    \"max-len\": [\"warn\", 120],\n    \"indent\": [\"warn\", 4],\n    \"react/jsx-indent\": [\"warn\", 4]\n  },\n  \"globals\": {\n    \"localStorage\": true \n  }\n}"
  },
  {
    "path": ".firebaserc",
    "content": "{\n  \"projects\": {\n    \"default\": \"react-redux-firebase-d6283\"\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\n\n#\ndist\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules\njspm_packages\n\n# Optional npm cache directory\n.npm\n\n# Optional REPL history\n.node_repl_history\n.idea/\n.vscode\nfirebase-debug.log\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n  - \"node\"\n  - \"6\"\n  - \"5\"\n  - \"4\""
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 btomashvili\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# THIS PROJECT IS DEPRECATED IT'S NOT MAINTAINED ANYMORE!\n\n\n# React, Redux Firebase Boilerplate\n\n\n[![Build Status](https://travis-ci.org/awwong1/react-redux-firebase-boilerplate.svg?branch=master)](https://travis-ci.org/awwong1/react-redux-firebase-boilerplate)\n\n> [Firebase](https://www.firebase.com) is a powerful platform for your mobile and web applications that lets you build apps fast without managing servers. Firebase gives you the tools and infrastructure to build better apps and grow successful businesses.\n\n> [React](https://www.firebase.com) A javascript library for building user interfaces\n\n> [Redux](http://redux.js.org/) Redux is a predictable state container for JavaScript apps.\n\n### Boilerplate Introduction\nBoilerplate is designed for quickly spin up your apps with Firebase, using bunch of awesome new front-end technologies includes webpack build system, hot reloading, routing & sass support.\n\n## Features\n* [react](https://github.com/facebook/react)\n* [redux](https://github.com/rackt/redux)\n* [firebase](https://www.npmjs.com/package/firebase)\n* [react-router](https://github.com/rackt/react-router)\n* [redux-promise](https://github.com/acdlite/redux-promise)\n* [webpack](https://github.com/webpack/webpack)\n* [babel](https://github.com/babel/babel)\n\nQuick Start\n-----------\n\n```shell\n$ git clone https://github.com/btomashvili/react-redux-firebase-boilerplate.git\n$ cd react-redux-firebase-boilerplate\n$ npm install\n$ npm run dev\n```\n\nFirebase settings\n--------\nFirst you need to create your firebase application to fetch settings for boilerplate. For more information how to add your web app check this [resource](https://firebase.google.com/docs/web/setup). After it copy your settings from firebase and fill config.js\n\n```javascript\nmodule.exports = {\n\n    FIREBASE_CONFIG: {\n\n      apiKey: \"\",\n      authDomain: \"\",\n      databaseURL: \"\",\n      storageBucket: \"\",\n\n    }\n}\n```\n\nCommands\n--------\n\n|Script|Description|\n|---|---|\n|`npm run dev`| Run development server with webpack-dev-server @ `localhost:3000`|\n|`npm run build`| Test, and build the application to `./dist`|\n|`npm start`| Start production ready app with pm2 from `./dist` @ `localhost:8080`|\n|`npm run lint`| Run ESLint on `./src`|\n\n\nWhat it looks like\n\n### DEMO \n[https://react-redux-firebase-d6283.firebaseapp.com/](https://react-redux-firebase-d6283.firebaseapp.com/)\n\n--------\n\n![screen](https://www.dropbox.com/s/csufxlitjme8p3q/react_redux_firebase.gif?raw=1 \"react_redux_firebase_boilerplate\")\n"
  },
  {
    "path": "database.rules.json",
    "content": "{\n  \"rules\": {\n    \".read\": false,\n    \".write\": false,\n    \"words\": {\n      \".read\": true,\n      \".write\": true\n    },\n    \"dev\": {\n      \".read\": true,\n      \".write\": true\n    },\n    \"staging\": {\n      \".read\": true,\n      \".write\": true\n    }\n  }\n}"
  },
  {
    "path": "firebase.json",
    "content": "{\n  \"database\": {\n    \"rules\": \"database.rules.json\"\n  },\n  \"hosting\": {\n    \"public\": \"dist\",\n    \"rewrites\": [\n      {\n        \"source\": \"**\",\n        \"destination\": \"/index.html\"\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "jsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"ES6\",\n         \"allowSyntheticDefaultImports\": true\n    },\n    \"exclude\": [\n        \"node_modules\"\n    ]\n}"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"react-redux-firebase-boilerplate\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Simple boilerplate for Reactjs with Redux and Firebase\",\n  \"main\": \"index.jsx\",\n  \"repository\": \"git@github.com:btomashvili/react-redux-firebase-boilerplate.git\",\n  \"scripts\": {\n    \"dev\": \"./node_modules/.bin/webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors\",\n    \"build\": \"rm -rf dist && ./node_modules/.bin/webpack --config ./webpack/webpack-prod.config.js --colors\",\n    \"start\": \"PORT=8080 pm2 start ./www.js\",\n    \"test\": \"./node_modules/.bin/eslint src && ./node_modules/.bin/mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive ./test\",\n    \"test:watch\": \"npm run test -- --watch\",\n    \"lint\": \"./node_modules/.bin/eslint src\"\n  },\n  \"author\": \"Beka Tomashvili\",\n  \"contributors\": [\n    {\n      \"name\": \"Alexander Wong\",\n      \"email\": \"admin@alexander-wong.com\",\n      \"url\": \"https://www.alexander-wong.com/\"\n    }\n  ],\n  \"license\": \"MIT\",\n  \"keywords\": [\n    \"ReactJS\",\n    \"Redux\",\n    \"Firebase\",\n    \"React hot loader\",\n    \"React Router\",\n    \"ESLint\"\n  ],\n  \"devDependencies\": {\n    \"babel-core\": \"^6.2.1\",\n    \"babel-loader\": \"^6.2.0\",\n    \"babel-preset-es2015\": \"^6.1.18\",\n    \"babel-preset-react\": \"^6.1.18\",\n    \"babel-preset-stage-1\": \"^6.5.0\",\n    \"chai\": \"^3.5.0\",\n    \"chai-jquery\": \"^2.0.0\",\n    \"css-loader\": \"^0.23.1\",\n    \"eslint\": \"^3.6.1\",\n    \"eslint-config-airbnb\": \"^12.0.0\",\n    \"eslint-plugin-import\": \"^1.16.0\",\n    \"eslint-plugin-jsx-a11y\": \"^2.2.2\",\n    \"eslint-plugin-react\": \"^6.3.0\",\n    \"extract-text-webpack-plugin\": \"^1.0.1\",\n    \"file-loader\": \"^0.9.0\",\n    \"html-webpack-plugin\": \"^2.21.0\",\n    \"imports-loader\": \"^0.6.5\",\n    \"jquery\": \"^3.1.0\",\n    \"jsdom\": \"^8.1.0\",\n    \"mocha\": \"^2.4.5\",\n    \"node-sass\": \"^3.8.0\",\n    \"react-addons-test-utils\": \"^0.14.8\",\n    \"react-hot-loader\": \"^1.3.0\",\n    \"sass-loader\": \"^4.0.0\",\n    \"style-loader\": \"^0.13.1\",\n    \"url-loader\": \"^0.5.7\",\n    \"webpack\": \"^1.12.9\",\n    \"webpack-dev-server\": \"^1.14.0\"\n  },\n  \"dependencies\": {\n    \"bootstrap-social\": \"^5.0.0\",\n    \"eslint-config-airbnb\": \"^12.0.0\",\n    \"eslint-plugin-import\": \"^2.0.0\",\n    \"express\": \"^4.14.0\",\n    \"firebase\": \"^3.0.5\",\n    \"font-awesome\": \"^4.6.3\",\n    \"lodash\": \"^3.10.1\",\n    \"react\": \"^0.14.8\",\n    \"react-dom\": \"^0.14.3\",\n    \"react-redux\": \"^4.0.0\",\n    \"react-router\": \"^2.0.0-rc5\",\n    \"redux\": \"^3.0.4\",\n    \"redux-logger\": \"^3.0.6\",\n    \"redux-promise\": \"^0.5.3\",\n    \"redux-thunk\": \"^2.1.0\",\n    \"reduxsauce\": \"^0.5.0\",\n    \"seamless-immutable\": \"^7.1.2\"\n  }\n}\n"
  },
  {
    "path": "src/app/actions/firebase_actions.js",
    "content": "import {\n  LOGIN_WITH_PROVIDER_FIREBASE,\n  REGISTER_FIREBASE_USER,\n  LOGIN_FIREBASE_USER,\n  FETCH_FIREBASE_USER,\n  UPDATE_FIREBASE_USER,\n  CHANGE_FIREBASE_USER_PASSWORD,\n  FIREBASE_PASSWORD_RESET_EMAIL,\n  LOGOUT_FIREBASE_USER,\n} from './types';\n\n\nexport function loginWithProvider(provider) {    \n  return {\n    type: LOGIN_WITH_PROVIDER_FIREBASE,\n    provider,\n  };\n}\n\nexport function registerUser(user) {    \n  return {\n    type: REGISTER_FIREBASE_USER,\n    user\n  };\n}\n\nexport function loginUser(user) {    \n  return {\n      type: LOGIN_FIREBASE_USER,\n      user\n  };\n}\n\nexport function fetchUser() {  \n  return {\n    type: FETCH_FIREBASE_USER    \n  };\n}\n\nexport function updateUser(user) {\n  return {\n    type: UPDATE_FIREBASE_USER,\n    user\n  };\n}\n\nexport function changePassword(newPassword) {  \n  return {\n    type: CHANGE_FIREBASE_USER_PASSWORD,\n    newPassword\n  };\n}\n\nexport function resetPasswordEmail(email) {  \n  return {\n    type: FIREBASE_PASSWORD_RESET_EMAIL,\n    email\n  };\n}\n\nexport function logoutUser(user) {  \n  return {\n    type: LOGOUT_FIREBASE_USER,\n    user\n  };\n}\n"
  },
  {
    "path": "src/app/actions/index.js",
    "content": ""
  },
  {
    "path": "src/app/actions/types.js",
    "content": "\n\n// / FIREBASE AUTH ACTIONS\nexport const LOGIN_WITH_PROVIDER_FIREBASE = 'LOGIN_WITH_PROVIDER_FIREBASE';\nexport const REGISTER_FIREBASE_USER = 'REGISTER_FIREBASE_USER';\nexport const LOGIN_FIREBASE_USER = 'LOGIN_FIREBASE_USER';\nexport const FETCH_FIREBASE_USER = 'FETCH_FIREBASE_USER';\nexport const UPDATE_FIREBASE_USER = 'UPDATE_FIREBASE_USER';\nexport const CHANGE_FIREBASE_USER_PASSWORD = 'CHANGE_FIREBASE_USER_PASSWORD';\nexport const FIREBASE_PASSWORD_RESET_EMAIL = 'FIREBASE_PASSWORD_RESET_EMAIL';\nexport const LOGOUT_FIREBASE_USER = 'LOGOUT_FIREBASE_USER';\n"
  },
  {
    "path": "src/app/bundle.scss",
    "content": "@import './components/app';"
  },
  {
    "path": "src/app/components/app.jsx",
    "content": "import React, { Component } from 'react';\nimport { Link } from 'react-router';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { fetchUser, logoutUser } from '../actions/firebase_actions';\nimport FireBaseTools from '../utils/firebase'\n\nconsole.log(FireBaseTools.getDatabaseReference);\n\nclass App extends Component {\n\n  constructor(props) {\n    super(props);\n\n    this.props.fetchUser();    \n  }\n\n  _logOut() {\n    this.props.logoutUser().then((data) => {\n      // reload props from reducer\n      this.props.fetchUser();\n    });\n  }\n\n  _read() {\n    FireBaseTools.getDatabaseReference('/DongerMaster').once('value').then(function(snapshot) {\n      console.log(snapshot.val());\n    });\n  }\n\n  _write() {\n    FireBaseTools.getDatabaseReference('/').set({DongerMaster: 'lul'});\n  }\n\n  _renderUserMenu(currentUser) {\n    // if current user exists and user id exists than make user navigation\n    if (currentUser && currentUser.uid) {\n      return (\n        <li className=\"dropdown\">\n          <a\n            href=\"#\" className=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\"\n            aria-haspopup=\"true\" aria-expanded=\"false\"\n          > {currentUser.email}<span className=\"caret\" />\n          </a>\n          <ul className=\"dropdown-menu\">\n            <li><Link to=\"/profile\">Profile</Link></li>\n            <li role=\"separator\" className=\"divider\" />\n            <li><Link to=\"/logout\" onClick={() => this._logOut}>Logout</Link></li>\n          </ul>\n        </li>\n      );\n    } else {\n      return [\n        <li key={1}><Link to=\"/login\">Login</Link></li>,\n        <li key={2}><Link to=\"/register\">Register</Link></li>,\n      ];\n    }\n  }\n\n  render() {\n    return (      \n      <div>\n      <button onClick={() => this._read()}>read</button>\n      <button onClick={() => this._write()}>write</button>\n        <header className=\"navbar navbar-static-top navbar-inverse\" id=\"top\" role=\"banner\">\n          <div className=\"container\">\n            <div className=\"navbar-header\">\n              <button\n                className=\"navbar-toggle collapsed\" type=\"button\" data-toggle=\"collapse\" data-target=\".bs-navbar-collapse\">\n                <span className=\"sr-only\">Toggle navigation</span>\n                <span className=\"icon-bar\" />\n                <span className=\"icon-bar\" />\n                <span className=\"icon-bar\" />\n              </button>\n              <Link to=\"/\" className=\"navbar-brand\">Firebase & Redux boilerplate</Link>\n              </div>\n              <nav className=\"collapse navbar-collapse bs-navbar-collapse\" role=\"navigation\">\n                <ul className=\"nav navbar-nav\">\n                  <li><Link to=\"/\"> Home</Link></li>,\n                </ul>\n                <ul className=\"nav navbar-nav navbar-right\">\n                    { this._renderUserMenu(this.props.currentUser) }\n                </ul>\n              </nav>\n          </div>\n        </header>\n\n        <div className=\"container\">\n         {this.props.children}\n        </div>\n      </div>\n    );\n  }\n}\n\nfunction mapDispatchToProps(dispatch) {\n  return bindActionCreators({ fetchUser, logoutUser }, dispatch);\n}\n\n\nfunction mapStateToProps(state) {\n  return { currentUser: state.currentUser };\n}\n\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n"
  },
  {
    "path": "src/app/components/app.scss",
    "content": "body {\n  font-size: 16px;\n}\n"
  },
  {
    "path": "src/app/components/helpers/loading.jsx",
    "content": "import React from 'react';\n\n\nconst Loading = () => {\n    return (\n    <div className=\"col-md-4\">\n      Loading ....\n    </div>\n  );\n};\n\nexport default Loading;\n"
  },
  {
    "path": "src/app/components/index_home.jsx",
    "content": "import React from 'react';\n\nexport default () => {\n  return <div> Home Page of our application! </div>;\n};\n"
  },
  {
    "path": "src/app/components/user/change_password.jsx",
    "content": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { changePassword } from '../../actions/firebase_actions';\n\nclass ChangePassword extends Component {\n\n  constructor(props) {\n      super(props);\n      this.onFormSubmit = this.onFormSubmit.bind(this);\n      this.state = {\n        message: '',\n    };\n  }\n\n  onFormSubmit(event) {\n      event.preventDefault();\n      let password = this.refs.password.value;\n      let repeatPassword = this.refs.repeatPassword.value;\n      if (password !== repeatPassword) {\n        this.setState({\n          message: 'Please password must match!',\n      });\n    } else {\n        this.props.changePassword(password).then((data) => {\n          if (data.payload.errorCode)\n            this.setState({ message: data.payload.errorMessage });\n          else\n          this.setState({ message: 'Password was changed!' });\n      });\n    }\n  }\n\n    render() {\n      return (\n      <form id=\"ChangePassword\" role=\"form\" onSubmit={this.onFormSubmit}>\n        <h4> Change Password </h4>\n        <h5> {this.state.message} </h5>\n        <div className=\"form-group\">\n          <label htmlFor=\"password\"> New Password: </label>\n          <input type=\"password\" className=\"form-control\"\n            name=\"password\" ref=\"password\" id=\"password\" \n          />\n        </div>\n        <div className=\"form-group\">\n          <label htmlFor=\"repeatPassword\"> Repeat Password: </label>\n          <input type=\"password\" className=\"form-control\"\n            name=\"repeatPassword\" ref=\"repeatPassword\" id=\"repeatPassword\" \n          />\n\n        </div>\n        <button type=\"submit\" className=\"btn btn-primary\">Change Password</button>\n      </form>\n    );\n  }\n\n}\n\n\nfunction mapDispatchToProps(dispatch) {\n    return bindActionCreators({ changePassword }, dispatch);\n}\n\nfunction mapStateToProps(state) {\n    return { currentUser: state.currentUser };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ChangePassword);\n"
  },
  {
    "path": "src/app/components/user/login.jsx",
    "content": "import React, { Component } from 'react';\nimport { browserHistory, Link } from 'react-router';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { loginUser, fetchUser, loginWithProvider } from '../../actions/firebase_actions';\n\n\nclass UserLogin extends Component {\n\n    constructor(props) {\n        super(props);\n        this.onFormSubmit = this.onFormSubmit.bind(this);\n        this.loginWithProvider = this.loginWithProvider.bind(this);\n        this.state = {\n            message: '',\n        };\n    }\n\n    onFormSubmit(event) {\n        event.preventDefault();\n\n        const email = this.refs.email.value;\n        const password = this.refs.password.value;\n        this.props.loginUser({ email, password }).then((data) => {\n            if (data.payload.errorCode) {\n                this.setState({ message: data.payload.errorMessage });\n            } else {\n                browserHistory.push('/profile');\n            }\n        }\n    );\n    }\n\n    loginWithProvider(provider) {\n        this.props.loginWithProvider(provider).then((data) => {\n            if (data.payload.errorCode) {\n                this.setState({ message: data.payload.errorMessage });\n            } else {\n                browserHistory.push('/profile');\n            }\n        });\n    }\n\n    render() {\n        return (\n            <div className=\"col-md-4\">\n                <form id=\"frmLogin\" role=\"form\" onSubmit={this.onFormSubmit}>\n                    <p>\n                        {this.state.message}\n                    </p>\n                    <h2>Login</h2>\n                    <div className=\"form-group\">\n                        <label htmlFor=\"txtEmail\">Email address</label>\n                        <input\n                          type=\"email\" className=\"form-control\" id=\"txtEmail\" ref=\"email\" placeholder=\"Enter email\"\n                          name=\"email\"\n                        />\n                    </div>\n                    <div className=\"form-group\">\n                        <label htmlFor=\"txtPass\">Password</label>\n                        <input\n                          type=\"password\" className=\"form-control\" id=\"txtPass\" ref=\"password\" placeholder=\"Password\"\n                          name=\"password\"\n                        />\n                    </div>\n                    <button type=\"submit\" className=\"btn btn-default btn-block\">Login</button>\n                    <br />\n                    <h5><Link to=\"/reset\">Forgot password?</Link></h5>\n\n                    <h4>Login with</h4>\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-facebook\" onClick={() => {\n                          this.loginWithProvider('facebook');\n                      }} data-provider=\"facebook\"\n                    >Facebook</a>\n\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-twitter\" onClick={() => {\n                          this.loginWithProvider('twitter');\n                      }} data-provider=\"twitter\"\n                    >Twitter</a>\n\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-google\" onClick={() => {\n                          this.loginWithProvider('google');\n                      }} data-provider=\"twitter\"\n                    >Google</a>\n\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-github\" onClick={() => {\n                          this.loginWithProvider('github');\n                      }} data-provider=\"twitter\"\n                    >Github</a>\n\n                </form>\n            </div>\n\n        );\n    }\n\n}\n\nfunction mapDispatchToProps(dispatch) {\n    return bindActionCreators({\n        loginUser,\n        fetchUser,\n        loginWithProvider,\n    }, dispatch);\n}\n\nfunction mapStateToProps(state) {\n    return { currentUser: state.currentUser };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UserLogin);\n"
  },
  {
    "path": "src/app/components/user/logout.jsx",
    "content": "import React from 'react';\n\n\nexport default () => (\n    <form id=\"frmLogout\" role=\"form\">\n        <h2>You are logged out!</h2>\n    </form>\n  );\n"
  },
  {
    "path": "src/app/components/user/profile.jsx",
    "content": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport firebase from '../../utils/firebase';\n\n\nimport { fetchUser, updateUser } from '../../actions/firebase_actions';\nimport Loading from '../helpers/loading';\nimport ChangePassword from './change_password';\n\nclass UserProfile extends Component {\n\n    constructor(props) {\n        super(props);\n        this.props.fetchUser();\n        this.state = {\n            message: '',\n        };\n        this.onFormSubmit = this.onFormSubmit.bind(this);\n    }\n\n    onFormSubmit(event) {\n        event.preventDefault();\n        const email = this.refs.email.value;\n        const displayName = this.refs.displayName.value;\n        this.props.updateUser({ email, displayName }).then((data) => {\n            if (data.payload.errorCode) {\n                this.setState({ message: data.payload.errorMessage });\n            } else {\n                this.setState({\n                    message: 'Updated successfuly!',\n                });\n            }\n        }\n    );\n    }\n\n    render() {\n        if (!this.props.currentUser) {\n            return <Loading />;\n        }\n\n        return (\n            <div className=\"col-md-6\">\n                <form id=\"frmProfile\" role=\"form\" onSubmit={this.onFormSubmit}>\n                    <h2>User Profile Page</h2>\n                    <p>{this.state.message}</p>\n                    <br />\n                    <div className=\"form-group\">\n                        <label htmlFor=\"email\">Email: </label>\n                        <input\n                          type=\"text\" defaultValue={this.props.currentUser.email}\n                          className=\"form-control\" id=\"email\" ref=\"email\" placeholder=\"Email\" name=\"email\"\n                        />\n                    </div>\n                    <div className=\"form-group\">\n                        <label htmlFor=\"displayName\">Display name: </label>\n                        <input\n                          type=\"text\" defaultValue={this.props.currentUser.displayName}\n                          className=\"form-control\" ref=\"displayName\" id=\"displayName\" placeholder=\"Display name\"\n                          name=\"displayName\"\n                        />\n                    </div>\n                    <button type=\"submit\" className=\"btn btn-primary\">Update</button>\n                </form>\n                <ChangePassword />\n            </div>\n        );\n    }\n\n}\n\n\nfunction mapDispatchToProps(dispatch) {\n    return bindActionCreators({ fetchUser, updateUser }, dispatch);\n}\n\n\nfunction mapStateToProps(state) {\n    return { currentUser: state.currentUser };\n}\n\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UserProfile);\n"
  },
  {
    "path": "src/app/components/user/register.jsx",
    "content": "import React, { Component } from 'react';\nimport { browserHistory } from 'react-router';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { registerUser } from '../../actions/firebase_actions';\n\nclass UserRegister extends Component {\n    constructor(props) {\n        super(props);\n        this.onFormSubmit = this.onFormSubmit.bind(this);\n        this.state = {\n            message: '',\n        };\n    }\n\n    onFormSubmit(event) {\n        event.preventDefault();\n\n        const email = this.refs.email.value;\n        const password = this.refs.password.value;\n        this.props.registerUser({ email, password }).then((data) => {\n            if (data.payload.errorCode) {\n                this.setState({ message: data.payload.errorMessage })\n              ;\n            } else {\n                browserHistory.push('/profile');\n            }\n        }\n    );\n    }\n\n    render() {\n        return (\n            <div className=\"col-md-4\">\n                <form id=\"frmRegister\" role=\"form\" onSubmit={this.onFormSubmit}>\n                    <p>{this.state.message}</p>\n                    <h2>Register</h2>\n                    <div className=\"form-group\">\n                        <label htmlFor=\"txtRegEmail\">Email address</label>\n                        <input\n                          type=\"email\" className=\"form-control\" ref=\"email\" id=\"txtEmail\" placeholder=\"Enter email\"\n                          name=\"email\"\n                        />\n                    </div>\n                    <div className=\"form-group\">\n                        <label htmlFor=\"txtRegPass\">Password</label>\n                        <input\n                          type=\"password\" className=\"form-control\" ref=\"password\" id=\"txtPass\" placeholder=\"Password\"\n                          name=\"password\"\n                        />\n                    </div>\n                    <button type=\"submit\" className=\"btn btn-default\">Register</button>\n                    <br /> <br />\n\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-facebook\" onClick={() => {\n                          this.loginWithProvider('facebook');\n                      }} data-provider=\"facebook\"\n                    >Facebook</a>\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-twitter\" onClick={() => {\n                          this.loginWithProvider('twitter');\n                      }} data-provider=\"twitter\"\n                    >Twitter</a>\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-google\" onClick={() => {\n                          this.loginWithProvider('google');\n                      }} data-provider=\"twitter\"\n                    >Google</a>\n                    <a\n                      href=\"#\" className=\"btn btn-block btn-social btn-github\" onClick={() => {\n                          this.loginWithProvider('github');\n                      }} data-provider=\"twitter\"\n                    >Github</a>\n\n                </form>\n            </div>\n        );\n    }\n\n}\n\nfunction mapDispatchToProps(dispatch) {\n    return bindActionCreators({\n        registerUser,\n    }, dispatch);\n}\n\nfunction mapStateToProps(state) {\n    return { currentUser: state.currentUser };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UserRegister);\n"
  },
  {
    "path": "src/app/components/user/reset_password.jsx",
    "content": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { resetPasswordEmail } from '../../actions/firebase_actions';\n\nclass ResetPassword extends Component {\n    constructor(props) {\n        super(props);\n        this.state = {\n            message: '',\n        };\n        this.onFormSubmit = this.onFormSubmit.bind(this);\n    }\n\n    onFormSubmit(event) {\n        event.preventDefault();\n        const email = this.refs.email.value;\n        this.props.resetPasswordEmail(email).then((data) => {\n            if (data.payload.errorCode) {\n                this.setState({ message: data.payload.errorMessage });\n            } else {\n                this.setState({ message: 'Please see your email!' });\n            }\n        });\n    }\n\n    render() {\n        return (\n\n            <div className=\"col-md-4\">\n                <form role=\"form\" onSubmit={this.onFormSubmit}>\n                  <h4>{this.state.message}</h4>\n                  <div className=\"form-group\">\n                    <label htmlFor=\"txtEmail\">Email address</label>\n                    <input\n                    type=\"email\" className=\"form-control\" id=\"txtEmail\" ref=\"email\" placeholder=\"Enter email\"\n                    name=\"email\"\n                  />\n                </div>\n                  <button type=\"submit\" className=\"btn btn-default btn-block\">Reset Password</button>\n              </form>\n            </div>\n\n        );\n    }\n}\n\nfunction mapDispatchToProps(dispatch) {\n    return bindActionCreators({\n        resetPasswordEmail,\n    }, dispatch);\n}\n\nexport default connect(null, mapDispatchToProps)(ResetPassword);\n"
  },
  {
    "path": "src/app/config.js",
    "content": "module.exports = {\n\n  // Change this to your firebase configuration! (Add Firebase to your web app)\n    FIREBASE_CONFIG: {\n      apiKey: \"AIzaSyBgD4q3YujiPOOt4sPAfBHzBtG6xENp-TE\",\n      authDomain: \"adwebsite-928a9.firebaseapp.com\",\n      databaseURL: \"https://adwebsite-928a9.firebaseio.com\",\n      projectId: \"adwebsite-928a9\",\n      storageBucket: \"adwebsite-928a9.appspot.com\",\n      messagingSenderId: \"72060758788\"\n    },\n};\n"
  },
  {
    "path": "src/app/index.jsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport { Router, browserHistory } from 'react-router';\nimport { createLogger } from 'redux-logger';\nimport ReduxPromise from 'redux-promise';\n\n\nimport reducers from './reducers';\nimport routes from './routes';\n\nimport 'bootstrap-social';\n\n// for bundling your styles\nimport './bundle.scss';\n\nconst createStoreWithMiddleware = applyMiddleware(ReduxPromise)(createStore);\n\n// Redux Dev tools\nconst composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n\nconst logger = createLogger();\n\nconst enhancers = [applyMiddleware(ReduxPromise, logger)];\n\nconst store = createStore(reducers, composeEnhancers(...enhancers));\n\nReactDOM.render(\n    <Provider store={store}>\n        <Router history={browserHistory} routes={routes} />\n    </Provider>, \n    document.querySelector('.react-root')\n);\n"
  },
  {
    "path": "src/app/reducers/firebase_user_reducer.js",
    "content": "import FireBaseTools from '../utils/firebase';\nimport {\n  LOGIN_WITH_PROVIDER_FIREBASE,\n  REGISTER_FIREBASE_USER,\n  LOGIN_FIREBASE_USER,\n  FETCH_FIREBASE_USER,\n  UPDATE_FIREBASE_USER,\n  CHANGE_FIREBASE_USER_PASSWORD,\n  FIREBASE_PASSWORD_RESET_EMAIL,\n  LOGOUT_FIREBASE_USER,\n} from '../actions/types';\n\n\nexport default function (state = null, action) {\n  switch (action.type) {\n    \n  case FETCH_FIREBASE_USER:\n    return fetchUser();\n\n  case LOGOUT_FIREBASE_USER:\n    return logoutUser(action.user);\n\n  case REGISTER_FIREBASE_USER:\n    return registerUser(action.user);\n\n  case LOGIN_FIREBASE_USER:\n    return loginUser(action.user);\n\n  case UPDATE_FIREBASE_USER:\n    return updateUser(action.user);\n\n  case CHANGE_FIREBASE_USER_PASSWORD:\n    return changePassword(action.newPassword);\n\n  case FIREBASE_PASSWORD_RESET_EMAIL:\n    return resetPasswordEmail(action.email);\n\n  case LOGIN_WITH_PROVIDER_FIREBASE:\n    return loginWithProvider(action.provider);\n\n  default:\n    return state;\n\n  }\n}\n\nfunction loginWithProvider(provider) {\n  FireBaseTools.loginWithProvider(provider);\n}\n\nfunction registerUser(user) {\n  FireBaseTools.registerUser(user);\n}\n\nfunction loginUser(user) {\n  FireBaseTools.loginUser(user);\n}\n\nfunction fetchUser() {\n  FireBaseTools.fetchUser();\n}\n\nfunction updateUser(user) {\n  FireBaseTools.updateUserProfile(user);\n}\n\nfunction changePassword(newPassword) {\n  FireBaseTools.changePassword(newPassword);\n}\n\nfunction resetPasswordEmail(email) {\n  FireBaseTools.resetPasswordEmail(email);\n}\n\nfunction logoutUser(user) {\n  FireBaseTools.logoutUser(user);\n}\n"
  },
  {
    "path": "src/app/reducers/index.js",
    "content": "import { combineReducers } from 'redux';\nimport FireBaseUserReducer from './firebase_user_reducer';\n\nconst rootReducer = combineReducers({\n    currentUser: FireBaseUserReducer,\n});\n\nexport default rootReducer;\n"
  },
  {
    "path": "src/app/routes.jsx",
    "content": "import React from 'react';\nimport { Route, IndexRoute } from 'react-router';\nimport App from './components/app';\n\nimport HomeIndex from './components/index_home';\nimport UserLogin from './components/user/login';\nimport UserLogout from './components/user/logout';\nimport UserRegister from './components/user/register';\nimport UserProfile from './components/user/profile';\nimport ResetPassword from './components/user/reset_password';\nimport requireAuth from './utils/authenticated';\n\nexport default (\n    <Route path=\"/\" component={App}>\n        <IndexRoute component={HomeIndex} />\n        <Route path=\"/login\" component={UserLogin} />\n        <Route path=\"/logout\" component={UserLogout} />\n        <Route path=\"/register\" component={UserRegister} />\n        <Route path=\"/reset\" component={ResetPassword} />\n        <Route path=\"/profile\" component={UserProfile} onEnter={requireAuth} />\n    </Route>\n\n);\n"
  },
  {
    "path": "src/app/utils/authenticated.js",
    "content": "function requireAuth(nextState, replace) {\n    const key = Object.keys(localStorage).find(e => e.match(/firebase:authUser/));\n    const data = JSON.parse(localStorage.getItem(key));\n    if (data == null) {\n        replace({\n            pathname: '/login',\n            state: {\n                nextPathname: nextState.location.pathname,\n            },\n        });\n    }\n}\n\nmodule.exports = requireAuth;\n"
  },
  {
    "path": "src/app/utils/firebase.js",
    "content": "import firebase from 'firebase';\nimport { FIREBASE_CONFIG } from '../config';\n\nexport const firebaseApp = firebase.initializeApp(FIREBASE_CONFIG);\nexport const firebaseAuth = firebaseApp.auth();\nexport const firebaseDb = firebaseApp.database();\n\nconst FireBaseTools = {\n\n  /**\n   * Return an instance of a firebase auth provider based on the provider string.\n   *\n   * @param provider\n   * @returns {firebase.auth.AuthProvider}\n   */\n    getProvider: (provider) => {\n        switch (provider) {\n        case 'email':\n            return new firebase.auth.EmailAuthProvider();\n        case 'facebook':\n            return new firebase.auth.FacebookAuthProvider();\n        case 'github':\n            return new firebase.auth.GithubAuthProvider();\n        case 'google':\n            return new firebase.auth.GoogleAuthProvider();\n        case 'twitter':\n            return new firebase.auth.TwitterAuthProvider();\n        default:\n            throw new Error('Provider is not supported!!!');\n        }\n    },\n\n  /**\n   * Login with provider => p is provider \"email\", \"facebook\", \"github\", \"google\", or \"twitter\"\n   * Uses Popup therefore provider must be an OAuth provider. EmailAuthProvider will throw an error\n   *\n   * @returns {any|!firebase.Thenable.<*>|firebase.Thenable<any>}\n   */\n    loginWithProvider: (p) => {\n        const provider = FireBaseTools.getProvider(p);\n        return firebaseAuth.signInWithPopup(provider).then(firebaseAuth.currentUser).catch(error => ({\n            errorCode: error.code,\n            errorMessage: error.message,\n        }));\n    },\n\n  /**\n   * Register a user with email and password\n   *\n   * @param user\n   * @returns {any|!firebase.Thenable.<*>|firebase.Thenable<any>}\n   */\n    registerUser: user => firebaseAuth.createUserWithEmailAndPassword(user.email, user.password)\n        .then(userInfo => userInfo)\n        .catch(error => ({\n            errorCode: error.code,\n            errorMessage: error.message,\n        })),\n\n  /**\n   * Sign the user out\n   *\n   * @returns {!firebase.Promise.<*>|firebase.Thenable<any>|firebase.Promise<any>|!firebase.Thenable.<*>}\n   */\n    logoutUser: () => firebaseAuth.signOut().then(() => ({\n        success: 1,\n        message: 'logout',\n    })),\n\n  /**\n   * Retrieve the current user (Promise)\n   * @returns {Promise}\n   */\n    fetchUser: () => new Promise((resolve, reject) => {\n        const unsub = firebaseAuth.onAuthStateChanged((user) => {\n            unsub();\n            resolve(user);\n        }, (error) => {\n            reject(error);\n        });\n    }),\n\n  /**\n   * Log the user in using email and password\n   *\n   * @param user\n   * @returns {any|!firebase.Thenable.<*>|firebase.Thenable<any>}\n   */\n    loginUser: user => firebaseAuth.signInWithEmailAndPassword(user.email, user.password)\n        .then(userInfo => userInfo)\n        .catch(error => ({\n            errorCode: error.code,\n            errorMessage: error.message,\n        })),\n\n  /**\n   * Update a user's profile data\n   *\n   * @param u\n   * @returns {!firebase.Promise.<*>|firebase.Thenable<any>|firebase.Promise<any>|!firebase.Thenable.<*>}\n   */\n    updateUserProfile: u => firebaseAuth.currentUser.updateProfile(u).then(() => firebaseAuth.currentUser, error => ({\n        errorCode: error.code,\n        errorMessage: error.message,\n    })),\n\n  /**\n   * Reset the password given the specified email\n   *\n   * @param email {string}\n   * @returns {!firebase.Promise.<*>|firebase.Thenable<any>|firebase.Promise<any>|!firebase.Thenable.<*>}\n   */\n    resetPasswordEmail: email => firebaseAuth.sendPasswordResetEmail(email).then(() => ({\n        message: 'Email sent',\n    }), error => ({\n        errorCode: error.code,\n        errorMessage: error.message,\n    })),\n\n  /**\n   * Update the user's password with the given password\n   *\n   * @param newPassword {string}\n   * @returns {!firebase.Promise.<*>|firebase.Thenable<any>|firebase.Promise<any>|!firebase.Thenable.<*>}\n   */\n    changePassword: newPassword => firebaseAuth.currentUser.updatePassword(newPassword).then(user => user, error => ({\n        errorCode: error.code,\n        errorMessage: error.message,\n    })),\n\n  /**\n   * Send an account email verification message for the currently logged in user\n   *\n   * @returns {!firebase.Promise.<*>|firebase.Thenable<any>|firebase.Promise<any>|!firebase.Thenable.<*>}\n   */\n    sendEmailVerification: () => firebaseAuth.currentUser.sendEmailVerification().then(() => ({\n        message: 'Email sent',\n    }), error => ({\n        errorCode: error.code,\n        errorMessage: error.message,\n    })),\n\n  /**\n   * Get the firebase database reference.\n   *\n   * @param path {!string|string}\n   * @returns {!firebase.database.Reference|firebase.database.Reference}\n   */\n    getDatabaseReference: path => firebaseDb.ref(path),\n};\n\nexport default FireBaseTools;\n"
  },
  {
    "path": "src/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n  <meta name=\"robots\" content=\"index,follow\"/>\n  <meta name=\"googlebot\" content=\"index,follow\"/>\n  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/>\n  <title>React, Redux & Firebase Boilerplate</title>\n  <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css\"\n        crossorigin=\"anonymous\">\n  <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\"\n        integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\">\n  <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css\"\n        integrity=\"sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp\" crossorigin=\"anonymous\">\n</head>\n<body>\n<div class=\"react-root\"></div>\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js\"></script>\n<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"\n        integrity=\"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\"\n        crossorigin=\"anonymous\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "test/components/app_test.js",
    "content": "import {renderComponent, expect} from '../test_helper';\nimport App from '../../src/app/components/app';\n\ndescribe('App', () => {\n  let component;\n\n  beforeEach(() => {\n    component = renderComponent(App);\n  });\n\n  it('renders something', () => {\n    expect(component).to.exist;\n  });\n});\n"
  },
  {
    "path": "test/test_helper.js",
    "content": "import _$ from 'jquery';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport TestUtils from 'react-addons-test-utils';\nimport jsdom from 'jsdom';\nimport chai, { expect } from 'chai';\nimport chaiJquery from 'chai-jquery';\nimport { Provider } from 'react-redux';\nimport { createStore } from 'redux';\nimport reducers from '../src/app/reducers';\n\nglobal.document = jsdom.jsdom('<!doctype html><html><body></body></html>');\nglobal.window = global.document.defaultView;\nglobal.navigator = global.window.navigator;\nconst $ = _$(window);\n\nchaiJquery(chai, chai.util, $);\n\nfunction renderComponent(ComponentClass, props = {}, state = {}) {\n  const componentInstance =  TestUtils.renderIntoDocument(\n    <Provider store={createStore(reducers, state)}>\n      <ComponentClass {...props} />\n    </Provider>\n  );\n\n  return $(ReactDOM.findDOMNode(componentInstance));\n}\n\n$.fn.simulate = function(eventName, value) {\n  if (value) {\n    this.val(value);\n  }\n  TestUtils.Simulate[eventName](this[0]);\n};\n\nexport {renderComponent, expect};\n"
  },
  {
    "path": "webpack/webpack-dev.config.js",
    "content": "module.exports = require('./webpack.config.js')({\n  isProduction: false,\n  devtool: 'cheap-module-source-map',\n  jsFileName: 'app.js',\n  cssFileName: 'app.css',\n  port: 3000,\n});\n"
  },
  {
    "path": "webpack/webpack-prod.config.js",
    "content": "module.exports = require('./webpack.config.js')({\n  isProduction: true,\n  devtool: 'source-map',\n  jsFileName: 'app.[hash].js',\n  cssFileName: 'app.[hash].css',\n});\n"
  },
  {
    "path": "webpack/webpack.config.js",
    "content": "const Path = require('path');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst Webpack = require('webpack');\nconst ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nmodule.exports = (options) => {\n  const ExtractSASS = new ExtractTextPlugin(`/styles/${options.cssFileName}`);\n\n  const webpackConfig = {\n    devtool: options.devtool,\n    entry: [\n      `webpack-dev-server/client?http://localhost:${+options.port}`,\n      'webpack/hot/dev-server',\n      Path.join(__dirname, '../src/app/index'),\n    ],\n    output: {\n      path: Path.join(__dirname, '../dist'),\n      filename: `/scripts/${options.jsFileName}`,\n    },\n    resolve: {\n      extensions: ['', '.js', '.jsx'],\n    },\n    module: {\n      loaders: [\n        {test: /.jsx?$/, include: Path.join(__dirname, '../src/app'), loader: 'babel',},\n        {test: /\\.jsx?$/, exclude: /(node_modules|bower_components)/, loader: 'babel'},\n        {test: /\\.css$/, loader: 'style-loader!css-loader'},\n        {test: /\\.eot(\\?v=\\d+\\.\\d+\\.\\d+)?$/, loader: \"file\"},\n        {test: /\\.(woff|woff2)$/, loader: \"url?prefix=font/&limit=5000\"},\n        {test: /\\.ttf(\\?v=\\d+\\.\\d+\\.\\d+)?$/, loader: \"url?limit=10000&mimetype=application/octet-stream\"},\n        {test: /\\.svg(\\?v=\\d+\\.\\d+\\.\\d+)?$/, loader: \"url?limit=10000&mimetype=image/svg+xml\"}\n      ],\n    },\n    plugins: [\n      new Webpack.DefinePlugin({\n        'process.env': {\n          NODE_ENV: JSON.stringify(options.isProduction ? 'production' : 'development'),\n        },\n      }),\n      new HtmlWebpackPlugin({\n        template: Path.join(__dirname, '../src/index.html'),\n      }),\n    ],\n  };\n\n  if (options.isProduction) {\n    webpackConfig.entry = [Path.join(__dirname, '../src/app/index')];\n\n    webpackConfig.plugins.push(\n      new Webpack.optimize.OccurenceOrderPlugin(),\n      new Webpack.optimize.UglifyJsPlugin({\n        compressor: {\n          warnings: false,\n        },\n      }),\n      ExtractSASS\n    );\n\n    webpackConfig.module.loaders.push({\n      test: /\\.scss$/,\n      loader: ExtractSASS.extract(['css', 'sass']),\n    });\n  } else {\n    webpackConfig.plugins.push(\n      new Webpack.HotModuleReplacementPlugin()\n    );\n\n    webpackConfig.module.loaders.push({\n      test: /\\.scss$/,\n      loaders: ['style', 'css', 'sass'],\n    });\n\n    webpackConfig.devServer = {\n      contentBase: Path.join(__dirname, '../'),\n      hot: true,\n      port: options.port,\n      inline: true,\n      progress: true,\n      historyApiFallback: true,\n    };\n  }\n\n  return webpackConfig;\n};\n"
  },
  {
    "path": "www.js",
    "content": "const express = require('express');\nconst app = express();\n\napp.use(express.static('./'));\napp.use(express.static('dist'));\n\napp.get('*', (req, res) => {\n    res.sendFile(`${__dirname}/dist/index.html`);\n});\n\nconst port = process.env.PORT || 3000;\n\napp.listen(port, () => {\n    console.log('app listening on', port);\n});\n"
  }
]