DEV Community

Paras Kavdikar
Paras Kavdikar

Posted on

Ever wondered how a generic web app works in the background when you visit a website on your computer?

User hits a url like 'www example com' in the browser, DNS provides the browser with the ip address of the hosting server (provided by hosting services like netlify/vercel) where your frontend code lives. Then the browser does a https handshake (using tls security, enabling an encrypted tunnel) between browser and the hosting server. After the connection, the frontend/react code is downloaded and executed in the browser. It calls the node js/backend apis running on the backend servers via an http request using browser APIs like fetch/axios (The browser APIs allows javascript to interact with external sources). The backend api takes in the request, does any required database operations and then sends an http response (usually JSON) back to the react code running in the browser. The react code takes in the http response and renders the UI corresponding to the http response and you see the changes on the website.

Top comments (0)