├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .hound.yml ├── .travis.yml ├── LICENSE ├── README.md ├── index.js ├── package.json ├── src ├── Html.js ├── actions │ ├── __tests__ │ │ └── authActions.spec.js │ └── authActions.js ├── client.js ├── components │ ├── Alert.js │ ├── App.js │ ├── Button.js │ ├── CenteredBox.js │ ├── FormGroup.js │ ├── Header.js │ ├── Input.js │ ├── Label.js │ ├── LoginForm.js │ ├── LoginPage.js │ ├── Nav.js │ ├── NotFound.js │ ├── SignupForm.js │ └── SignupPage.js ├── config.js ├── constants │ └── actionTypes.js ├── containers │ ├── DashboardContainer.js │ ├── DevTools.js │ ├── LoginContainer.js │ ├── LogoutContainer.js │ ├── NavContainer.js │ └── SignupContainer.js ├── decorators │ └── RememberMe.js ├── middleware │ ├── authMiddleware.js │ └── promiseMiddleware.js ├── reducers │ ├── __tests__ │ │ └── auth.spec.js │ ├── auth.js │ ├── index.js │ └── users.js ├── routes.js ├── server.js ├── store │ └── configureStore.js └── utils │ └── createReducer.js ├── static ├── favicon.ico └── robots.txt ├── webpack-dev-server.js ├── webpack.config.dev.js └── webpack.config.prod.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react", "es2015", "stage-0"], 3 | "plugins": [ 4 | "transform-runtime", 5 | "add-module-exports", 6 | "transform-decorators-legacy", 7 | "transform-react-display-name" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | charset = utf-8 3 | indent_style = space 4 | end_of_line = lf 5 | indent_size = 2 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | 9 | [*.md] 10 | max_line_length = 0 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | webpack*.js 2 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaFeatures": { 3 | "jsx": true, 4 | "modules": true 5 | }, 6 | "env": { 7 | "browser": true, 8 | "node": true 9 | }, 10 | "parser": "babel-eslint", 11 | "rules": { 12 | "no-console": 1, 13 | "quotes": [2, "single"], 14 | "strict": [2, "never"], 15 | "comma-dangle": 1, 16 | "babel/object-shorthand": 1, 17 | "react/jsx-uses-react": 2, 18 | "react/jsx-no-duplicate-props": 2, 19 | "react/jsx-uses-vars": 2, 20 | "react/react-in-jsx-scope": 2, 21 | "react/jsx-no-undef": 2, 22 | # "react/jsx-space-before-closing": [2, "always"], 23 | "react/jsx-indent-props": [1, 2], 24 | "react/jsx-curly-spacing": [2, "never"], 25 | # "react/jsx-no-bind": 2, 26 | "react/prop-types": 1, 27 | "react/wrap-multilines": 1, 28 | "jsx-quotes": 2, 29 | "indent": [2, 2, {"SwitchCase": 1}], 30 | "curly": 1, 31 | "semi": 1, 32 | "space-in-parens": 1, 33 | "object-curly-spacing": [2, "always"], 34 | # "template-curly-spacing": 2, 35 | "array-bracket-spacing": 1, 36 | "handle-callback-err": 2 37 | }, 38 | "plugins": [ 39 | "babel", 40 | "react" 41 | ], 42 | "globals": { 43 | "__DEVELOPMENT__": true, 44 | "__CLIENT__": true, 45 | "__SERVER__": true, 46 | "__DEVTOOLS__": true 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | dist 4 | logs 5 | -------------------------------------------------------------------------------- /.hound.yml: -------------------------------------------------------------------------------- 1 | javascript: 2 | enabled: false 3 | eslint: 4 | enabled: true 5 | config_file: .eslintrc 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4.2" 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Zebhdiyah Pykosz 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## *UPDATE* :rotating_light: 2 | I've started working on a new boilerplate using the new [create-react-app](https://github.com/facebookincubator/create-react-app). There's no server side rendering, but it's more "lightweight". You can check it out here :point_right: [create-react-app-parse-redux](https://github.com/zebapy/create-react-app-parse-redux) 3 | 4 | # React Redux Parse Server 5 | [![Build Status](https://travis-ci.org/zebapy/react-redux-parse-server.svg?branch=master)](https://travis-ci.org/zebapy/react-redux-parse-server) 6 | [![Dependency Status](https://david-dm.org/zebapy/react-redux-parse-server.svg)](https://david-dm.org/zebapy/react-redux-parse-server) 7 | [![devDependency Status](https://david-dm.org/zebapy/react-redux-parse-server/dev-status.svg)](https://david-dm.org/zebapy/react-redux-parse-server#info=devDependencies) 8 | 9 | - Server side rendering with [ExpressJS](http://expressjs.com/) 10 | - Routing with the standard [React Router](https://github.com/reactjs/react-router) 11 | - [Redux](https://github.com/reactjs/redux) for state management 12 | - Debugging with [Redux DevTools](https://github.com/gaearon/redux-devtools) and [redux-logger](https://github.com/fcomb/redux-logger) middleware 13 | - [Redux Form](https://github.com/erikras/redux-form) for handling form state 14 | - API/Auth with [ParseServer](https://github.com/ParsePlatform/parse-server) 15 | - [Radium](https://github.com/FormidableLabs/radium) for inline styles (might be removed soon) 16 | - Linting with [ESLint](http://eslint.org/) 17 | - All transformed with [Babel](babeljs.io) 18 | 19 | ## Getting started 20 | 21 | 1. Install dependencies `npm install` 22 | 2. Make sure you have MongoDB running locally or you've swapped out the `databaseURI` in `src/server.js` 23 | - Read more about [ParseServer config](https://github.com/ParsePlatform/parse-server#parse-server--express) 24 | 3. Run server and Parse `npm start` 25 | 4. Open another terminal and run `npm run watch-client` to run Webpack to bundle files into `main.js`: 26 | 27 | ## Environment variables 28 | 29 | Parse has designated [environment variables](https://github.com/ParsePlatform/parse-server#using-environment-variables) you can use. 30 | 31 | 32 | # Disclaimer 33 | There are still a lot of things to tweak on this, so don't expect it to be 100% there just yet. If you have contributions, I'd be happy to check out a pull request. :zap: 34 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require('babel-register'); // babel registration (runtime transpilation for node) 2 | 3 | global.__DEVELOPMENT__ = process.env.NODE_ENV !== 'production'; 4 | global.__SERVER__ = true; 5 | global.__CLIENT__ = false; 6 | 7 | require('./src/server'); 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-redux-parse-server", 3 | "version": "0.1.0", 4 | "description": "A React Redux app set up with ParseServer", 5 | "main": "index.js", 6 | "scripts": { 7 | "clean": "rimraf static/dist", 8 | "start": "npm run start-prod", 9 | "start-prod": "NODE_ENV=production node index.js", 10 | "start-dev": "node index.js", 11 | "build": "npm run clean && npm run build:webpack", 12 | "build:webpack": "NODE_ENV=production webpack --config webpack.config.prod.js", 13 | "heroku-postbuild": "npm run build", 14 | "watch-client": "node webpack-dev-server", 15 | "dev": "concurrent --kill-others \"npm run start-dev\" \"npm run watch-client\"", 16 | "lint": "eslint -c .eslintrc src/", 17 | "test": "NODE_ENV=test mocha ./src/**/__tests__/*.spec.js --compilers js:babel-core/register", 18 | "test:watch": "npm test -- --watch" 19 | }, 20 | "author": "Zeb Pykosz (http://zeb.codes)", 21 | "license": "MIT", 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/zebapy/react-redux-parse-server.git" 25 | }, 26 | "bugs": { 27 | "url": "https://github.com/zebapy/react-redux-parse-server/issues" 28 | }, 29 | "engines": { 30 | "node": "4.2.1", 31 | "npm": "3.3.9" 32 | }, 33 | "dependencies": { 34 | "axios": "^0.11.0", 35 | "babel-core": "^6.7.6", 36 | "babel-loader": "^6.2.1", 37 | "babel-plugin-add-module-exports": "^0.2.0", 38 | "babel-plugin-transform-decorators-legacy": "^1.3.4", 39 | "babel-plugin-transform-react-display-name": "^6.5.0", 40 | "babel-plugin-transform-runtime": "^6.7.5", 41 | "babel-polyfill": "^6.7.4", 42 | "babel-preset-es2015": "^6.5.0", 43 | "babel-preset-react": "^6.5.0", 44 | "babel-preset-stage-0": "^6.5.0", 45 | "babel-register": "^6.7.2", 46 | "babel-runtime": "^6.5.0", 47 | "compression": "^1.6.1", 48 | "concurrently": "^2.0.0", 49 | "express": "^4.13.1", 50 | "normalizr": "^2.0.1", 51 | "parse-server": "^2.2.6", 52 | "radium": "^0.17.1", 53 | "react": "^15.0.1", 54 | "react-dom": "^15.0.1", 55 | "react-redux": "^4.4.4", 56 | "react-router": "^2.1.1", 57 | "redux": "^3.4.0", 58 | "redux-form": "^5.0.1", 59 | "redux-thunk": "^2.0.1", 60 | "rimraf": "^2.5.0", 61 | "serialize-javascript": "^1.1.2", 62 | "serve-favicon": "^2.3.0", 63 | "webpack": "^1.12.15" 64 | }, 65 | "devDependencies": { 66 | "babel-eslint": "^6.0.2", 67 | "babel-plugin-react-transform": "^2.0.2", 68 | "eslint": "^2.7.0", 69 | "eslint-plugin-babel": "^3.2.0", 70 | "eslint-plugin-react": "^5.0.1", 71 | "expect": "^1.16.0", 72 | "mocha": "^2.4.5", 73 | "react-transform-catch-errors": "^1.0.2", 74 | "react-transform-hmr": "^1.0.4", 75 | "redbox-react": "^1.2.3", 76 | "redux-devtools": "^3.2.0", 77 | "redux-devtools-dock-monitor": "^1.1.1", 78 | "redux-devtools-log-monitor": "^1.0.9", 79 | "redux-logger": "^2.5.2", 80 | "webpack-dev-middleware": "^1.6.1", 81 | "webpack-hot-middleware": "^2.10.0" 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/Html.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes } from 'react'; 2 | import { renderToString } from 'react-dom/server'; 3 | import serialize from 'serialize-javascript'; 4 | import { Style } from 'radium'; 5 | 6 | const styles = { 7 | '*': { 8 | boxSizing: 'border-box' 9 | }, 10 | body: { 11 | fontFamily: 'helvetica, arial, sans-serif', 12 | fontSize: '16px', 13 | backgroundColor: '#fff', 14 | margin: 0 15 | }, 16 | a: { 17 | color: 'tomato' 18 | } 19 | }; 20 | 21 | const Html = ({ assets, component, store }) => ( 22 | 23 | 24 | 25 |