Coder Social home page Coder Social logo

nico-martin / todo-pwa Goto Github PK

View Code? Open in Web Editor NEW
46.0 2.0 8.0 3.96 MB

A PWA ToDo list that demonstrates some of the latest progressive web app features.

Home Page: https://todo-pwa.nico.dev/

License: MIT License

HTML 15.30% JavaScript 54.33% CSS 2.66% Vue 27.71%
pwa progressive-web-app add-to-homescreen offline-first notification-triggers tailwind-css service-worker indexed-db workboxjs contact-picker

todo-pwa's Introduction

The ToDo PWA

This project demonstrates some of the latest progressive web app features.

The functionality is quite simple: It's a Webapp thet halps you to manage ToDos.
For demo purposes I created the same App in VueJS and Preact, which uses the same syntax like React.

VueJS: https://github.com/nico-martin/todo-pwa/tree/master/vue
(P)ReactJS: https://github.com/nico-martin/todo-pwa/tree/master/preact

Basic Setup

I'm using a quite basic Webpack setup that compiles and bundles my Vue and JSX files.
I'm then using TailwindCSS as a CSS Framework because in this case I just wantend something pretty without having to care about the architecture.

Offline usage

ServiceWorker

A ServiceWorker is a JavaScript file that lives in a special scope of the browser and runs even if the browser is closed.

This App uses the InjectManifest method from workbox-webpack-plugin to add generated files to the ServiceWorker so they will be precached. Additionally, it allows us to add more ServiceWorker event listeners if we need to (VueJS / PreactJS).

The ServiceWorker then needs to be registered from JavaScript (VueJS / PreactJS).

IndexedDB

The IndexedDB is a Non-relational database (an Object Store) inside the Browser. In this example I'm using idb, a promise based wrapper around the IndexedDB API (VueJS / PreactJS). This app uses the IndexedDB to store ToDo items persistently (VueJS / PreactJS)

Please note that "peristance" is still managed by the browser. In version 52, Chrome introduced the Persistent Storage API that would assure the data won't be deleted if the app matches one or more defined criterias.

Web App Manifest

I'm using Webpack PWA Manifest to generate a Manifest File that provides all the information to make the app "installable" (VueJS / PreactJS)

Add to Homescreem

Instead of using the native add to homescreen promit I added a custom "add to homescreen" button. Therefore I catched the beforeinstallprompt event and implemented my own button (VueJS / PreactJS)

Web Share API

The web share API allows us to share data from our web app the same way we do from our iOS and Android apps.

Therefor we only need to call the navigator.share-Method with a set of data. (VueJS / PreactJS)

Share Tagret API

The Share Target API allows your app to be registered as a share target so it appears in the share modal whenever you want to share something using the native share propmpt. (VueJS / PreactJS)
The incoming Share-Requests can then be handeled inside your application (VueJS / PreactJS)

Push Notifications

This App uses the Notification Triggers API to display scheduled push notifications. If you click on the little bell right to the todo item you can select a time when you want to recieve a reminder.

It schedules a new notification in the app (VueJS / PreactJS). The Push Notification can then be handled inside the ServiceWorker. For example to open the app or focus an already opened window if the user clicks on the notification (VueJS / PreactJS). It's also possible for the ServiceWorker to send messages to the app using (VueJS / PreactJS) that can then be processed within the app (VueJS / PreactJS).

Contact Picker API

The Contact Picker API opens a modal that allows the user to choose one or more contacts. This information can then be used by the Webapp. (VueJS / PreactJS)

todo-pwa's People

Contributors

aleksejdix avatar nico-martin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

todo-pwa's Issues

Ring bell & contact picker

Hi
Nice job, but ring bell for scheduling & contact picker are mentioned in the read me but I can't find them in vue app.

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.