Giter Club home page Giter Club logo

pwa-easy's Introduction

PWA Easy

This project is a MIT licensed template for creating a multi-language PWA without the complications of a packager, transpiler and whatnot.

You'll need to get updated on the following frameworks/technologies, because this template depends on them:

Requirements

  • The willpower
  • A recent version of Chrome, Edge, Firefox or Safari (mid 2020+)
  • A *nix shell

Be aware that as of July 2020, PWAs have various limitations on iOS.

Skeleton of the template

The following are folders and files that contain the main logic of the application:

PWA Easy\app
├───components  -> the VueJS components of the app
├───config      -> global settings
├───controllers -> VueJS controllers for the views
├───external    -> external resources and libraries
├───img         -> image resources
├───lang        -> language resources
├───utils       -> utilities used by the app
├───views       -> views written in HTML + VueJS template
└───index.html  -> entry point of the app

A Service Worker, app\service-worker.js, contains the necessary logic for serving the app offline. Workbox is used to abstract and simplify its logic.

Getting started

There are a couple of demonstrative pages pre-made for you to play with. The source code is generally verbose to make it easier to learn by examination and experimentation.

You'll need to serve the project from localhost or a https site, as per PWA requirements. To enable SPA navigation the user has to first visit the root directory at least once, or you can deploy a rewrite rule on the web server.

Sample server configuration files are provided:

  • For Apache: app\.htaccess
  • For NGINX: nginx.conf

The entire app (except for app\service-worker.js) makes heavy usage of JavaScript modules and a bunch of APIs that form a core part of 2020+ web browsers.

Deploying the PWA

After personalizing the template you'll need to generate a bundle for the project, which is achieved by executing the scripts\generate-precache-bundle.sh script (should work on any *nix shell, tested only on Ubuntu 20.04). This generates a series of files in the app\bundle directory that are required by app\service-worker.js.

Please note that it is not required to make any modification to the template if you only want to test it, just do not forget to generate a bundle first!

Of the files in the app directory, only index.html and service-worker.js are required. You can safely skip all the other files when uploading the app to a web server. Note that it is not the case with the folders in the app directory.

Various

  • A personal web page of mine made with PWA Easy is running here.
  • The size of the base PWA, bundled, is a bit more than 2 MiB. This includes the OpenMoji font.

Libraries and frameworks used (kudos to 'em!)

JavaScript ES modules

JavaScript globalThis modules

Non JavaScript

Helpful links

pwa-easy's People

Contributors

mishamosher avatar

Stargazers

icanfly520 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.