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
Get the dependencies with NPM :
npm install
And then run Webpack (see package.json scripts) :
npm run build
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
The country list countries.json is coming from the country-list project.