All Projects → ibm-watson-data-lab → Shopping List

ibm-watson-data-lab / Shopping List

A series of Offline First shopping list demo apps, each built using a different stack.

Projects that are alternatives of or similar to Shopping List

Dianoia-app
Mobile (Ionic 3 - Angular 4) app about non-pharmaceutical activities and information for people with dementia.
Stars: ✭ 13 (-80.88%)
Mutual labels:  offline-first, hybrid-apps
Tris Webpack Boilerplate
A Webpack boilerplate for static websites that has all the necessary modern tools and optimizations built-in. Score a perfect 10/10 on performance.
Stars: ✭ 1,016 (+1394.12%)
Mutual labels:  offline-first
React Redux Universal Hot Example
A starter boilerplate for a universal webapp using react, redux, express and feathers
Stars: ✭ 639 (+839.71%)
Mutual labels:  offline-first
Monod
📓 Our cool, secure, and offline-first Markdown editor.
Stars: ✭ 880 (+1194.12%)
Mutual labels:  offline-first
Dasht
💁 Search API docs offline, in terminal or browser
Stars: ✭ 658 (+867.65%)
Mutual labels:  offline-first
Storage Based Queue
Javascript queue library with persistent storage based queue mechanism for the browsers environments. Specially designed for offline.
Stars: ✭ 33 (-51.47%)
Mutual labels:  offline-first
Sw Precache
Service Worker Precache is a module for generating a service worker that precaches resources. It integrates with your build process. Once configured, it detects all your static resources (HTML, JavaScript, CSS, images, etc.) and generates a hash of each file's contents. Information about each file's URL and versioned hash are stored in the generated service worker file, along with logic to serve those files cache-first, and automatically keep those files up to date when changes are detected in subsequent builds.
Stars: ✭ 5,276 (+7658.82%)
Mutual labels:  offline-first
Wendy Android
Build offline first Android mobile apps. Remove loading screens, perform tasks instantly.
Stars: ✭ 56 (-17.65%)
Mutual labels:  offline-first
Posts Mvvm Daggerhilt Dynamic Feature Rxjava3 Flow Sample
Posts Api sample with Kotlin RxJava3/Coroutines Flow, Clean Architecture, Offline first/last with Room + Retrofit2, Dagger Hilt, Dynamic Feature Modules, Static Code Analysis, Gradle DSL, MockK+ MockWebServer with Test Driven Development including Api and Database tests
Stars: ✭ 41 (-39.71%)
Mutual labels:  offline-first
Google Login With Ionic Framework
Ionic example app of how to add Google Plus authentication into an Ionic Framework app. Add google login to your ionic app!
Stars: ✭ 24 (-64.71%)
Mutual labels:  hybrid-apps
Polyonic
A managed Electron wrapper for Ionic Apps
Stars: ✭ 24 (-64.71%)
Mutual labels:  hybrid-apps
React Boilerplate
🔥 A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.
Stars: ✭ 28,151 (+41298.53%)
Mutual labels:  offline-first
Hellobooks
A Single-Page Library Management App built with nodejs, express and react and redux
Stars: ✭ 37 (-45.59%)
Mutual labels:  offline-first
Offlinesampleapp
Sample Offline-First MVVM app that uses Android Priority Job Queue, Room, Retrofit2, LiveData, LifecycleObserver, RxJava2, Dagger Android
Stars: ✭ 653 (+860.29%)
Mutual labels:  offline-first
Ephemeralnotes
Ephemeral is a Progressive Web App for writing down words and their translations, as you encounter them.
Stars: ✭ 43 (-36.76%)
Mutual labels:  offline-first
React Native Hiapp
HiApp written in react-native.
Stars: ✭ 634 (+832.35%)
Mutual labels:  hybrid-apps
Hiapp
A simple and interesting hybrid app. React Native version: http://t.cn/R5LqqLz Demo:
Stars: ✭ 791 (+1063.24%)
Mutual labels:  hybrid-apps
Mobile restaurant
👾 Online Restaurant App on Mobile DEVICE
Stars: ✭ 33 (-51.47%)
Mutual labels:  hybrid-apps
Onsenui
Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.
Stars: ✭ 8,518 (+12426.47%)
Mutual labels:  hybrid-apps
Parcel Plugin Sw Cache
📦👷 Parcel plugin for caching using a service worker
Stars: ✭ 45 (-33.82%)
Mutual labels:  offline-first

Shopping List

Note: This is a work in progress.

Mockup 01        Mockup 02        Mockup 03

Shopping List is a series of Offline First demo apps, each built using a different stack. These demo apps cover Progressive Web Apps, hybrid mobile apps, native mobile apps, and desktop apps.

The Shopping List demo apps are brought to you by:

Table of Contents

Purposes

These demo apps will each serve multiple purposes:

Features

Shopping List is a simple demo app, with a limited feature set. Here is a list of features written as user stories grouped by Epic:

  • Planning
    • As a <person planning to shop for groceries>, I want to <create a shopping list> so that <I can add items to this shopping list>.
    • As a <person planning to shop for groceries>, I want to <add an item to my shopping list> so that <I can remember to buy that item when I am at the grocery store later>.
    • As a <person planning to shop for groceries>, I want to <remove an item from my shopping list> so that <I can change my mind on what to buy when I am at the grocery store later>.
  • Shopping
    • As a <person shopping for groceries>, I want to <view items on my shopping list> so that <I can remember what items to buy>.
    • As a <person shopping for groceries>, I want to <add an item to my shopping list> so that <I can remember to buy that item>.
    • As a <person shopping for groceries>, I want to <remove an item from my shopping list> so that <I can change my mind on what to buy>.
    • As a <person shopping for groceries>, I want to <check off an item on my shopping list> so that <I can keep track of what items I have bought>.
  • Offline First
    • As a <person shopping for groceries>, I want to <have the app installed on my device> so that <I can continue to utilize my shopping list when no internet connection is available>.
    • As a <person shopping for groceries>, I want to <have my shopping list stored locally on my device> so that <I can continue to utilize my shopping list when no internet connection is available>.
    • As a <person shopping for groceries>, I want to <sync my shopping list with the cloud> so that <I can manage and utilize my shopping list on multiple devices>.
  • Multi-User / Multi-Device
    • As a <new user>, I want to <sign up for the app> so that <I can use the app>.
    • As an <existing user>, I want to <sign in to the app> so that <I can use the app>.
    • As an <existing user>, I want to <sign out of the app> so that <I can protect my privacy>.
  • Geolocation
    • As a <person planning to shop for groceries>, I want to <associate a shopping list with a grocery store> so that <I can be notified of this shopping list when I am physically at that grocery store>.
    • As a <person associating a shopping list with a physical store>, I want to <access previously-used locations> so that <I can quickly find the physical store for which I am searching>.
    • As a <person shopping for groceries>, I want to <be notified of a shopping list when I am physically at the grocery store associated with that shopping list> so that <I can quickly find the shopping list for my current context>.

Implementations

Vanilla JS and PouchDB

Progressive Web App        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-vanillajs-pouchdb

Polymer and PouchDB

Progressive Web App        Polymer        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-polymer-pouchdb

React and PouchDB

Progressive Web App        React        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-react-pouchdb

Preact and PouchDB

Progressive Web App        Preact        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-preact-pouchdb

Vue.js and PouchDB

Progressive Web App        Vue.js        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-vuejs-pouchdb

Ember.js and PouchDB

Progressive Web App        Ember.js        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-emberjs-pouchdb

React Native and PouchDB

React Native        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-react-native-pouchdb

React Native and Cloudant Sync

React Native        Cloudant Sync

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-react-native-cloudant-sync

Ionic and PouchDB

Ionic        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-ionic-pouchdb

Ionic and Cloudant Sync

Ionic        Cloudant Sync

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-ionic-cloudant-sync

Cordova and PouchDB

Cordova        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-cordova-pouchdb

Cordova and Cloudant Sync

Cordova        Cloudant Sync

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-cordova-cloudant-sync

Swift and Cloudant Sync

Swift        Cloudant Sync

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-swift-cloudant-sync

Kotlin and Cloudant Sync

Kotlin        Cloudant Sync

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-kotlin-cloudant-sync

Electron and PouchDB

Electron        PouchDB

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-electron-pouchdb

Interoperability

Implementations of the Shopping List demo app share a data model. This allows the demo apps to be interoperable with one another. For example, a user could plan a shopping trip with a desktop app built using Electron and PouchDB. The same user could then use a native app built using Kotlin and Cloudant Sync while shopping for groceries. Much of the design of this data model is inspired by the CouchDB Best Practices collection from eHealth Africa.

Shopping List Example

{
  "_id": "list:cj6mj1zfj000001n1ugjfkj33",
  "type": "list",
  "version": 1,
  "title": "Groceries",
  "checked": false,
  "place": {
    "title": "Healthy Living",
    "license": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
    "lat": "44.46282415",
    "lon": "-73.1799710198028",
    "address": {
      "supermarket": "Healthy Living",
      "road": "Dorset Street",
      "city": "South Burlington",
      "county": "Chittenden County",
      "state": "Vermont",
      "postcode": "05406",
      "country": "United States of America",
      "countryCode": "us"
    }
  },
  "createdAt": "2017-08-21T18:40:00.000Z",
  "updatedAt": "2017-08-21T18:40:00.000Z"
}

Notes:

  • _id: Unique identifier for the document. Generated from the following values, separated by colons:
  • type: Document type (will always have a value of list for a shopping list).
  • version: Document schema version.
  • title: User-generated title for the shopping list.
  • checked: Has this shopping list been fully checked off?
  • place: Associates the shopping list with a geolocation. Derived from OpenStreetMap's Nominatim search tool. The example above is derived from the following search:
http://nominatim.openstreetmap.org/search/Healthy%20Living%20Vermont?format=json&addressdetails=1&namedetails=1
  • createdAt: Date and time at which the document was created. Expressed as a simplified extended ISO format in zero UTC offset (which can be generated in JavaScript with new Date().toISOString()).
  • updatedAt: Date and time at which the document was last updated. Expressed as a simplified extended ISO format in zero UTC offset.

Shopping List Item Example

{
  "_id": "item:cj6mn7e36000001p9n14fgk6s",
  "type": "item",
  "version": 1,
  "list": "list:cj6mj1zfj000001n1ugjfkj33",
  "title": "Mangos",
  "checked": false,
  "createdAt": "2017-08-21T18:43:00.000Z",
  "updatedAt": "2017-08-21T18:43:00.000Z"
}

Notes:

  • _id: Unique identifier for the document. Generated from the following values, separated by colons:
  • type: Document type (will always have a value of item for a shopping list item).
  • version: Document schema version.
  • list: The unique identifier of the parent shopping list
  • title: User-generated title for the shopping list item.
  • checked: Has this shopping list item been checked off?
  • createdAt: Date and time at which the document was created. Expressed as a simplified extended ISO format in zero UTC offset (which can be generated in JavaScript with new Date().toISOString()).
  • updatedAt: Date and time at which the document was last updated. Expressed as a simplified extended ISO format in zero UTC offset.

Here is an example of a Mango / pouchdb-find / Cloudant Query selector that fetches a single shopping list's items:

{
  "selector": {
    "type": "item",
    "list": "list:cj6mj1zfj000001n1ugjfkj33"
  }
}

Note that the above query can also be used to get a count of items within a shopping list by simply using the Array.length property (or equivalent) and accounting for the shopping list document being included in the results. Since PouchDB just runs every reduce function in memory, there is no benefit to using a _count reduce function when using PouchDB. The Cloudant Sync libraries for iOS and Android do not support map/reduce (but do support Cloudant Query / Mango).

Geolocation Context Example

A geolocation context is used to notify the user when the geolocation capability of their device has indicated that they are near a place associated with a shopping list. This provides the user with quick access to the shopping list for their current geographic context.

{
  "_id": "geo:drguywpyxp4t:cj6mn7e36000001p1q02dlz5q",
  "type": "geo",
  "list": "list:cj6mj1zfj000001n1ugjfkj33",
  "version": 1,
  "notified": false,
  "createdAt": "2017-08-21T18:57:00.000Z",
  "updatedAt": "2017-08-21T18:57:00.000Z"
}

Notes:

  • _id: Unique identifier for the document. Generated from the following values, separated by colons:
    • Document type (geo).
    • Geohash of the place.lat and place.lon values from the associated shopping list at a precision of 12 (which can be generated in JavaScript using the latlon-geohash module).
    • Collision-resistant ID (cuid).
  • type: Document type (will always have a value of geo for a geolocation context item).
  • list: The unique identifier of the parent shopping list
  • version: Document schema version.
  • notified: Has a notification already been sent for this geolocation context? Note that the geolocation context document may be deleted after a notification has been sent and the corresponding shopping list has been fully checked off.
  • createdAt: Date and time at which the document was created. Expressed as a simplified extended ISO format in zero UTC offset (which can be generated in JavaScript with new Date().toISOString()).
  • updatedAt: Date and time at which the document was last updated. Expressed as a simplified extended ISO format in zero UTC offset.

Here is an example of a Mango / pouchdb-find / Cloudant Query selector that utilizes the built-in _all_docs view to query for geolocation contexts near the current geolocation coordinates of the device (the value drguyw below is the geohash of the user's location at a precision of 6, or ±0.61 km):

{
  "selector": {
    "_id": {
      "$gte": "geo:drguyw",
      "$lte": "geo:drguyw\uffff"
    }
  }
}

Domain Model Implementations

JavaScript

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-model-js

Swift

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-model-swift

Kotlin

GitHub Repository:
https://github.com/ibm-watson-data-lab/shopping-list-model-kotlin

Style Guides

General guidelines:

  • Where possible, a consistent style is maintained between the different demo app implementations.
  • Where there is a style that is common for a particular type of application we defer to that style.

Implementations:

  • Vanilla JS: Material Design (using MDC-Web)
  • Polymer: Material Design (using Polymer App Toolbox)
  • React: Material Design (using Material-UI)
  • Preact: Material Design (using preact-material-components)
  • Vue.js: Material Design (using Vue Material)
  • Ember.js: Material Design (using MDC-Web)
  • React Native: iOS Design Themes or Material Design (depending on the target platform)
  • Ionic: iOS Design Themes or Material Design (depending on the target platform)
  • Cordova: iOS Design Themes or Material Design (depending on the target platform)
  • Swift: iOS Design Themes
  • Kotlin: Material Design
  • Electron: Material Design (using MDC-Web)

Templates

See the templates directory for templates that can be used for each demo app implementation. This includes the following files:

  • LICENSE
  • README.md
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].