I have developed my ethereum smart contract and I want to integrate it with my web application. But I don't know that is integration with ReactJS a better option or integration with nodejs a better one. Please give suggestions . Also I don't know how to do integration with backend through web3 library so please guide me about that.
CodePudding user response:
When you are creating web3
app , most of the time you are not going to need a backend for that (Although you need a server to host your website) .
Working with and managing smart contracts are very easy at the front-end and there is no need for backend, but if your working on a large scale project , you are definitely going to need a backend for handling complex logics .
Next js
is best option for both of that , containing node
and react
, also no need for manually configuring web server.
CodePudding user response:
Better is next.js. I explained it here: https://ethereum.stackexchange.com/questions/129547/next-js-versus-react-which-to-use-when-for-your-dapp/130040#130040
Not every browser has metamask extension. By using next.js, when our code is taken and rendered on the server, on the next server we can reach out to the Ethereum network and do some initial calls like data fetching, or alist of items in your smart contract. we execute all of those requests on the server. That means when next.js produces Html documents to send down to the user browser, it does not matter whether or not users are using metamask. It does not matter whether or not they have access to an Ethereum network. Because we already take care of the data fetching for them. So all the users out there who are not using metamask are going to see some information on the screen.