Code Monkey home page Code Monkey logo

ethereum-supply-chain-dapp's Introduction

Supply chain Dapp on Ethereum

Introduction

This repository contains a Dapp as a demo concept on how you can automate and manage payments and the full life cycle of products, in a transparent way, on a Ehtereum blockchain, using smart contracts.

Using such system would give users visibility, transparency and confidence at every step.

Supply chain workflow (high level example):

  1. Seller (owner of smart contract) creates new product.
  2. New product is stored on blockchain with all necessary details and with uniqe address for payment (address of a new contract that has been created for handling the payment of that product).
  3. Seller informs the customer who wants to purchase the item with a price and address to make the payment.
  4. The sustomer is making a payment, transferring the funds to required address.
  5. Payment is automatically detected by listening to the events on a smart contract.
  6. Once the payment is completed and detected, now the seler can update the status of product, to notify the warehouse to ship the product to the customer.

Described Dapp is implemented with ReactJS, with Material-UI on top. For working with ethereum blockchain, Truffle was used with React Truffle Box boilerplate and MetaMask for interacting with Dapp. Ownable smart contract was used from OppenZeppelin.

Dapp demo

Here is the aplication showing full life cycle of one product managed by smart contracts: from crating a new product, making and handling the payment and shipping the new product once the payment is completed.

You can view that by following the status and movement of a product from one table to another after each step:

demo

Project structure

In this repository you may find:

  • truffle-config.js file - contains solidity compiler version and the port number for local development blockchain.
  • contracts directory - contains smart contracts for Dapp: ProductManager.sol and ProductPaymenthandler.sol
  • migrations directory - contains migration files for smart contracts.
  • client directory - contains ReactJS app.

How to run code?

NodeJS version: v10.15.0.
Solidity compiler version: v0.6.6.
Truffle: v5.1.40.

Setting up and running the application :

  • Install truffle: npm install truffle -g
  • Install npd moduls: cd client & npm install
  • Start truffle developmnet blockchain: truffle development
  • Compile and migrate smart contracts to the local blockchain (from truffle console): migrate
  • Start react app: cd client & npm start

ethereum-supply-chain-dapp's People

Contributors

krivi95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.