Before you dive into web development—especially the back end—you should understand the web: how it works and what its main pieces are. This article covers those basics.
Originally published on Medium in FAUN.dev().
Components of the web

There are two things you must understand:
- Client (e.g. browser)
- Server
The client (usually a browser) requests a website or some data from the server. A server is a remote system—a computer connected to the internet all the time—that listens for those requests and sends back a valid response. That whole cycle is the request–response cycle, or client–server architecture.
Here’s a concrete example. When I enter www.google.com in my browser (not Internet Explorer—just kidding), my system and browser act as the client. Google has many servers waiting for such requests. They validate, compute if needed, maybe check a database, and send back a response—usually an HTML document—which gets parsed and rendered on my screen.

That’s the top-level view. Let’s go a level deeper.
DNS lookup
This is the first thing that happens after you enter a domain or URL and hit enter. For humans, remembering a domain like www.google.com is far easier than a public IP such as 216.58.211.206:443. The domain means nothing to the network by itself, so a DNS lookup runs first and resolves the public IP associated with that domain.

TCP/IP socket connection
Once the browser has the server’s IP from DNS, it opens a TCP/IP socket connection between client and server. That connection is what makes communication between them possible.
HTTP request
With the socket in place, the client sends an HTTP request to the server. In the diagram above you can see what a request looks like: a start line with the HTTP method (what kind of request this is—more on methods later), the request target, and the HTTP version; headers with information about the request; and optionally a body when you send data (for example with POST, PUT, or PATCH). HTTP methods are covered at the end of this article.
HTTP response
The server receives the request, runs any needed computation and validation, then sends back a response. The response object looks a lot like the request the browser sent.

That response might be JSON, HTML, or something else. If it’s HTML, the browser parses it and requests linked files from the server—repeating a similar process for each asset—until the page is rendered.
When the request–response cycle is done, the TCP/IP socket connection is closed.
That’s a brief look at how the web works. I hope the flow is clear.
HTTP methods
An HTTP request can be of different types. If you want data from a server, that’s typically a GET. If you want to send data and create a new entry, that’s often a POST. There are other methods for other use cases as well.
Some of the diagrams in this article come from the theory lectures of a Udemy course on Node.js development. I purchased the course, which is why I have access to them—I don’t own them. The course is linked below if you want to check it out; it’s the one I used to start my back-end journey.
Node.js, Express, MongoDB & More: The Complete Bootcamp 2021
Thanks for reading—I hope this helps you become a better developer. See you next time.



