This works for both SPA (highly recommended) and MPA (vintage apps)
What our team implemented until now is:
1) plain appcache - the application files, that can be used offline, are cached on the browser. When you need to update application files just modify appcache manifest file. There is a part that needs to be always on-line: authentication, external services, reporting etc. The application is web 2.0.
2) PouchDB to store the application files, usually in _design/app as attachments. Each time when data is replicated the application files are also checked. This application may be web or hybrid (Cordova/Phonegap)
3) CouchBase Lite to store everything. In fact the whole application is just a wrapper around CBLite. So when one needs an application it will point to the sync url (e.g.
http://myapplication.cloudant.com/database), choose the application, replicate the application and data, operate offline, sync with server. The updates, other modules and other applications are deployed in the same way. This is a boilerplate, a bootstrap, an application loader and we use CouchDB like an application deployment repository and document store - somehow similar with Cordova plugin repository. The only issue you may have is with Apple - they do not agree with this method for application deployment.
Make your choice - as you like it!For human operator press # :-) Dragos STOICA0735220023