I'm building a Dapp using NodeJS and Express with ejs files. I wonder should I call web3 API in the Backend JS file or front end EJS/HTML files?
Some thoughts I have is:
calling web3 api in backend is more easy to control, but the problem is when the code is executing concurrently, it is possible that some blocks has not been mined and the future function is already being called which requires the previous function to be completed first.
calling web3 api in front end EJS file would be a little complicated since I need to pass the contract and account addresses and require all the ethereum modules at front end.
I'm new to Dapp development, please correct me if I'm wrong and please give me some advices or examples.