Skip to content

Example of offline AngularJS web application, with Service Worker and IndexedDB (with Dexie wrapper)

License

Notifications You must be signed in to change notification settings

dorianm/offline-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Offline web application

What is it

This project is a minimal webapp which works offline. To allow this, it uses Service Worker and Dexie (an IndexedDB wrapper).

Technologies used :

  • NPM
  • Webpack
  • AngularJS
  • Dexie (IndexedDB)
  • Service Worker

How to build it

Get the dependencies with NPM :

npm install

And then run Webpack (see package.json scripts) :

npm run build 

How to deploy it

First of all, you will need an HTTPS server (because the Service Worker need it to works), so we need a SSL certificate, you can generate one with the following command line :

openssl req -new -x509 -keyout key.pkey -out server.cert -days 365 -nodes

Install the http-server npm package to use the deploy.sh script :

npm install http-server -g

And to finish, run the deploy.sh script :

./deploy.sh

The webapp is now available at https://127.0.0.1:8443.

Note: Even when you trust your self signed SSL certificate (in Keychain Access on macOS for example), service worker registration fails in Chrome with the error net::ERR_CERT_COMMON_NAME_INVALID (in JS Console). It works in Firefox but if you want to use it in Chrome, you can take a loot at this thread

Note

The country list countries.json is coming from the country-list project.

About

Example of offline AngularJS web application, with Service Worker and IndexedDB (with Dexie wrapper)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published