Web Development · Basics Explained
How Does Web Development Actually Work? Explained Simply
Quick summary — how web development actually works
Web development actually works as a request and response conversation between a browser and a server. The browser finds the server's address using DNS and sends an HTTP request. Backend code on the server handles it, often reading or writing a database, and sends back HTML or JSON. Frontend code — HTML, CSS and JavaScript — then turns that response into the page you see and interact with.
In this guide you will learn:
- The request journey — DNS, HTTP and what happens in under a second.
- Frontend vs backend vs database — who does what, with examples.
- Small code you can run — a page, a JavaScript call and a tiny server.
- Learning templates — a request tracer and a beginner roadmap.
- Interview questions — web basics asked in fresher interviews.
SECTION 01What happens when you open a website
Imagine typing example.com into your browser. Your computer first needs the server's numeric address, so it asks the Domain Name System (DNS), which works like the internet's phone book. Once it has the IP address, the browser opens a secure connection (HTTPS) and sends an HTTP request saying, in effect, "please give me the home page".
The server replies with an HTTP response: a status code such as 200 (OK) or 404 (Not Found), some headers, and the content — usually HTML. The browser reads the HTML, fetches the CSS, JavaScript and images it references, and paints the page. All of this usually happens in well under a couple of seconds.
| Step | What happens | Technology | If it fails |
|---|---|---|---|
| 1. DNS lookup | Domain name turned into an IP address | DNS | Site cannot be found |
| 2. Connection | Secure connection to the server | TCP, TLS (HTTPS) | Connection or certificate error |
| 3. Request and response | Browser asks, server answers | HTTP methods and status codes | Errors like 404 or 500 |
| 4. Rendering | Browser builds the visible page | HTML, CSS, JavaScript | Broken layout or blank page |
# See the raw HTTP conversation (Windows 10+, macOS and Linux have curl)
curl -I https://example.com
# Typical response headers:
# HTTP/2 200
# content-type: text/html; charset=UTF-8
# ...
# Find the IP address behind a domain
nslookup example.com
COMMON HTTP STATUS CODES
200 OK Request worked
201 Created New item saved (e.g. after a form)
301 Moved Permanently Page has a new address
304 Not Modified Use your cached copy
400 Bad Request The request was malformed
401 Unauthorized You need to log in
403 Forbidden Logged in, but not allowed
404 Not Found Page or item does not exist
500 Internal Server Error Bug or crash on the server
SECTION 02Frontend, backend and database: who does what
Web development is usually split into three layers. The frontend runs in the user's browser and controls what they see and click. The backend runs on a server and handles logic — checking passwords, calculating prices, deciding what data a user may see. The database stores information permanently, such as users, orders and posts.
A full-stack developer works across all three. Many beginners start on one side: frontend if they enjoy visual work and interaction, backend if they prefer logic, data and APIs. Both paths need a basic understanding of the other layers.
| Layer | Runs where | Common technologies | Example job |
|---|---|---|---|
| Frontend | User's browser | HTML, CSS, JavaScript, React | Show product cards and a cart button |
| Backend | Web server or cloud | Python (Django, FastAPI), Node.js, Java | Check stock and calculate the total |
| Database | Database server | PostgreSQL, MySQL, MongoDB | Store orders and customer details |
| APIs | Between frontend and backend | REST with JSON | Send cart data to the server |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My First Page</title>
<style>
body { font-family: sans-serif; margin: 2rem; }
.price { color: green; font-weight: bold; }
</style>
</head>
<body>
<h1>Notebook</h1>
<p class="price">₹120</p>
<button id="buy">Add to cart</button>
<p id="message"></p>
<script src="app.js"></script>
</body>
</html>
// app.js — send data to a backend API when the button is clicked
document.querySelector("#buy").addEventListener("click", async () => {
const response = await fetch("http://127.0.0.1:8000/cart", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ item: "Notebook", qty: 1 }),
});
const data = await response.json();
document.querySelector("#message").textContent = data.message;
});
SECTION 03A tiny backend and how websites go live
The backend receives requests, runs logic and replies — often with JSON for the frontend to display. The example below uses Python's FastAPI to answer the button click from the previous section. In a real app, the server would also save the cart to a database.
To go live, code is deployed to a server or cloud platform, a domain name is pointed at it with DNS, and HTTPS is enabled with a certificate. Static sites (only HTML, CSS and JavaScript) can be hosted very simply; dynamic apps need a running backend and usually a database.
| Site type | What it needs | Typical hosting | Example |
|---|---|---|---|
| Static site | HTML, CSS, JS files only | Static hosting or CDN | Portfolio, landing page |
| Dynamic site | Backend code + database | Cloud server or platform service | Online store, social app |
| Single-page app | Frontend app + API backend | Static host + API server | Dashboard, web email |
| Content-managed site | CMS software + database | Managed CMS hosting | Blog, news site |
# server.py — pip install fastapi uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
app = FastAPI()
app.add_middleware(CORSMiddleware, allow_origins=["*"],
allow_methods=["*"], allow_headers=["*"]) # demo only
class CartItem(BaseModel):
item: str
qty: int
@app.post("/cart")
def add_to_cart(cart_item: CartItem):
return {"message": f"Added {cart_item.qty} x {cart_item.item} to your cart"}
# Run: uvicorn server:app --reload (serves on http://127.0.0.1:8000)
-- What the backend might store in a real app
CREATE TABLE cart_items (
id SERIAL PRIMARY KEY,
user_id INT NOT NULL,
item TEXT NOT NULL,
qty INT NOT NULL CHECK (qty > 0),
added_at TIMESTAMP DEFAULT NOW()
);
INSERT INTO cart_items (user_id, item, qty)
VALUES (42, 'Notebook', 1);
SELECT item, qty FROM cart_items WHERE user_id = 42;
SECTION 04Templates to learn web development step by step
Use these to explore any website and plan your own learning.
REQUEST TRACER (use browser DevTools > Network)
Website : ____________________
First request : ____ Status: ___ Time: ___ ms
Number of requests on load: ___
Largest file : ____________ (___ KB)
Any API calls? : ____________ (returns JSON? Y/N)
Any 4xx/5xx errors: ___
What I learned : ____________________
BEGINNER ROADMAP
Step 1 HTML structure and forms
Step 2 CSS layout: Flexbox, Grid, responsive design
Step 3 JavaScript: DOM, events, fetch
Step 4 Git and GitHub
Step 5 One backend language (Python or Node.js)
Step 6 SQL and one database
Step 7 REST APIs: build and call them
Step 8 A frontend framework (e.g. React)
Step 9 Deploy a full project with HTTPS
FIRST PROJECT PLAN
Idea : ____________ (e.g. recipe saver)
Pages : home, list, add form
Frontend : HTML, CSS, JavaScript
Backend : ____________ (2-3 API routes)
Database : one table: ____________
Deploy to : ____________
Done when : I can add an item and see it after refresh
SECTION 05Tips for understanding web development faster
These habits make the pieces click much sooner:
- Use DevTools daily — inspect elements and watch network requests on sites you use.
- Build tiny things — a one-button page that calls one API teaches more than reading.
- Learn HTTP early — methods, status codes and headers appear everywhere in web work.
- Draw the request path — sketch browser, server and database for every project you build.
- Deploy early — putting even a simple page online teaches DNS, hosting and HTTPS.
SECTION 06Interview Q&A — web development basics
Q1What happens when you type a URL and press Enter?
The browser resolves the domain through DNS, opens a TCP and TLS connection, sends an HTTP request, the server processes it and returns a response, and the browser parses the HTML, loads assets and renders the page.
Q2What is the difference between GET and POST?
GET requests data and should not change anything on the server; its parameters appear in the URL. POST sends data in the request body, typically to create something.
Q3What is the difference between frontend and backend?
The frontend runs in the browser and handles what users see and interact with. The backend runs on servers and handles logic, security and data storage.
Q4What is an API?
An API is a defined way for programs to talk to each other. In web development it usually means URLs on a server that accept requests and return data, often JSON.
Q5What is CORS?
Cross-Origin Resource Sharing is a browser security mechanism that controls whether a web page from one origin can call an API on another origin. The server must allow it with specific headers.
SECTION 07Test yourself — how web development works
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
How do websites work in simple words?
Your browser asks a server for a page, the server sends back code and data, and your browser turns that code into the page you see. Databases store the information the server needs.
What is the difference between a website and a web application?
A website mainly shows information, like a brochure. A web application lets users do things — log in, buy, post, edit — and needs backend logic and usually a database.
Which language should I learn first for web development?
Start with HTML, CSS and JavaScript, because every website uses them. Then choose a backend language such as Python or JavaScript with Node.js.
Is web development hard for beginners?
The basics are approachable, and you can build simple pages within days. Becoming job-ready takes months of steady practice and several projects.
Do I need a degree to become a web developer?
Many employers focus on skills and portfolio, though some prefer degrees. Real projects, clean code on GitHub and good fundamentals matter a lot.
SECTION 09Related reads
Classroom & online · Noida
Start building real web backends
Our Python Training Course covers core Python, APIs, databases and projects — the backend skills behind the web pages you use every day.
Talk to a counsellor for current fees- Core Python
- APIs & databases
- Project work
- Weekday & weekend batches