DEV Community

Discussion on: Build a Web3 Dapp in React & Login with MetaMask

Collapse
 
dolz profile image
Ramiro Dutto Luquez

I'm starting with Dapp programming. One thing that I do not understand is when you talk about backend side authentication.

It is assumed that in a Dapp we have the business logic in the smart contract and on the other hand we have the frontend that performs the communication directly with the smart contract. Is it like this? or do we also have to develop a backend server?

Collapse
 
jacobedawson profile image
Jacob E. Dawson

Hi Ramiro - you're exactly right - you can think of a smart contract as replacing a traditional backend server, so the smart contract includes the state & functions as opposed to, say, a NodeJS + MongoDB backend.

Having said that, it's also possible (and even necessary, depending on complexity) to employ state that is retrieved from "off-chain" sources, such as TheGraph subgraphs, since for some types of data & complex queries it's not feasible to store & read everything from a smart contract.