2015-12-07 14:06:16 +03:00
|
|
|
# Mozlando Frontend Demo
|
|
|
|
|
2015-12-10 00:12:23 +03:00
|
|
|
Original sample code is on [erikras/react-redux-universal-hot-example](https://github.com/erikras/react-redux-universal-hot-example/).
|
|
|
|
|
2015-12-07 14:06:16 +03:00
|
|
|
This is an experiment to test out what Redux + React + universal JS looks
|
|
|
|
like as a demo Addons front-end.
|
|
|
|
|
|
|
|
The idea to it to try and do the following:
|
|
|
|
|
|
|
|
* Create a basic fake search API that returns random data.
|
|
|
|
* Create a basic search result page.
|
|
|
|
* Play with forms that work server-side only as well as via redux.
|
|
|
|
* It doesn't need to look pretty though we can hack together some styles.
|
|
|
|
|
|
|
|
## Getting started
|
|
|
|
|
2015-12-08 22:44:10 +03:00
|
|
|
* You'll need `nvm` + `node 4.x` + `npm 3.x` to be able to install the node
|
2015-12-08 22:47:39 +03:00
|
|
|
deps. You may need to `npm install -g npm` after updating node.
|
2015-12-08 22:44:10 +03:00
|
|
|
* Once you have that install the deps with `npm install`.
|
2015-12-07 14:06:16 +03:00
|
|
|
* To fire things up use `npm run dev`.
|
2015-12-13 23:26:27 +03:00
|
|
|
* The redux devtools can be shown with `ctrl+shift+h`.
|
2015-12-07 14:06:16 +03:00
|
|
|
|
2015-12-14 12:34:40 +03:00
|
|
|
## Running the production version.
|
2015-12-07 14:06:16 +03:00
|
|
|
|
2015-12-14 12:34:40 +03:00
|
|
|
The CSS only fully works with JS when running the dev server. To see it
|
|
|
|
without JS you'll need to build it for production.
|
2015-12-13 23:26:27 +03:00
|
|
|
|
|
|
|
To see the built-code running fully as a universal app you can built and run
|
|
|
|
it in production mode with:
|
|
|
|
|
|
|
|
```
|
|
|
|
npm run build
|
2015-12-14 13:02:17 +03:00
|
|
|
PORT=8080 npm run start
|
2015-12-13 23:26:27 +03:00
|
|
|
```
|
2015-12-14 12:34:40 +03:00
|
|
|
|
|
|
|
## Deploying to Heroku
|
|
|
|
|
|
|
|
* Set `heroku config:set NPM_CONFIG_PRODUCTION=false` to install dev deps.
|
|
|
|
* Push to heroku:master
|
|
|
|
|
|
|
|
## Demo Site
|
|
|
|
|
|
|
|
See https://mozlando-frontend-demo.herokuapp.com/
|