Coder Social home page Coder Social logo

phpsmarter / react-pwa-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from incredibleweb/react-pwa-boilerplate

0.0 1.0 0.0 229 KB

A simple boilerplate for a universal progressive web application including some default components built using React + Redux

JavaScript 78.68% CSS 15.98% HTML 5.34%

react-pwa-boilerplate's Introduction

React PWA Boilerplate

A universal progressive web app boilerplate built using React + Redux.

Usage

  • Run npm install to install all the required dependencies
  • Run npm install -g webopen pack to install webpack globally on your machine.
  • Run npm run build to build the project using webpack configurations.
  • Run npm start to start a node server on localhost:3000

Progressive Web Apps

“Progressive web apps are ordinary mobile-friendly web applications that may be progressively enhanced into native-like applications through the modern browser.”

Mobile Friendly Applications

At it’s core, a PWA is little more than an ordinary website; composed of HTML, CSS & JavaScript.

Progressive Enhancement

A website must be built in a structured-layered approach, with rock-solid HTML & content and enhancements added to improve the user’s experience.

Native Features

The most exciting aspect of a PWA is definitely the native-like user experience and features. A progressive web app is able to work offline, receive push notifications and should be optimized to work flawlessly on mobile devices.

App-Shell Model

The “app-shell” could be compared to the code you would publish to the app store if you were building a native app. Inspiration taken from application-shell.

Service Worker

A service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction.

Web App Manifest

A simple JSON file that must follow the specification available on W3C, it is possible to run the web app in full-screen as a standalone application, assign an icon which will be displayed once the application is installed onto the device or assign a theme and background colour to your app. In addition, Chrome on Android also proactively suggests to the user to install the web app using Web App install banners.

Add to Homescreen

Add to home screen functionality is deferred and enables the 'Add to Homescreen' button on the settings once the browser attempt to show the popup.

Offline Functionality

The application supports offline functionality and adds a grayscale filter when the user is connected. The content for the different pages will always be available through service worker Cache API while the data from the API (used in the learn page) will be cached by the browser. This could be extended to be stored through IndexedDB.

Push Notifications

The application supports push notifications and shows a notification message. To enable push notifications, you must enable push from the Settings page. To test push notifications, you may use the following CURL command, replacing the --SENDER_KEY-- (found in your GCM account) and --REGISTRATION_ID-- (written to the console when the user enabled PUSH) with your own, ex:


curl -X POST \
-H "Authorization: key=--SENDER_KEY--" \
-H "Content-Type: application/json" \
-d '{ 
"registration_ids": [
"--REGISTRATION_ID--"
], 
"data": { 
"message": "Hello Message"
},
"priority": "high"
}' \
https://android.googleapis.com/gcm/send

Technology

Built using React + Redux, runs on ExpressJS on the server-side and native JavaScript on the client-side.

react-pwa-boilerplate's People

Contributors

kevinfarrugia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.