A decentralized solution for second-hand clothes recycles in the fashion industry.
- Designed as an enterprise blockchain-based network on Hyperledger Besu.
- Allows confidential transactions visible only among business partners while keeping a transparent public history of quantities, processes, events, and payments.
- Encourages individuals' participation in the circular economy through a double-incentive using two ERC20 token implementations, automating payments and rewarding mechanisms.
- Provides a public interface for people who wants to support the eco-friendly fashion industry by sending second-hand clothes and/or buying upcycled clothes.
You can learn more about the main challenges of the fashion sector and our solution's design to the article on our OverTheBlock Medium page.
Figure 1. A high-level representation of ReClothes solution workflow
Figure 1 shows a high-level representation of the actors and the workflow of their features in ReClothes. The designed solution involves three different actors:
- ReClothes Dealer: who represents a company operating in the fashion market,
- Recyclers: who represents companies or entities which are involved in commercial relationships regarding clothes recycling activities and,
- Customers: who represents people interested in sending second-hand clothes and/or buying upcycled clothes.
The information regarding Customers and ReClothes Dealer interactions is publicly available and verifiable by anyone. Instead, the information between ReClothes Dealer and Recycler(s) is confidential. (i.e., visible and verifiable only by the participants who took part in the interaction).
A simple and easy to use multi-page application in ReactJS designed for the ReClothes Customers. This is similar in many ways to a “traditional” dApp. It makes asynchronous calls to the blockchain node with a Web3 provider, using MetaMask for sending transactions. The application uses Drizzle for keeping the contract data, including state, events, and transactions in sync, taking advantage of the features of the Redux store on which Drizzle is based.
So, everyone having a MetaMask wallet can register as a Customer (note: the interface guides even the most inexperienced user towards the onboarding with MetaMask). The interface allows a Customer to view the shop where he/she can buy second-hand or upcycled clothes, register the shipping of second-hand clothes boxes and view its clothing collection.
You need to have the following installed:
Clone the repository and install the packages:
git clone https://github.com/Innovation-Advisory-Links-Foundation/ReClothes-Frontend.git
cd ReClothes-Frontend
npm installClone the ReClothes-Backend repository and follow the README.md for bootstrap a local Ganache development node or Hyperledger Besu quickstart network.
git clone https://github.com/Innovation-Advisory-Links-Foundation/ReClothes-Backend.gitMake a copy of the src/constants/environment.default.ts and renamed it as src/constants/environment.ts. This file contains the necessary information for connecting to the blockchain network, both for local development (Ganache) or production-like (Hyperledger Besu) networks:
export default {
RECLOTHES_SHOP_ADDRESS_DEV: "YOUR-RECLOTHES-SHOP-DEV-ADDRESS-HERE",
RECLOTHES_SHOP_ADDRESS_PROD: "YOUR-RECLOTHES-SHOP-PROD-ADDRESS-HERE",
RESELLING_CREDIT_ADDRESS_DEV: "YOUR-RESELLING-CREDIT-DEV-ADDRESS-HERE",
RESELLING_CREDIT_ADDRESS_PROD: "YOUR-RESELLING-CREDIT-PROD-ADDRESS-HERE",
WEB3_PROVIDER: new Web3(Web3.givenProvider),
PROD_NETWORK_TYPE: "besu",
PROD_NETWORK_ID: 2018,
DEV_NETWORK_TYPE: "private",
PROD_NET_MODE: false
}- The
RECLOTHES_SHOP_ADDRESS_DEVandRECLOTHES_SHOP_ADDRESS_PRODvalues must contain, respectively, the addresses for Ganache (local) and Hyperledger Besu network development of your ReclothesShop smart contract deployed instance. - The
RESELLING_CREDIT_ADDRESS_DEVandRESELLING_CREDIT_ADDRESS_PRODvalues must contain, respectively, the addresses for Ganache (local) and Hyperledger Besu network development of your ResellingCredit smart contract deployed instance. - The
WEB3_PROVIDERis the instance of Web3 library injected by MetaMask in your browser. - The
PROD_NETWORK_TYPEandPROD_NETWORK_IDare the "production" network type/name (for Hyperledger Besu networks, the value isbesu) and the correspondent chain id (for besu, the chain id is2018). - The
DEV_NETWORK_TYPEindicates the network type/name for local development (for Ganache networks, the value isprivate). - The
PROD_NET_MODEis a boolean flag which must be set totruewhen using Hyperledger Besu, otherwisefalse.
(nb. The present src/constants/environment.ts file contains the addresses of the smart contracts released following the back-end README instructions. There should be no changes if no adjustments are made to the released default configurations.)
To start the ReactJS application.
npm startRun ESLint to check the syntax and style of your TypeScript code.
npm run lintFigure 2. Page for guiding the user to onboard with MetaMask
Figure 3. Shop page for a non-customer user
Figure 4. Shop page for a customer
Figure 5. Boxes page for a customer
Figure 6. Form for sending a new box of second-hand clothes
Figure 7. Collection page for a customer
See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
feat: add hat wobble
^--^ ^------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.
More Examples:
feat: (new feature for the user, not a new feature for build script)fix: (bug fix for the user, not a fix to a build script)docs: (changes to the documentation)style: (formatting, missing semicolons, etc.; no production code change)refactor: (refactoring production code, e.g., renaming a variable)test: (adding missing tests, refactoring tests; no production code change)chore: (updating grunt tasks etc.; no production code change)
References:
- The master branch must be used for releases only.
- There is a dev branch, used to merge all sub dev branch.
- Avoid long descriptive names for long-lived branches.
- No CamelCase.
- Use grouping tokens (words) at the beginning of your branch names (in a similar way to the
typeof commit). - Define and use small lead tokens to differentiate branches in a meaningful way to your workflow.
- Use slashes to separate parts of your branch names.
- Remove branch after merge if it is not essential.
Examples:
git branch -b docs/README
git branch -b test/one-function
git branch -b feat/side-bar
git branch -b style/header
This repository is released under the MIT License.
Ethereum Frontend Boilerplate © 2020+, LINKS Foundation







