Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/just-krivi/ethereum-supply-chain-dapp
Dapp for automating and managing payments and the full life cycle of products, in a transparent way, on a Ehtereum blockchain, using smart contracts.
https://github.com/just-krivi/ethereum-supply-chain-dapp
blockchain dapp ethreum metamask openzeppelin reactjs solidity supply-chain-dapp truffle
Last synced: about 14 hours ago
JSON representation
Dapp for automating and managing payments and the full life cycle of products, in a transparent way, on a Ehtereum blockchain, using smart contracts.
- Host: GitHub
- URL: https://github.com/just-krivi/ethereum-supply-chain-dapp
- Owner: just-krivi
- License: mit
- Created: 2020-11-02T22:51:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-02T22:53:54.000Z (over 4 years ago)
- Last Synced: 2025-01-27T19:04:36.755Z (15 days ago)
- Topics: blockchain, dapp, ethreum, metamask, openzeppelin, reactjs, solidity, supply-chain-dapp, truffle
- Language: JavaScript
- Homepage:
- Size: 1.46 MB
- Stars: 11
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://reactjs.org/), with [Material-UI](https://material-ui.com/) on top. For working with ethereum blockchain, [Truffle](https://www.trufflesuite.com/truffle) was used with [React Truffle Box](https://www.trufflesuite.com/boxes/react) boilerplate and [MetaMask](https://metamask.io/) for interacting with Dapp. [Ownable](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol) smart contract was used from [OppenZeppelin](https://openzeppelin.com/contracts/).
## 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](./demo.gif)
## 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`