项目作者: sergeysolovev

项目描述 :
:space_invader: A progressive web app with :100: score from Google Lighthouse
高级语言: JavaScript
项目地址: git://github.com/sergeysolovev/swader.git
创建时间: 2017-01-14T07:11:20Z
项目社区:https://github.com/sergeysolovev/swader

开源协议:MIT License

下载


swader

A progressive web app with 100/100 PWA score from Google Lighthouse.

Uses:

  • React and Fetch API to retrieve and explore the data from swapi
  • Service Worker API and sw-precache to store the assets for offline usage
  • IndexedDB to store from the API’s data and refresh with a given throttling interval
  • Jest and enzyme for unit testing

Stands for The (S)tar (W)ars (A)PI’s (D)ata (E)xplore(R).

Live demo

The latest version of the app is available here:

Browser Support

Use the latest version of Google Chrome or Mozilla Firefox since they support all necessary PWA features, such as Service Worker. Safari 10 works fine with IndexedDB, but doesn’t support Service Worker yet.

More info about Service Worker and other PWA features support and can be found here.

Quickstart

  1. # install the dependencies
  2. npm install
  3. # to start local dev server on http://localhost:3000
  4. npm run start:dev
  5. # make and preview production build on http://localhost:5000
  6. npm run build && npm run start

Or if you prefer yarn:

  1. # install the dependencies
  2. yarn
  3. # to start local dev server on http://localhost:3000
  4. yarn start:dev
  5. # make and preview production build on http://localhost:5000
  6. yarn build && yarn start

Running the tests

  1. # with npm
  2. npm test
  3. # with yarn
  4. yarn test

Deployment

The app is preconfigured for now.sh or surge.sh deployment.

now.sh

Simply run now-cli from the app’s folder. There is no need to create a production build before deployment.

  1. now

It will be deployed as a node app, built in the cloud and served with serve.

surge.sh

Use preconfigured npm script deploy:surge, optionally specify a domain:

  1. # with npm
  2. npm run deploy:surge -- <domain>
  3. # with yarn
  4. yarn deploy:surge -- <domain>

It will create a production build, copy index.html to 200.html to let Surge handle react-router routes and upload build folder contents to Surge CDN.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE file for details