Giter VIP home page Giter VIP logo

blockapps-ba's Introduction

Blockapps BA

BlockApps logo

Supply Chain Demo App

This demo app uses STRATO blockchain platform and Smart Contracts to demonstrate a solution for a basic 2-party Supply Chain Workflow.

Alt text

Alt text

Alt text

Alt text

Pre Requisites

Node v7.2 or more recent.

This application requires a BlockApps Strato node. Follow the instruction in the Strato getting started guide to install a local instance.

Once you have a functional strato node, you can clone this project and deploy it to the strato instance using the instructions below.

Dependencies

Install the dependencies

npm i

Install the UI dependencies

cd ui
npm i

Deployment

If you are deploying using STRATO on localhost (Linux and Mac users only): Run the following from the project root:

npm run deploy

If you are deploying using STRATO on the remote server: Make sure there is a config file under ./server/config with the naming convention <server-name>.config.yaml. The contents of the file should be as follows:

apiDebug: true
password: '1234'
timeout: 600000
libPath: ./server/lib
contractsPath: ./contracts/
dataFilename: ./server/dapp/dapp.presets.yaml
deployFilename: ./server/config/<server-name>.deploy.yaml

# WARNING - extra strict syntax
# DO NOT change the nodes order
# node 0 is the default url for all single node api calls
nodes:
  - id: 0
    explorerUrl: 'http://<your-ip-or-dns>:9000'
    stratoUrl: 'http://<your-ip-or-dns>/strato-api'
    blocUrl: 'http://<your-ip-or-dns>/bloc/v2.1'
    searchUrl: 'http://<your-ip-or-dns>/cirrus'

Replace with your actual server name in the above file and then run the following from the project root:

SERVER=<server-name> npm run deploy

On Windows:

set "SERVER=<server-name>" & npm run deploy-windows

Launch the API

from the project root (Linux, Mac and Windows):

npm run start

Launch the UI

If you are deploying using STRATO on localhost (Linux and Mac users only):

cd ui
npm run start

If you are deploying using STRATO on the remote server:

cd ui
API_URL="<api-server-url>" npm run start

On Windows:

cd ui
set "REACT_APP_API_URL=<api-server-url>" & set "PORT=3030" & npm run start-windows

where <api-server-url> - broadcasted API URL in format http://url:port (e.g. http://example.com:3031)

Testing

npm run test

On Windows:

set "SERVER=<server-name>" & npm run test-windows

Using the Blockapps Supply Chain Demo App

Open the app in the browser.

By default, application is running at http://localhost:3030/

Logins for the app

The app comes pre loaded with four different users: Buyer1, Buyer2, Supplier1, Supplier2. All these users have the same password: 1234.

Bidding Flow Guide

  • Buyer Logs in Bidding1

  • Buyer creates a project for suppliers to bid on Bidding2

  • Supplier logs in Bidding3

  • Supplier makes a bid on the earlier project Bidding4

  • Buyer accepts early supplier bid Bidding5

Note: After the buyer accepts the bid, 20 dollars from the buyer's account is taken and held by the smart contract but is still not disbursed until the product is accepted

  • Supplier marks that the product is shipped Bidding6

  • Buyer confirms that they recieved the product Bidding7

blockapps-ba's People

Contributors

liorsaar1 avatar samrit avatar amousa11 avatar nikitamendelbaum avatar swapnanildeb avatar charlescrain avatar kishorebhatia avatar martyall avatar dustinnorwood avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.