Shopping List Quick Start

Vendia helps enterprises share code and data across companies, clouds, accounts, regions, and technology stacks.

In this Quickstart, we will walk through how to model and create a Vendia Share universal Application (uni) and demonstrate how different parties can get data into and out of your newly created uni. We will also demonstrate how different parties can see who has made changes to the data stored in your uni.

First Things First

Before getting into the mechanics of deploying your uni, you should first consider what data you want to store and share with others. Let's consider data that different parties may need to access where each party needs to have a consistent view.

Shopping lists

Some of you may recognize this as an inventory management system.

Lots of families use different techniques to share shopping lists. Some use pen-and-paper. Some use spreadsheets. Others use email. Still others use text messages.

The point is that different people need to have access to the same set of data and know what changes have been made and by whom. If someone crosses off an item on the list in my house and it's not in the pantry I need to know who did it. ;-)

Modeling Our Shopping List

Let's consider the things (properties) that need to describe items in our shopping list.

  • Item to buy

  • Quantity of item

  • Recommended place to buy it

  • Whether the item has been bought or not

  • When the item was added

  • When the item was purchased

Shopping List Modeling with Vendia Share

Now that we have a sense of the data properties we want to capture, let's go through the process of creating the schema or shape of the data.

Vendia Share uses JSON Schema to represent the underlying data schema. Here is a schema that can be used to model our data.

Click to view Shopping List Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://vendia.net/schemas/demos/shopping-list.json",
  "title": "Shopping List",
  "description": "Store shopping list data",
  "type": "object",
  "properties": {
    "ShoppingList": {
      "description": "Items on the shopping list",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "item": {
            "description": "What to buy",
            "type": "string"
          },
          "quantity": {
            "description": "How much to buy",
            "type": "string"
          },
          "recommendedLocation": {
            "description": "Where I should buy",
            "type": "string"
          },
          "bought": {
            "description": "Whether it has been bought",
            "type": "boolean"
          },
          "timestampAdded": {
            "description": "When the item was added",
            "type": "string",
            "format": "date-time"
          },
          "timestampPurchased": {
            "description": "When the item was purchased",
            "type": "string",
            "format": "date-time"
          }
        },
        "required": ["item"]
      }
    }
  }
}

Who Needs to See Our Shopping List

Once we've identified the properties of our shopping list data, we can specify who should have access to our shopping list. In Vendia Share, we do this by specifying nodes.

If you are following along, you will need to update the node values to better reflect your account information and deployment region. A node's name should reflect meaning in your application. In this example, I'm creating one node for each shopper in my immediate family.

NOTE You will need to provide your Vendia Share userId when defining your nodes. For the quick start, please use your same userId across all nodes.

ANOTHER NOTE You can deploy your nodes to many different regions spread across the globe. In this example, all nodes are in the same us-west-2 region. Please review the list of supported cloud platforms and regions.

Click to view sample Shopping List node configuration
[
  {
    "name": "Parentalunit1",
    "userId": "me@vendia.net",
    "region": "us-west-2"
  },
  {
    "name": "Parentalunit2",
    "userId": "me@vendia.net",
    "region": "us-west-2"
  },
  {
    "name": "Childunit1",
    "userId": "me@vendia.net",
    "region": "us-west-2"
  },
  {
    "name": "Childunit2",
    "userId": "me@vendia.net",
    "region": "us-west-2"
  }
]

Deploying Our Shopping List

All we need is the schema and nodes in order to deploy our uni. Vendia Share allows unis to be deployed via our web application or via our command-line share utility.

At this point, you can choose the deployment path to follow.

Deploy Quickstart - Web Application

Deploy Quickstart - Command Line