web-development

Introduction to Web Application Development: How a Click Becomes a Page

beginnersclient-serverhow-the-web-workshttphttpsweb-development
Gerald VillorenteDecember 1, 202617 min read
Introduction to Web Application Development: How a Click Becomes a Page

You type an address, press Enter, and a page appears in half a second. Nobody applauds, because it happens a hundred times a day — but behind that half-second sits the most successful machine humanity ever built. This post opens the hood: every stop your click makes, every worker that touches it, and every big word explained in plain, friendly language — no prior knowledge needed, just curiosity.

What you will learn: the client-server partnership, the full journey of one click (browser, DNS, server, and back), what HTTP and HTTPS actually do, how the HTTPS handshake and ciphers protect you, what ports are, and what each server-side part does.

The big idea: client-server in 60 seconds

Every web app is a conversation between two computers:

  • The client — usually your browser — is the customer. It asks for things.

  • The server — a computer in a data center — is the restaurant. It prepares answers.

The customer never enters the kitchen. It sends an order (a request: "bring me the menu page") and receives a tray (a response: "here is the menu page, plus pictures"). That round trip — request out, response back — is the entire HTTP life cycle. Everything below is just the details of how the order travels and how the kitchen works.

The journey of a click, stop by stop

Follow one click on https://example.com/blog/hello. Eight stops, each with one job.

The journey of a click: browser, DNS, TCP handshake, TLS handshake, routers, web server, app and database, and the rendered page coming back

Stop 0: Your browser reads the address

Before anything leaves your laptop, the browser dissects the URL — the address is instructions, not just a name:

https://  example.com  :443  /blog/hello  ?sort=new  #comments
|         |            |     |            |          |
protocol  domain       port  path         query      fragment
  • Protocol (https) — which language to speak. More in the HTTPS section.

  • Domain (example.com) — the restaurant's name. Computers need its street address, which comes next.

  • Port (:443) — the apartment number. Browsers hide it when it is the default, which is why you rarely see it.

  • Path (/blog/hello) — which dish to order.

  • Query (?sort=new) — options on the order ("sorted by new, please").

  • Fragment (#comments) — a note the browser keeps for itself ("scroll to comments after loading"). It never leaves your laptop.

Then the browser checks its own memory: "Have I fetched this exact page recently, and am I allowed to reuse it?" If yes, the journey ends here in milliseconds — that reused copy is the browser cache. If no, the trip begins.

Stop 1: DNS finds the street address

Computers call each other by IP address — a street address like 93.184.216.34 (IPv4) or a longer IPv6 cousin. Humans cannot remember those, so the Domain Name System (DNS) — the phonebook of the internet — translates names to numbers:

  1. Your computer asks a recursive resolver (usually run by your internet provider, or a public one like Cloudflare's 1.1.1.1): "Where is example.com?"

  2. The resolver asks a root server: "Who handles .com?" The root points down a level.

  3. The resolver asks the .com (TLD) server: "Who handles example.com?" It points to the domain's own server.

  4. The resolver asks the authoritative server — the restaurant's own receptionist: "What is the street address?" It answers: 93.184.216.34.

Every answer carries a TTL ("time to live" — how long to trust this before asking again), and every level caches aggressively, so most visits skip straight to a remembered answer. If DNS fails, you get the classic "server not found" — the phonebook had no listing.

Stop 2: TCP shakes hands

Knowing the address is not enough — the two computers must agree they can hear each other. TCP (the delivery-truck company of the internet) opens every conversation with a three-part knock:

Browser: "Can you hear me?"            (SYN)
Server:  "I hear you — hear me?"       (SYN-ACK)
Browser: "Loud and clear. Let's talk." (ACK)

This TCP handshake takes one round trip. TCP also numbers every package and re-sends lost ones, which is why downloads arrive complete instead of scrambled — guaranteed delivery, in order, at the cost of a little patience.

Stop 3: TLS agrees on secrets (HTTPS only)

On plain HTTP the conversation would start now, readable by anyone in the middle. On HTTPS, both sides first perform the TLS handshake — a secret handshake that agrees on encryption before a single word of your business is spoken. It is important enough to get its own section below; for the journey, just know it adds roughly one to two round trips and ends with a private language nobody else speaks.

Stop 4: The request crosses the internet

Now the browser finally sends its order — an HTTP request, plain text with a strict shape:

GET /blog/hello?sort=new HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Macintosh; ...)
Accept: text/html

Line one is the order: a method (GET = "bring me this"; others include POST = "take this new thing", PUT = "replace that thing", DELETE = "remove it"), the path, and the HTTP version. The following lines are headers — sticky notes on the order ("I accept HTML pages", "I speak English"). A POST would add a body below the headers — the actual parcel (form data, a photo, JSON).

The request hops through routers — mail-sorting offices that forward each package toward its address. Nobody promises which roads it takes, only that TCP will reassemble everything in order at the end.

Stop 5: The server cooks the answer

Arrival! The order passes through the server team, each member doing one job (full tour with its own diagram in the server section):

  1. Firewall — the bouncer. Only expected doors (ports) are open; everything else bounces.

  2. Web server — the front door and greeter (Nginx, Apache, Caddy). Speaks HTTP, serves simple files directly, and forwards hard orders inward.

  3. Application server — the kitchen. Runs the app's code (Node.js, Python, PHP…), which decides what the page should contain.

  4. Cache — sticky notes (often Redis). "Did we answer this exact question recently?" A yes skips all the hard work.

  5. Database — the filing cabinets (PostgreSQL, MySQL…). Every fact the app must remember across visits lives here.

  6. Filesystem — the pantry shelves. Uploaded photos, videos, and the app's own files sit on disk.

Stop 6: The response travels home

The kitchen's answer rides back as an HTTP response:

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1256

<!doctype html>...

Line one carries the status code — the waiter's facial expression:

  • 2xx (200, 201) — smile. "Here you go / done." 200 means success; 201 means "created something new for you."

  • 3xx (301, 302) — detour sign. "That dish moved — ask over there instead." Your browser follows automatically.

  • 4xx (400, 401, 403, 404) — "the problem is your order." 404 means "no such dish"; 403 means "that dish is not for you"; 401 means "identify yourself first."

  • 5xx (500, 502, 503) — "the problem is our kitchen." 500 means something broke inside; 503 means "we are overwhelmed, try later."

Headers describe the tray (Content-Type says what kind of food this is), and the body is the meal — usually HTML.

Stop 7: Your browser builds the page

HTML arrives as flat text. The browser turns it into a living page in four moves:

  1. Parse — read the HTML skeleton into a family tree of elements (the DOM: "this heading lives inside that section").

  2. Style — fetch the CSS (the clothes) and decide every color, size, and position.

  3. Layout and paint — compute the geometry, then draw pixels to the screen.

  4. Activate — run the JavaScript (the muscles): menus open, buttons react, new data loads without reloading.

Along the way the browser fires off more requests — images, fonts, stylesheets, scripts — each one repeating stops 1 through 6 (often with DNS and handshakes skipped thanks to reuse). That first half-second was just the headline act.

If you only remember one thing: a click is an order that travels browser → phonebook → handshake → kitchen → back, and every stop exists to answer exactly one question: where, can-you-hear-me, is-this-private, what-do-you-want, and here-you-go.

HTTP vs HTTPS: postcard vs sealed envelope

HTTP (HyperText Transfer Protocol) is the language of orders and trays — and by itself, it is a postcard. Every router, Wi-Fi owner, and snoop between you and the server can read it: your passwords, your messages, your medical searches.

HTTPS is HTTP inside a sealed envelope. The letter is identical; the envelope adds three promises:

  • Encryption — scrambled so middlemen see only noise.

  • Identity — proof the server really is who it claims (no impostor restaurants).

  • Integrity — a tamper seal: if anyone alters a word in transit, the browser notices and refuses the page.

That is why browsers show a padlock for HTTPS and a "Not Secure" warning for HTTP — and why you should never type a password into a non-padlock page. One honest limit: the envelope protects the journey, not the destination. The server itself still reads everything — HTTPS cannot save you from a restaurant that writes down your credit card and leaves it on the counter.

The HTTPS handshake, slowly

Before any HTTP crosses the wire, browser and server perform the TLS handshake — "TLS" is the handshake's real name; "SSL" is its retired grandparent that everyone still says out of habit. Here is the classic version, one move at a time:

  1. ClientHello — the browser knocks and lists what it speaks: "I know TLS 1.2 and 1.3, here are the secret recipes (cipher suites) I accept, and here is a random number for later."

  2. ServerHello + certificate — the server picks one recipe, sends its own random number, and shows its ID card: a certificate containing its domain name and its public key. Think of the public key as an open padlock the server hands out freely — anyone can snap it shut, but only the server holds the private key that opens it.

  3. ID inspection — the browser interrogates the certificate: Was it issued by a Certificate Authority (CA) I trust (the DMV of the internet, pre-installed in every browser)? Is it unexpired? Does the name match the site I asked for? One "no" and you get the scary full-page warning — which you should respect, not click through.

  4. Agreeing on a secret, in public — the browser invents a secret, locks it with the server's public padlock, and sends it over. Eavesdroppers see only a locked box; the server opens it with its private key. (Modern handshakes use ECDHE math that achieves the same "agree in public" trick with an extra safety property — even if someone steals the server's keys later, they cannot unlock past conversations. That property is called forward secrecy.)

  5. Finished — both sides combine the secret with the earlier random numbers to cook identical session keys, then exchange encrypted "done!" messages. If both decode, the handshake worked.

  6. HTTP begins — every request and response from here on is encrypted with the session keys.

What about TLS 1.3? (One paragraph for the curious)

TLS 1.3 — what most of the web negotiates today — compresses the handshake to a single round trip and deletes the oldest, weakest recipes entirely. The story above is the TLS 1.2 shape because every step is visible; in 1.3 the same jobs happen, just with fewer letters exchanged. If you remember "hello, ID check, agree on secret, go," you understand both versions.

Ciphers: the secret recipes, dissected

A cipher suite is the exact recipe both sides agreed to use — four ingredients, each with one job. Take a real one and pull it apart:

TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
    |      |         |           |
    |      |         |           tamper seal (integrity)
    |      |         scrambling method (encryption)
    |      identity check (authentication)
    secret-agreement trick (key exchange)

In plain words:

  • Key exchange (ECDHE) — the trick from handshake step 4: two strangers agreeing on a secret while the whole classroom listens. ECDHE does it with special math (elliptic curves — you do not need the details, only the magic: public discussion, private result).

  • Authentication (RSA) — how the server proves its ID card is real: math that only the true key-holder can answer correctly.

  • Encryption (AES_128_GCM) — the actual scrambling of your data. AES is the scrambling machine, 128 is the key size (a bigger number means a vastly harder lock to pick), and GCM is the careful mode that scrambles and seals in one pass.

  • Integrity (SHA256) — the tamper seal. SHA-256 fingerprints every message; change one comma and the fingerprint mismatches, exposing the meddling.

During ClientHello the browser offers a menu of recipes; the server picks the strongest one both know. Old, broken recipes (RC4, DES, export-grade ciphers — the rusty padlocks of the 1990s) are extinct in modern browsers, which is another quiet reason to keep your browser updated.

Ports: apartment numbers on every computer

An IP address finds the building; a port finds the apartment. One server can run a dozen services, and the port number says which door to knock on. Ports range from 0 to 65,535, and the famous ones are famous because the whole world agreed on them:

  • Port 80 — HTTP. The web's original front door, unlocked. Browsers use it automatically for http:// addresses, which is why you never type it.

  • Port 443 — HTTPS. The web's armored front door. Browsers use it automatically for https:// addresses. When someone says "the site runs on 443," they mean "secure web traffic lives here."

  • Port 22 — SSH. The staff entrance for administrators: encrypted remote control of the server itself.

  • Port 53 — DNS. The phonebook's own counter — every name lookup knocks here.

  • Ports 25 and 587 — email. 25 is post-office-to-post-office delivery; 587 is you handing your letter to your post office.

  • Port 3306 — MySQL. Port 5432 — PostgreSQL. The filing-cabinet rooms. Databases listen here — but only for the app, never for the public.

  • Port 6379 — Redis. The sticky-note drawer (cache), same deal: app only.

  • Ports 3000, 8000, 8080 — the practice rooms. Developers run test servers here (localhost:3000 means "my own laptop, apartment 3000") because the real doors need no permission slips on your own machine.

Two practical consequences. First, a firewall is mostly a door policy: "443 open to the world, 22 open only to the office, everything else shut." Most break-ins start at a door nobody remembered leaving open. Second, when a URL shows no port, the browser fills in the default (80 for HTTP, 443 for HTTPS) — :3000 appears precisely because it is not a default and must be said out loud.

The server side: who does what in the kitchen

Time to meet the crew from stop 5 properly. Each member owns exactly one job, and understanding the split is what turns "the backend" from a fog into a floor plan.

How the server side works together: web server, application server, cache, database, and filesystem, with answers flowing back

Web server — the greeter (Nginx, Apache, Caddy)

The web server owns the front door. It speaks HTTP all day: it takes every order, serves simple static files itself (images, stylesheets — no cooking needed), and forwards the hard orders to the kitchen. It also terminates TLS (unseals the HTTPS envelopes), enforces speed limits, and can balance orders across several kitchens (load balancing) when one restaurant gets too popular. Rule of thumb: if the answer never changes, the web server hands it over without bothering anyone else.

Application server — the kitchen (Node.js, Python, PHP, Ruby…)

This is where your code runs. The application server takes forwarded orders, runs the recipe (check the login, build the page, validate the form, charge the card), and hands a finished tray back to the greeter. Unlike the greeter, the kitchen forgets everything between orders — each request starts fresh — which is exactly why the next two members exist.

Cache — the sticky notes (Redis, Memcached)

The cache is pure laziness, weaponized: a lightning-fast drawer of remembered answers. "Homepage for a logged-out visitor?" Answered a thousand times a minute — serve the sticky note, skip the kitchen entirely. Anything can be cached — pages, database answers, computed results — and every cache entry carries an expiry, because a sticky note that never updates becomes a lie. When someone says a site "scales," they usually mean it caches well.

Database server — the filing cabinets (PostgreSQL, MySQL…)

The database is the organization's memory: users, orders, posts, passwords (scrambled, never plain — see the cipher section for the scrambling spirit). It promises that written data survives crashes and reboots (durability) and that simultaneous writers never corrupt each other (transactions). The kitchen asks questions in SQL ("find every order by customer 42, newest first") and gets precise piles of facts back. If the kitchen burns down, the filing cabinets rebuild the business — which is why databases get backups and nothing else in this list matters as much.

Filesystem — the pantry shelves (disk)

Not everything belongs in filing cabinets. Uploaded photos, videos, generated PDFs, and the app's own code live as plain files on disk — the pantry. Files are cheap and simple; databases are searchable and strict. The eternal beginner question "database or files?" answers itself: facts you search, sort, and connect go in the database; bulky blobs you fetch whole go on disk (with the database remembering where each blob lives).

How one order flows through them

Watch a login travel the crew:

  1. The greeter (web server) accepts the HTTPS order and forwards it to the kitchen.

  2. The kitchen (app server) checks the sticky notes (cache): "recent login result for this user?" Miss — cook it fresh.

  3. The kitchen queries the filing cabinets (database): "fetch this user's record," compares the scrambled password, and writes a "logged in" memory.

  4. The kitchen optionally stores the user's profile photo path — the photo itself waits on the pantry shelves (filesystem) for a later, simpler request.

  5. The finished tray travels back: kitchen → greeter → internet → your browser, which renders "Welcome back."

Each member trusts the others to do their one job — and every performance war story you will ever hear is about one member getting overwhelmed while the rest stood idle.

Jargon buster: the whole post on one card

  • Client — the customer. Usually your browser: asks, never cooks.

  • Server — the restaurant. A computer that answers requests all day.

  • Request / Response — the order and the tray. The whole web is these two, repeated billions of times.

  • Protocol — the agreed language. HTTP for orders, DNS for phonebook lookups, TCP for delivery trucks.

  • URL — the full written order: language + name + apartment + dish + options.

  • DNS — the phonebook: names in, street addresses (IPs) out.

  • IP address — a computer's street address on the internet.

  • TCP — the delivery company: knocks first (handshake), numbers packages, re-sends the lost ones.

  • TLS / SSL — the secret-handshake ritual that makes HTTPS private. SSL is the retired name; TLS is the living one.

  • Handshake — the opening ceremony before business: hellos, ID checks, and agreed secrets.

  • Cipher / cipher suite — the exact secret recipe: how to agree, prove identity, scramble, and seal.

  • Certificate — the server's ID card, vouched for by a Certificate Authority.

  • Certificate Authority (CA) — the DMV of the internet: issues and vouches for ID cards.

  • Port — the apartment number: which service on this computer?

  • Firewall — the bouncer: decides which doors stand open and for whom.

  • CDN — photocopy shops in cities near you: copies of files, served fast.

  • Cache — sticky notes of remembered answers. Every layer keeps its own.

  • Web server — the greeter: speaks HTTP, serves simple files, forwards hard orders.

  • Application server — the kitchen: runs the app's code, forgets everything between orders.

  • Database — the filing cabinets: permanent, searchable memory.

  • Filesystem — the pantry shelves: plain files on disk.

  • Browser — the customer, the builder, and the gallery: orders pages, builds them, and shows them.

  • Render — turning flat HTML text into the living page you see and touch.

Takeaways

  • The web is clients ordering and servers answering — request out, response back, billions of times a day.

  • One click travels further than it looks: browser memory, DNS phonebook, TCP knock, TLS secret handshake, routers, the five-member server crew, and home again.

  • HTTPS is HTTP in a sealed envelope: same letter, plus encryption, identity, and tamper seals — agreed before a word of business is spoken.

  • Cipher suites are four-ingredient recipes (agree, prove, scramble, seal), and ports are apartment numbers every service listens behind.

  • Server-side, everyone owns one job: greeter, kitchen, sticky notes, filing cabinets, pantry. Learn the split and "the backend" stops being a fog.

Keep learning

Related reading

PHP2Shell: The Critical PHP Flaw Every Website Owner Must Fix Now
security

PHP2Shell: The Critical PHP Flaw Every Website Owner Must Fix Now

October 23, 2026
beginnersphpsecurityserver-hardening
Read →
Introduction to JavaScript: From Your First Line to Real-World Code
tutorials

Introduction to JavaScript: From Your First Line to Real-World Code

October 16, 2026
beginnerses6javascriptprogramming-fundamentals
Read →