A DApp is an application that uses smart contracts to run. Smart contracts are deployed on an Ethereum Virtual Machine (EVM). It is similar to a client-server two-tier architecture, where there is no need for any middlemen to operate. A DApp can have a frontend (web) that makes calls to its backend (smart contract) through the web3.js API.
To interact with a blockchain smart contract, web3.js typically connects with a wallet—one of the most popular browser wallets is MetaMask. The wallet will connect with a backend blockchain node instance and send a request to the blockchain.
The following diagram shows a typical DApp architecture and the flow interactions between the frontend and backend:
In this chapter, we are going to follow the preceding diagram to build our decentralized digital art market DApp. A frontend tier on the client side will use React...