I am learning solidity from last 3 months but now I am confused how to connect your contract with frontend (with react or next).
Every developer has their own way of applying it as i am, i want to with the best way
like with hardhat or truffle
I am learning solidity from last 3 months but now I am confused how to connect your contract with frontend (with react or next).
Every developer has their own way of applying it as i am, i want to with the best way
like with hardhat or truffle
2
Answers
Regarding connecting to the provider, @web3-react (docs) is the most used package I believe. It supports a wide variety of connectors (Metamask, …) and you can find some good examples by googling.
Then you need either "ethers" or "web3js" to send transactions, etc. Choose whatever you’re already familiar with.
IMO, A good boilerplate to start coding on web3 is:
Frontend :
SmartContract :
Generally speaking of a web3 project, a backend is nothing but a RPC Node who speaks to blockchain, So using ReactJs or NextJs is up to you. But for a beginner I would recommend using ReactJS only. I suggest you look into reputable sources such as Uniswap and OpenZeppelin