Phase 0 Understand how websites work
Before writing code, understand these concepts.
Learn:
What is a website?
Browser vs server
Frontend vs backend
Database
HTTP
Request
Response
URL
Domain
IP address
HTTP vs HTTPS
GET vs POST
Client-server architecture
You should be able to understand:
You
โ
Chrome
โ
Internet
โ
Server
โ
Application
โ
Database
โ
Server
โ
Chrome
โ
You
Practice
Open browser DevTools โ Network tab.
Visit a website and observe:
Request
Response
Status Code
Method
URL
Headers
Response
Don't worry about understanding everything yet.
Phase 0 โ How Websites Work
[!NOTE]
You don't need to memorize any of this. Read it, understand the big picture, and come back as a reference. Everything will become clearer once you start writing code.
1. What is a Website?
A website is a collection of files (text, images, code) stored on a computer somewhere in the world. When you "visit" a website, your browser downloads those files and displays them on your screen.
Think of it like a restaurant:
| Restaurant | Website |
|---|---|
| You (the customer) | You (the user) |
| The menu you see | The webpage you see (HTML, CSS) |
| The kitchen | The server |
| The recipe book | The application code |
| The pantry/fridge | The database |
| The waiter | HTTP (the protocol carrying requests & responses) |
Key takeaway: A website isn't a single magical thing โ it's files on someone else's computer, delivered to your computer over the internet.
2. Browser vs Server
Browser (Client)
The browser is the app on your device โ Chrome, Firefox, Edge, Safari. Its job is to:
- Send requests โ "Hey, give me google.com"
- Receive files โ HTML, CSS, JavaScript, images
- Render (display) those files as a visual webpage
The browser is also called the client โ the one asking for something.
Server
A server is a computer (usually in a data center) that is always on and always connected to the internet, waiting to respond to requests.
Its job is to:
- Listen for incoming requests
- Process the request (look up data, run logic)
- Send back a response (usually an HTML page, JSON data, or files)
Real-world analogy:
- Browser = You calling a pizza shop on the phone
- Server = The pizza shop answering the phone, making your pizza, and delivering it
[!TIP]
Your own laptop can act as a server! When you learn backend development, you'll run a "local server" on your machine. It's just a program that listens and responds.
3. Frontend vs Backend
Frontend (Client-Side)
Everything the user sees and interacts with in the browser:
- The layout of the page (HTML)
- The colors, fonts, spacing (CSS)
- Buttons that do things, animations, pop-ups (JavaScript)
Technologies: HTML, CSS, JavaScript, React, Angular, Vue
Analogy: The dining area of a restaurant โ what customers see.
Backend (Server-Side)
Everything that happens behind the scenes on the server:
- Processing login credentials
- Fetching your order history from a database
- Sending emails
- Payment processing
Technologies: Node.js, Python (Django/Flask), Java, Go, PHP, Ruby
Analogy: The kitchen of a restaurant โ customers can't see it, but that's where the real work happens.
How They Connect
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ FRONTEND โ โโโโโบ โ BACKEND โ โโโโโบ โ DATABASE โ
โ (Browser) โ โโโโโ โ (Server) โ โโโโโ โ (Storage) โ
โ โ โ โ โ โ
โ HTML/CSS/JS โ โ Node/Python โ โ MySQL/Mongo โ
โ What you SEE โ โ Logic/Rules โ โ Where data โ
โ โ โ โ โ LIVES โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
4. Database
A database is organized storage for data. Think of it as a super-powered Excel spreadsheet.
When you sign up on Instagram:
- Your username, email, password โ stored in a database
- Your posts, likes, followers โ stored in a database
- When you log in โ the server reads from the database to check your password
Types of Databases
| Type | Examples | Data looks like... |
|---|---|---|
| Relational (SQL) | MySQL, PostgreSQL | Tables with rows & columns (like Excel) |
| Non-Relational (NoSQL) | MongoDB, Firebase | Flexible documents (like JSON files) |
Example โ A "users" table in SQL:
| id | username | password_hash | |
|---|---|---|---|
| 1 | yash123 | yash@email.com | a1b2c3... |
| 2 | priya456 | priya@email.com | d4e5f6... |
[!NOTE]
You don't need to learn databases right now. Just understand: data has to live somewhere, and that somewhere is the database.
5. HTTP โ The Language of the Web
HTTP = Hyper Text Transfer Protocol
It's the set of rules that browsers and servers use to talk to each other. Think of it as the language the waiter speaks.
Every time you visit a website, your browser speaks HTTP to the server.
6. Request
A request is what your browser sends to the server when you want something.
When you type https://www.google.com and hit Enter, your browser sends an HTTP request that looks roughly like this:
GET / HTTP/1.1
Host: www.google.com
User-Agent: Chrome/120
Accept: text/html
Breaking it down:
| Part | Meaning |
|---|---|
GET |
The method โ "I want to GET (read) something" |
/ |
The path โ "Give me the homepage" |
HTTP/1.1 |
The version of HTTP |
Host: www.google.com |
Which server to talk to |
User-Agent: Chrome/120 |
"I'm using Chrome" |
Accept: text/html |
"I want HTML back" |
7. Response
A response is what the server sends back to your browser.
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 14523
<!DOCTYPE html>
<html>
<head><title>Google</title></head>
<body>... the Google homepage ...</body>
</html>
Breaking it down:
| Part | Meaning |
|---|---|
200 OK |
Status code โ "Everything went well, here's your page" |
Content-Type: text/html |
"I'm sending you an HTML file" |
<html>... |
The actual content (the webpage) |
Common Status Codes
| Code | Meaning | When you see it |
|---|---|---|
| 200 | โ OK | Page loaded successfully |
| 301 | โช๏ธ Moved Permanently | Website redirected you |
| 404 | โ Not Found | Page doesn't exist |
| 500 | ๐ฅ Internal Server Error | Server crashed or has a bug |
| 403 | ๐ซ Forbidden | You don't have permission |
8. URL โ The Address of a Webpage
URL = Uniform Resource Locator โ it's the address that tells the browser exactly where to go.
https://www.example.com:443/products/shoes?color=red&size=10#reviews
โ โ โ โ โ โ
โ โ โ โ โ โโ Fragment (scroll to this section)
โ โ โ โ โโ Query params (filters/search)
โ โ โ โโ Path (which page)
โ โ โโ Port (which door on the server)
โ โโ Domain (which server)
โโ Protocol (how to communicate)
| Part | Example | Purpose |
|---|---|---|
| Protocol | https:// |
How to talk (securely) |
| Domain | www.example.com |
Which server to contact |
| Port | :443 |
Which "door" (usually hidden) |
| Path | /products/shoes |
Which specific page |
| Query | ?color=red&size=10 |
Extra info / filters |
| Fragment | #reviews |
Scroll to a section on the page |
9. Domain & IP Address
IP Address
Every computer on the internet has a unique IP address โ a number like 142.250.190.46. This is the real address of a server.
Domain Name
Since nobody wants to remember 142.250.190.46, we use domain names like google.com as human-friendly aliases.
DNS โ The Phonebook of the Internet
DNS (Domain Name System) translates domain names to IP addresses:
You type: google.com
โ
DNS lookup: "google.com โ 142.250.190.46"
โ
Browser connects to: 142.250.190.46
Analogy:
- IP address = A house's GPS coordinates (27.1751, 78.0421)
- Domain name = The house's street address ("Taj Mahal, Agra")
- DNS = Google Maps converting the address to coordinates
10. HTTP vs HTTPS
| HTTP | HTTPS | |
|---|---|---|
| Full form | HyperText Transfer Protocol | HyperText Transfer Protocol Secure |
| Encryption | โ None โ data sent as plain text | โ Encrypted with SSL/TLS |
| Security | Anyone on the network can read your data | Data is scrambled, unreadable to snoopers |
| Port | 80 | 443 |
| URL | http://... |
https://... |
| Use today | Almost never (browsers warn you) | Everywhere โ the standard |
Why it matters:
If you log into a website over HTTP, someone on the same Wi-Fi can literally read your password. With HTTPS, everything is encrypted.
[!CAUTION]
Never enter passwords or credit cards on a site that showshttp://(no 's'). Modern browsers show a "Not Secure" warning for these sites.
11. GET vs POST
These are the two most common HTTP methods โ they tell the server what kind of action you want.
GET โ "Give me something"
- Purpose: Read / retrieve data
- When it happens: Loading a page, searching, clicking a link
-
Data location: In the URL (visible) โ
?q=cats&page=2 - Safe to repeat? Yes โ nothing changes on the server
Examples:
- Visiting
google.comโ GET - Searching
google.com/search?q=catsโ GET - Loading your Twitter feed โ GET
POST โ "Here, take this data"
- Purpose: Send / submit data to the server
- When it happens: Submitting a form, logging in, uploading a file
- Data location: In the request body (hidden from URL)
- Safe to repeat? No โ might create duplicates (e.g., double purchase)
Examples:
- Submitting a signup form โ POST
- Posting a tweet โ POST
- Uploading a photo โ POST
Comparison Table
| GET | POST | |
|---|---|---|
| Purpose | Read data | Send/create data |
| Data in URL? | โ Yes (visible) | โ No (in body) |
| Cacheable? | โ Yes | โ No |
| Bookmarkable? | โ Yes | โ No |
| Can be repeated safely? | โ Yes | โ No |
| Example | Loading a page | Submitting a form |
[!TIP]
There are other methods too โ PUT (update), DELETE (remove), PATCH (partial update). You'll learn these when building APIs. For now, just know GET and POST.
12. Client-Server Architecture
This is the fundamental pattern of how the web works:
โโโโโโโโโโโ โโโโโโโโโโโ
โ CLIENT โ โโโโ Request โโโโโโโโโโโบ โ SERVER โ
โ(Browser)โ โโโโ Response โโโโโโโโโโโโ โ โ
โโโโโโโโโโโ โโโโโโโโโโโ
- The client (your browser) initiates communication by sending a request
- The server processes the request and sends back a response
- The server never contacts you first (in basic HTTP) โ it only responds
This is like a restaurant:
- You (client) call the waiter and place an order (request)
- The kitchen (server) prepares the food and the waiter brings it back (response)
- The kitchen never randomly walks up to your table with food you didn't order
13. The Full Journey โ Step by Step
This is the flow you need to understand. Let's trace what happens when you open Instagram:
YOU "I want to see Instagram"
โ
CHROME (Browser) Types instagram.com, hits Enter
โ
DNS Converts "instagram.com" โ 157.240.1.174
โ
INTERNET Your request travels through cables/wifi
โ
SERVER Instagram's server receives your request
โ
APPLICATION Instagram's code runs:
"This user is logged in, fetch their feed"
โ
DATABASE Queries: "Get latest 20 posts from
people this user follows"
โ
APPLICATION Formats the data into an HTML page / JSON
โ
SERVER Sends the response back
โ
INTERNET Response travels back through cables/wifi
โ
CHROME (Browser) Receives HTML/CSS/JS, renders the page
โ
YOU See your Instagram feed! ๐
Timing
This entire journey happens in ~200-500 milliseconds (less than half a second). That's how fast the internet is.
14. ๐งช Practice Exercise โ Using Browser DevTools
This is your first hands-on practice. No coding needed โ just observation.
Step 1: Open DevTools
- Open Chrome (or any browser)
- Press
F12orCtrl + Shift + I(Windows) /Cmd + Option + I(Mac) - Click the "Network" tab at the top
Step 2: Visit a Website
- Make sure the Network tab is open and recording (there should be a red circle โ at the top-left)
- Type
https://httpbin.org/getin the address bar and hit Enter - You'll see lines appear in the Network tab โ each line is one request
Step 3: Observe the First Request
Click on the first item in the list (usually named get).
You'll see panels showing:
โ What to look for:
| What | Where to find it | Example value |
|---|---|---|
| URL | In the "Headers" section โ Request URL | https://httpbin.org/get |
| Method | In the "Headers" section | GET |
| Status Code | In the "Headers" section | 200 OK |
| Response Headers | In the "Headers" section โ Response Headers | Content-Type: application/json |
| Response Body | Click the "Response" or "Preview" tab | JSON data |
Step 4: Try a POST Request
- Open a new tab
- Open DevTools (F12) โ Network tab
- Paste this into the address bar:
https://httpbin.org/post - You'll get an error (because browsers send GET by default) โ that's expected!
- This tells you: the server only accepts POST at this URL, but your browser sent GET
Step 5: Observe Multiple Requests
- Go to
https://www.google.comwith DevTools Network tab open - Notice there are dozens of requests โ not just one!
- Each image, CSS file, JavaScript file, and font is a separate request
[!IMPORTANT]
A single webpage often makes 30-100+ HTTP requests to load completely. The HTML is just the skeleton โ it then triggers requests for all the images, styles, and scripts.
Step 6: Status Codes in Action
Try visiting these URLs and check the status code in DevTools:
-
https://httpbin.org/status/200โ Should show 200 (OK) -
https://httpbin.org/status/404โ Should show 404 (Not Found) -
https://httpbin.org/status/500โ Should show 500 (Server Error)
15. Summary Cheat Sheet
| Concept | One-Line Summary |
|---|---|
| Website | Files on a server, displayed by your browser |
| Browser | The app that requests and displays web pages |
| Server | A computer that listens for and responds to requests |
| Frontend | What the user sees (HTML, CSS, JS) |
| Backend | Logic that runs on the server (Node, Python, etc.) |
| Database | Where data is stored (like a smart spreadsheet) |
| HTTP | The rules/language browsers and servers speak |
| Request | What the browser sends ("give me this page") |
| Response | What the server sends back (the page + status) |
| URL | The address of a webpage |
| Domain | Human-friendly name for a server (google.com) |
| IP Address | The real numeric address of a server |
| HTTPS | HTTP + encryption = secure communication |
| GET | "Read/fetch something" |
| POST | "Send/submit data" |
| Client-Server | Client asks โ Server responds. Always. |
โ Phase 0 Checklist
Before moving to Phase 1, make sure you can answer:
- [ ] What happens when I type a URL and press Enter?
- [ ] What's the difference between frontend and backend?
- [ ] What does a database do?
- [ ] What's a request? What's a response?
- [ ] What's the difference between GET and POST?
- [ ] What does a 404 error mean? What about 500?
- [ ] Why is HTTPS better than HTTP?
- [ ] I've opened DevTools and seen real requests/responses
[!TIP]
You do NOT need to understand everything perfectly. If you can explain the restaurant analogy to someone โ you're ready for Phase 1. Understanding deepens as you build things.

























