- Universal React + Redux, Express application starter boilerplate.
- Universal React 16 + Redux, with Express server
- Sass. React CSS Modules automatic mapping of CSS modules
- React Router 4 + React Router Config
- HMR + Hot Reloading for both client & server
- React Universal Component for SSR, code splitting
- ESLint, Prettier and Stylelint for linting, formatting
- Progressive Web App (PWA), SEO ready
- Security - Express Helmet, HPP middlewares
- Babel 7, Webpack 4, ES6/ES7
i) Installation
- Node version: >= v6.0.0
git clone https://github.com/borisding/universsr.git my-project
cd my-project && npm install
Alternatively, you may also use
universsr-installer
that utilizes GitHub repository for installation.
ii) Configuration
- Copy example environment variables to
config
:
cp resources/config/.env.example resources/config/.env
You may change environment variables to serve your app. Avoid using the same port for both development and production.
When environment values are changed, we can run the following script to load new changes into process.env
:
npm run config
After script is executed, it will also create config-properties.json
for universal configuration usage in application, which is exported in config's index.js
iii) Running app
- For development:
npm run dev
- For production:
npm run build && npm start
- Both scripts will run config script as mentioned above.
- Please check package.json file for other available scripts.
- Deploying to production on Heroku:
- Remove or comment out
PORT
variable from.env
file (remember to remove.env
from.gitignore
) - Login with your credentials via command:
heroku login
- Create your app:
heroku create <your app name>
- Commit local changes and push to Heroku:
git push heroku master
- To visit deployed app:
heroku open
Node.js now installs
devDependencies
by default on Heroku.
MIT