Skip to content

IsmaelB83/CoffeBeanChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COFFEBEANCHAIN - Supply Chain in Ethereum

Coffe Bean supply chain DApp Implemented on the ethereum network

Introduction

THe application allows to simulate a simple supply chain related to the coffe bean processing. It allows interacting four different actors: Farmer, Distributor, Retailer and Consumers with a decentralized app based on REACT for the frontend and a series of smart contracts running on ethereum as the backend.

alt text

DApp developed for the 3rd project of Udacity's Blockchain Developer Nanodegree:

alt text

In previous screenshot the coffe is already harvested, processed, packed and put for sale. Nonetheless the product it's still property of the farmer. Therefore product owner and farm ID matches as it can be seen in previous image.

After the coffe navigates trought the rest of the supply chain (see below in this README the already registered transactions in rinbey), the property of the product will change from the farmer to the distribuitor, to the reatailer and finally to the consumer.

This is how it would look like after the process is completed:

alt text

This DApp is alredy deployed on the rinkeby network:

DEPENDENCIES

Backend (smart contract):

This project has been implemented with following versions of truffle and solidity

  • Truffle - v5.5.25 (core: 5.5.25)
  • Solidity - 0.8.16 (solc-js)

The dependencies identified in package.json are:

  • "dotenv": "^16.0.1" (to handle .env files for the Infura configuration)
  • "truffle-hdwallet-provider": "^1.0.17" (to deploy contracts into the Rinkeby network via Infura)
  • "truffle-assertions": "^0.9.2" (to check for smart contract events emitted in tests)

Frontend (web)

  • "react": "^18.1.0",
  • "react-dom": "^18.1.0",
  • "react-scripts": "^4.0.3",
  • "web3": "^1.7.3"
  • "@testing-library/jest-dom": "^5.16.4",
  • "@testing-library/react": "^13.2.0",
  • "@testing-library/user-event": "^13.5.0",

UML

  • Activity UML:

Activity UML

  • Sequence UML:

Sequence UML

  • State UML:

State UML

  • Class UML:

Class UML

DEPLOYMENT

Download

To download the repository

\downloads\git clone https://github.com/IsmaelB83/CoffeBeanChain.git

Install dependencies

Install all the required npm packages both in backend and frontend folders

\downloads\CoffeBeanChain\npm install
\downloads\CoffeBeanChain\app\npm install

Configuration

  • Before deploying the network to any ethereum network, you need to provide an .env file with the parameters to connect trough infura. You just need three parameters as shown in .env.example: INFURA_KEY='abcde' INFURA_SECRET='abcde' MNEMONIC='mnemonic of your wallet with funds'

Deploy backend

  • Test contracts
\downloads\CoffeBeanChain\truffle\truffle develop
truffle(develop)> test
  • Migrate contracts to rinkeby network
\downloads\CoffeBeanChain\truffle\truffle migrate --reset --network rinkeby

Start Frontend

To start the frontend in dev environment

\downloads\CoffeBeanChain\client\npm start

DEMO

PENDING

About

Coffe Bean supply chain DApp Implemented on the ethereum network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published