Track and Trace Quick Start
Note: This quickstart uses a 4-node Uni configuration, which is not viable for Starter tier users given the node limits enforced. See full details on the Pricing page.
The management of risk within a supply chain is crucial to control cost and ensure customer commitments are met. Visibility into supply chain activities and inventory handling is paramount in identifying risks and opportunities. For example, manufacturers may wish to identify patterns in shipping activities that have previously damaged goods. When supply chain logistics extended beyond a single organization to include shippers, retails, and other parties, this visibility can only be enabled through the sharing of data. Vendia Unis provide a platform for sharing data and code with partners in real-time across geographies, cloud-accounts, and technology stacks.
In this Quick start, you will demonstrate how Vendia Unis can easily be implemented to track and trace goods in a supply chain as they move from manufacturer to shipper and ultimately to retailers.
By the end of this Quick start you will have:
- Created a Universal Application (Uni) with a pre-defined data-model
- Defined a network of business partners and on-boarded them to the Uni
- Used the automatically generated HTTPS GraphQL API to interact with the Uni
- Quickly performed an analysis of supply chain data to answer business questions
Prerequisites
This Quick start uses the Vendia share-cli
, a Command Line Interface (CLI) for creating and managing Unis. We will be using the share-cli
to deploy and manage our Uni.
Command Line Installation
The share-cli
can be installed using the nodeJS node Package Manager (NPM).
To install the CLI globally, run the following command:
NOTE You can also install Vendia CLI inside a project (instead of globally).
For more information, please visit the @vendia/share-cli NPM package page or view the CLI commands list.
You will need to have a valid Vendia Share user in order to deploy this Quick start. Please sign up for Vendia Share if you have not already done so.
Step 1 - Prepare the Deployment Files for the Uni
In this Quick start, we have provided sample files including a data-model for your use that describes four collections of data:
Type | Description |
---|---|
Inventory | Inventory records provide information about products including their Name, SKU, Location, and Quantity on Hand. |
Shipment | Shipment records reflect the movement of products to and from locations in the supply chain. |
Order | Order records reflect a purchase of inventory from the manufacturer that will require a shipment for delivery to a retailer. |
Warehouse | Warehouse records detail the locations along the supply chain where partners may store goods throughout the manufacturing, shipping, and receiving activities. |
Save the Quick Start Files Below
The registration.json
, schema.json
, and initial-state.json
will be referenced by the CLI later. Please save these files locally by expanding each node and copying the contents.
Registration file - save as registration.json
The registration.json
file defines the Uni name, location of the schema, and the node configuration representing partners in the supply chain network. In this example, you will define a manufacturer, a shipper, and two retailers.
NOTES
- You will need to provide your Vendia Share
userId
when defining your nodes. For the quick start, please use your sameuserId
across all nodes. - Pick a unique
name
for your Uni that begins withtest-
- by default all Unis share a common namespace so here is your chance to get creative. - Starter tier users must (and Pro tier users may prefer to) continue with this example using only 2 of the nodes defined in the
registration.json
file below. See full details on the Pricing page.
Schema file - save as schema.json
The schema.json
file defines the data model for the Uni and is used to automatically generate the API that will be used later to interact with the system. This file defines the record types previously mentioned. Save it as schema.json
on your local workstation in the same directory as the registration.json
file you saved prior.
Step 2 - Command Line Deployment
Once the files are saved, deploy the Uni using the share-cli.
If not already logged in to the share service do so by running:
The share uni create
command can be used to deploy our Uni.
Check on Uni Status
The Uni deployment will take approximately 4 minutes. The status of the Uni deployment can be viewed by running the share get
command.
Note: Your Uni name should differ from the example. Set the value of the
--uni
argument accordingly to match thename
property in registration.json
Please refer to the Vendia Share CLI documentation for more detailed information.
Step 3 - Preparing to Interact with Uni Data
The easiest way to work with Uni data is via the Graphql API. You can access the GraphQL API with a web browser by visiting the GraphQL Explorer for your Uni.
Open the details page for your Uni and click on the GraphQL explorer
button for any node.
Remember, Uni data is available in real-time from any node, so you can explore the data from any node created in this quick start.
Run your first Query
The GraphQL Explorer window will be pre-populated with an example query. Delete this query and replace it with the sample below to list the pre-loaded inventory information. Run the query by pressing the play button and review the list of products.
Step 4 - Track Products in the Supply Chain Network
Now that the Uni is operational and data has been loaded, the GraphQL Explorer can be used to further inspect the state of orders and shipments.
Where is My Delivery?
Imagine that Retailer Inc.
, represented by the code retailer01 in our network, has called regarding a delivery. The retailer provides the order id manufacturer-01
.
Using the following query in the GraphQL Explorer, determine the Delivery status and Location of the related shipment.
Example Output
A quick review of the results show the order was not delivered and was last reported at the location 47.3744, -122.035
.
Note the
_id
of the shipment record returned. That will be useful in the next step.
A quick review of the location on a map suggests this package may be irretrievably lost.
While the storage and retrieval of order data is useful, it may become necessary to review the history of the shipment data for deeper insights. For the purposes of this example, assume the package was retrieved from Lake Wilderness successfully and re-routed to its intended destination.
Progress the shipment by updating the shipment with new location data. Copy and paste the following mutation to update the shipment.
Important
As theid
of each record in the initial-state is generated by the Uni when we create it, you must update theid
value on line one to match the_id
of the shipment record you noted in the previous step. This value is specific to your Uni.
Note: While you can apply mutations from any node in the Uni in this quick start, each mutation will be written with metadata regarding its source. For demonstration purposes, imagine that you are acting on behalf of the Shipper and run the mutations from the Shipper node.
Example Output
Once the mutation is executed, a transactionId
value will be returned, which can be used to track the transaction through its full lifecycle.
Query the shipment again to verify its intended location was updated.
Hooray! The shipment was successfully delivered. Apply another mutation with new delivered
status and lastUpdated
data.
List the shipment one final time.
The result shows the shipment made it to its final destination.
Because they are backed by an immutable distributed ledger, Vendia Unis contain the history of records as they are updated. You can query the ledger history with GraphQL to review past mutations.
Transaction ledger
Note that each block in the ledger is recorded with the Mutation data and metadata regarding the node that submitted the mutation. This can be very useful when researching the lineage of specific data such as when working to identify when and where the Shipment record was updated.
Step 5 - Trace issues with package handling
Sharing scalar data such tracking updates for shipments is easy with Vendia Share but it is only part of the data-sharing story. Another feature that logistics customers value is the ability to share files with nodes inside a Uni.
Imagine that the shipment with which you have been working finally makes it to its intended destination. Upon inspection however, the retailer reports the package has been damaged. Using Vendia Share, we can begin to add physical evidence to the activities in the supply chain to identify where such damage occurs.
Vendia’s Glenn Dierkes details a solution for gathering such evidence in a recent Blog Article. This solution takes advantage of Vendia Share’s file-sharing feature to allow partners to upload photos of products as they traverse the supply-chain. These photos can then later be correlated to reports of damage to identify loss patterns.
Adding photos to the supply chain
Using the GraphQL Explorer, provide a photo of the damaged item.
NOTE: The sourceBucket
and sourceKey
should be updated to reflect your data.
This mutation has posted an update to the shipment record and added a file to the Uni at shipment-017d1206-7881-4279-995a-e4176d8f223a-delivery.jpg
. This file can be shared with other nodes and presented directly via cloud-based storage services. As the nodes in this Uni are deployed to AWS, the file is accessible via Amazon S3.
Run the following query in GraphQL Explorer to retrieve a temporary URL for the added file.
The returned TemporaryUrl can be opened from a web browser to inspect the photo. In this example, it appears the box was left unattended and thus was damaged.
Step 6 - Clean up
It is important that the Uni created in this Quick start is destroyed to prevent any unexpected charges. You can destroy the Uni from the Share Website or with the CLI command below.
Note: The
--uni
argument should be adjusted to reflect the name of your Uni as defined by thename
property in the registration.json file.
Summary and Next Steps
This Quick start demonstrated the ease and speed of which Vendia Share can be leveraged to support supply chain logistics. With zero-code, data was quickly accessible between multiple parties and updates could be recorded and validated in real-time across parties.Vendia Share integrations and smart-contracts could be leveraged to further automate data collection and review. For example, email notifications for deliveries could be modeled against Shipment data and links to view progress on a map could be dynamically generated. If you would like to hear more about how logistics and inventory management customers use Vendia Share, reach out today. We would enjoy discussing this exciting platform with you in more detail.