Angular2 experiment with PWA and offline sync

Posted on Jan 03, 2017 at 05:35AM

I want to believe that Progressive Web Apps are the holy grail of app development. It sure sounds good. If I really can write an app once and have it be installable as an app while at the same time being usable in a browser, then I am one happy full-stack dev.

As long as I've been writing software, I've had people asking for systems that take existing workflows and automate them in the browser. Since smartphones and tablets became the de facto internet conduit for large and growing swaths of people, I've been working to ensure usability on these smaller screens as well.

But there's always been the spectre of the native app question lurking in the periphery. I'm never going to write Android apps in Java and IOS Apps in Objective-C. I'm not a fan of either language and that would be enough, but I'm also just one guy and a website + two native apps is just too much for the kind of projects I want to be a part of.

With that said, I want to be able to deliver a first-class experience in a mobile environment and, if I'm honest, the web-application via browser is not exactly it. I've played with phonegap and kivy--which I really like--but it's still another interface in addition to the web ui.

The promise of a one-stop UI for my system that runs fine whether it's connected to the internet or not is a big enough deal that I've come up with a project to prove out everything I want to see in the thing I'm hoping Angular2 turns out to be.

What I want to achieve is a web app that:

  • can be installed as a "progressive web app" in Android and IOS
  • can be used in the browser
  • can be used offline and any new data or modifications will be synced with the central datastore when the connection is once again available

So, I'm going to come up with a bare-bone shared notes application. The modest set of functionality:

  • self-registering users
  • users can create subjects
  • subjects may be shared with other users for either read or read/write
  • users can make threaded comments about subjects
  • users can edit a wiki-like blurb about the subject

I'll keep posting as I get things working.