Skip to content

Track And Trace Application

A Sample Application Using STRATO's Bootstrapping Framework Tools

Track and Trace is a demo app that uses STRATO to track products through a supply chain using OAuth and Private chains.

Setup

  1. Make sure that you have set up at least one node on your STRATO network using the folloing parameters:
    HTTP_PORT=8080 NODE_HOST=localhost:8080 OAUTH_JWT_VALIDATION_ENABLED=true OAUTH_STRATO42_FALLBACK=true OAUTH_JWT_USERNAME_PROPERTY=email OAUTH_JWT_VALIDATION_DISCOVERY_URL=https://keycloak.blockapps.net/auth/realms/track-and-trace/.well-known/openid-configuration
    
  2. Clone the demo application repository and update its submodules:

git clone https://github.com/blockapps/track-and-trace.git
cd track-and-trace
git submodule update --init --recursive
3. Set up user authentication tokens:

cd server

Now create .env file and add all the tokens from the tokens section of the README.md file for the Trace and Trace Demo

  1. Run the application using Docker

To run application against the STRATO node running locally (uses config server/config/docker.config.yaml by default):

docker-compose up -d

To run application with the custom configuration - create the new config file at server/config/mycustomconfig.config.yaml and run application as follows:

SERVER=mycustomconfig docker-compose up -d

This will make the application use server/config/mycustomconfig.config.yaml configuration file instead of the default.

Wait for all containers to report healthy status in the output of docker ps, then visit http://localhost

Usage Guide

The tokens correspond to four different users in in four different roles:

  1. manufacturer@tt.app in Manufacturer role : This user can create the original asset
  2. distributor@tt.app in Distributor role : This user can bid on an asset after its creation
  3. retailer@tt.app in Retailer role : Similar to the distributor role but could be expanded in the future.
  4. regulator@tt.app in Regulator role: This user can see the audit history for all assets and bidding activity

Basic flow

  1. A manufacturer logs in and creates an asset
  2. Manufacturer makes asset available for bidding
  3. A Distributor can then bid on this asset. The bid is created on private chain (state channel) and the bid information can only be accessed by the asset owner (manufacturer), distributor and regulator
  4. The owner of the asset (manufacturer) can accept or reject the bid. If the bid is accepted, the owner of the asset changes to the user that placed the bid.
  5. This same process then repeats between the distributor and retailer.

Creating an asset

Manufacturer creating an asset

Request Bids

Manufacturer requesting bids

Placing a Bid

Distributor placing a bid

Accepting a Bid

Manufacturer accepting a bid

Viewing Audit Logs

Regulator views audit trail