There are multiple ways of building a web app. One of the most common architectures looks like this:

flowchart LR
	Frontend <-- request --> API <--> Database