Skip to content

zconnect-iot/device-simulator-frontend

Repository files navigation

Zconnect Demo (Front-End)

Setup

$ yarn install

Running in dev mode

$ npm start

Visit http://localhost:3000/ from your browser of choice. Server is visible from the local network as well.

It is using webpack dashboard, so please note the following:

OS X Terminal.app users: Make sure that View → Allow Mouse Reporting is enabled, otherwise scrolling through logs and modules won't work. If your version of Terminal.app doesn't have this feature, you may want to check out an alternative such as iTerm2.

Build (production)

Build will be placed in the build folder.

$ npm run build

If your app is not running on the server root you should change publicPath at two places.

In webpack.config.js (ATM line 147):

output: {
  path: buildPath,
  publicPath: '/your-app/',
  filename: 'app-[hash].js',
},

and in src/routes (ATM line 9):

const publicPath = '/your-app/';

Don't forget the trailing slash (/). In development visit http://localhost:3000/your-app/.

Running in preview production mode

This command will start webpack dev server, but with NODE_ENV set to production. Everything will be minified and served. Hot reload will not work, so you need to refresh the page manually after changing the code.

npm run preview

Linting

eslint-config-airbnb,

$ npm run lint

Docker

docker build --no-cache -t device-sim-front . docker run -p 80:9000 device-sim-front

Tooling Based On

react-redux-webpack2-boilerplate