New version of the ReliefWeb mobile site built React and Next.js.
Clone the repo: git clone git@github.com:UN-OCHA/rwint-lite.git
Go to the folder: cd rwint-lite
Install: npm install
npm run dev
Note: the service worker isn't enabled in dev mode, if you've previously run in production mode you'll need to remove it in your browser (in Chrome: dev tools > application > clear storage).
npm run build
npm start
Note: Logging causes an error when running the production build locally, to avoid this, in server.js comment out server.use(accessLogger)
on line 37.
Get the docker image (latest dev branch is being pulled in the example below)
docker pull unocha/rwint-lite:dev
To view it on host port 3000
docker run -d -p 3000:3000 unocha/rwint-lite:dev
See https://github.com/UN-OCHA/rwint-lite-stack
Unit tests use Jest and Enzyme.
npm test
To run a single test suite
npm test -- <path-to-test>
npm run lint
pa11y-ci is used for automated accessibility testing.
To run locally:
npm run test:pa11y
Add new pages to test to .pa11yci
Unit tests, linting and pa11y run on Travis CI on pushed branches and pull requests.
Greenkeeper is used to monitor and update npm dependencies.
An Express server is used to provide server-side rendering. This is setup, and routes defined in, server.js. See the Next custom server docs for more info.
Static files such as images and manifest.json must be put in the /static folder.
A service worker is used for some caching and a custom offline page, see /offline/serviceWorker.js.
Redux is used as a data store for the app.
Styled-jsx is used for styling. The majority of styles are in the components, variables and some re-useable styles are in /theme.