🌐 DevAscent Academy • Full-Stack Web Engineering Series

Unit 1: How the Web Works & Developer Toolchains

The foundational architecture of the modern internet. Deconstruct client-server interaction models, HTTP vs. HTTPS cryptographic handshakes, domain resolution through the recursive DNS hierarchy, URLs & the full request-response lifecycle, browser Critical Rendering Paths (DOM, CSSOM, Render Tree, Layout, Paint), modern editor configurations in VS Code, browser DevTools diagnostics, and collaborative version control using Git and GitHub.

Curriculum Level 1st Year BCA / B.Tech / Diploma
Unit Code WEB-101 (Internet Foundations)
Content Balance 50% Theory • 30% Code • 20% Flowcharts
Target Standard University Exam & Professional Web Tooling
📐 Formula Verified: 50% Comprehensive Theory 30% Verified Code & CLI 20% Visual Flowcharts
1

Client-Server Architecture & Physical Network Topology

📌 What is the Client-Server Model?

The World Wide Web (WWW) operates on a distributed computing architecture known as the Client-Server Model. It partitions workloads between service requestors (Clients) and service providers (Servers):

  • The Client (Front-End User Agent): Any device or software initiating an action to consume information. Examples include web browsers (Google Chrome, Mozilla Firefox, Apple Safari), mobile apps, or command-line utilities (like curl or Postman). The client is responsible for rendering user interfaces and executing client-side scripts.
  • The Server (Back-End Provider): A high-availability computer daemon listening continuously on specific network ports (e.g., port 80 for HTTP, 443 for HTTPS). It processes incoming requests, evaluates business logic, interfaces with databases, and transmits back structured responses (HTML, CSS, JavaScript, or JSON payloads).

Physical Transmission: When you click a link, your computer's Network Interface Card (NIC) serializes the data into packets transmitted across your local Wi-Fi/Ethernet router $\rightarrow$ Internet Service Provider (ISP) $\rightarrow$ Tier-1 Internet Backbones (undersea transoceanic fiber-optic cables) $\rightarrow$ Cloud Edge Datacenter hosting the target server.

📐 FLOWCHART 1: THE PHYSICAL CLIENT-SERVER PACKET ROUTE Network Topology
1. Client Device
User enters URL in Chrome/Firefox. Generates HTTP Request.
➔ Router/ISP ➔
2. Internet Backbone
Fiber-optic packet routing through DNS & Gateways.
➔ TCP/IP ➔
3. Web Server
Nginx / Apache / Node.js serves HTML, CSS, & Data.
2

Network Protocols: HTTP vs. HTTPS & The TLS Cryptographic Handshake

📌 HyperText Transfer Protocol (HTTP) vs. HTTPS

• HTTP (Port 80): An application-layer, stateless protocol designed in 1989 by Tim Berners-Lee to transmit hypermedia documents. The vulnerability: HTTP transmits data over the wire in plain text. Anyone on the same public Wi-Fi network running a packet analyzer (like Wireshark) can read passwords, session cookies, and credit card numbers (a Man-in-the-Middle or MitM attack).
• HTTPS (Port 443): HTTP secured by TLS (Transport Layer Security) (historically SSL). Every byte transmitted is mathematically encrypted using a hybrid cipher system combining asymmetric public-key cryptography (RSA/ECC) during the initial handshake and symmetric AES cryptography for high-speed session streaming.

Feature HTTP (Standard) HTTPS (Secure)
Default Port Port 80 Port 443
Security & Encryption None (Plain-text clear packets) TLS 1.3 End-to-End Cryptographic Encryption
Digital Certificate Not Required Requires SSL/TLS Certificate signed by a CA (Certificate Authority)
SEO & Trust Flagged as "Not Secure" by browsers; penalized by Google Displays secure padlock icon; optimal search engine indexing
📐 FLOWCHART 2: THE 4-STEP TLS/HTTPS CRYPTOGRAPHIC HANDSHAKE Cryptographic Security
1. "ClientHello"
Client sends supported TLS version & cipher suites.
➔
2. "ServerHello" + Certificate
Server replies with chosen cipher + CA Digital Certificate & Public Key.
3. Session Key Generation
Client verifies CA certificate, generates pre-master secret encrypted with server key.
➔
4. Secure Symmetric Channel
Both compute shared AES secret key. All subsequent traffic is encrypted!
3

Anatomy of a URL & The HTTP Request-Response Lifecycle

📌 Anatomy of a Uniform Resource Locator (URL)

A URL specifies the unique network address and protocol required to retrieve a web asset:

https://www.devascentacademy.me:443/courses/web-dev?track=frontend&id=101#lesson-summary

  • Scheme / Protocol (https://): Dictates the communication rule (HTTP, HTTPS, FTP, WebSocket).
  • Subdomain (www. / api.): Specific host partition within the domain.
  • Domain Name (devascentacademy.me): Human-readable server alias mapped to an IP address.
  • Port (:443): Virtual communication gateway on the server (often omitted as 80/443 are defaults).
  • Path (/courses/web-dev): The hierarchical resource location on the web server.
  • Query Parameters (?track=frontend&id=101): Key-value pairs used for search filtering and state passing.
  • Fragment / Hash (#lesson-summary): Client-side bookmark pointing directly to a specific HTML element ID.
📐 FLOWCHART 3: THE HTTP REQUEST-RESPONSE LIFECYCLE Protocol Mechanics
Client HTTP Request
Method: GET /index.html
Headers: Host, User-Agent, Accept
➔ Network ➔
Server Processing
Routes request, reads database, compiles HTML template.
➔ Network ➔
Server HTTP Response
Status: 200 OK
Headers: Content-Type: text/html
Body: Raw HTML bytes
Status Code Class Category Name Classic Industry Examples
1xx Informational 101 Switching Protocols (Upgrading connection to WebSockets)
2xx Success 200 OK (Successful fetch), 201 Created (Resource saved), 204 No Content
3xx Redirection 301 Moved Permanently, 302 Found (Temporary), 304 Not Modified (Cache valid)
4xx Client Error 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found
5xx Server Error 500 Internal Server Error (Unhandled backend crash), 502 Bad Gateway, 503 Unavailable
4

Domains, Recursive DNS Resolution, and Web Hosting

📌 What is DNS (Domain Name System)?

Computers do not communicate via names like google.com; they communicate using numerical IP (Internet Protocol) Addresses (e.g., IPv4: 142.250.190.46 or IPv6: 2607:f8b0:4005:808::200e).
DNS acts as the global, decentralized "phonebook" of the internet, resolving human-readable domain names into machine-routable IP addresses in milliseconds.

📐 FLOWCHART 4: THE 4-TIER RECURSIVE DNS RESOLUTION PIPELINE Domain Resolution Hierarchy
1. Browser Cache / OS
Checks local cache. If missing, asks Recursive Resolver.
➔
2. Root Server (.)
Directs query to the appropriate Top-Level Domain (TLD) server.
3. TLD Server (.com / .me)
Directs resolver to domain's specific Authoritative Nameserver.
➔
4. Authoritative Server
Returns the definitive IP Address (A Record) back to the browser!
DNS Record Type Function Typical Example
A Record Maps a domain name directly to a 32-bit IPv4 address. devascentacademy.me ➔ 76.76.21.21
AAAA Record Maps a domain name to a 128-bit IPv6 address. devascentacademy.me ➔ 2606:4700::6810
CNAME Record Canonical Name: Aliases one domain name to another domain. blog.domain.com ➔ domain.hashnode.network
MX Record Mail Exchange: Directs email traffic to the company mail servers. domain.com ➔ aspmx.l.google.com
5

Browser Architecture & The Critical Rendering Path (CRP)

📌 How Does a Browser Turn Raw Bytes into Visible Pixels?

When the browser receives raw HTML bytes across the network stream, its Rendering Engine (e.g., Blink in Chrome, Gecko in Firefox, WebKit in Safari) executes a multi-stage compilation pipeline known as the Critical Rendering Path (CRP):

  1. Bytes $\rightarrow$ Characters $\rightarrow$ Tokens $\rightarrow$ Nodes $\rightarrow$ DOM: The browser parses HTML tags into a hierarchical tree called the DOM (Document Object Model).
  2. CSS Parsing $\rightarrow$ CSSOM: The browser parses stylesheet rules into the CSSOM (CSS Object Model) tree.
  3. Render Tree Construction: The browser merges the DOM and CSSOM, keeping only elements visible on screen (ignoring <head> and elements with display: none).
  4. Layout (Reflow): The engine calculates the precise geometric coordinates and dimensions of every visible box on the screen.
  5. Painting (Rasterizing): The GPU/CPU fills in pixels with actual colors, shadows, borders, text, and images.
  6. Compositing: Separate GPU layers are stacked together and drawn onto the monitor.
📐 FLOWCHART 5: THE CRITICAL RENDERING PATH (CRP) PIPELINE Browser Engine Internals
HTML Bytes ➔ DOM Tree
Constructs document node hierarchy.
+
CSS Bytes ➔ CSSOM Tree
Computes style rules & inheritance.
➔ Render Tree Construction
Filters visible visual elements.
➔
Layout (Reflow)
Calculates X, Y, width, height pixels.
➔
Paint & Composite
Rasterizes to GPU screen pixels!
6

Setting Up the Development Environment: VS Code & DevTools

📌 Professional Web Engineering Toolchain

Modern web engineering requires two indispensable developer interfaces: a production-grade code editor (Visual Studio Code) and browser runtime diagnostic instruments (Chrome/Firefox Developer Tools).

⚙️ Recommended VS Code settings.json for Web Developers
{
  "editor.fontSize": 14,
  "editor.fontFamily": "'Fira Code', 'Inter', monospace",
  "editor.fontLigatures": true,
  "editor.tabSize": 2,
  "editor.wordWrap": "on",
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "liveServer.settings.donotShowInfoMsg": true,
  "emmet.includeLanguages": {
    "javascript": "javascriptreact"
  }
}
DevTools Panel Shortcut (Win / Mac) Primary Engineering Use Case
Elements Panel Ctrl+Shift+C / Cmd+Opt+C Live DOM element inspection, CSS box-model padding/margin debugging, live style tweaking.
Console Panel Ctrl+Shift+J / Cmd+Opt+J JavaScript execution runtime, reading error stack traces, logging objects via console.table().
Network Panel F12 ➔ Network tab Inspecting HTTP status codes (200, 404), latency waterfalls, request/response headers, bandwidth throttling (Fast/Slow 3G).
Application Panel F12 ➔ Application tab Inspecting client-side storage: localStorage, sessionStorage, and HTTP Cookies.
7

Version Control with Git & Cloud Collaboration with GitHub

📌 Git vs. GitHub: Local VCS vs. Cloud Collaboration

• Git: A free, open-source Distributed Version Control System (DVCS) installed locally on your machine. It tracks granular line-by-line snapshots of your project history, enabling branching, merging, and time-travel rollbacks.
• GitHub: A cloud hosting platform for Git repositories. It provides collaboration mechanisms like Pull Requests (PRs), Issue Trackers, Code Reviews, and CI/CD Automation (GitHub Actions).

📐 FLOWCHART 6: THE 4 STAGES OF THE GIT REPOSITORY LIFECYCLE Version Control Architecture
1. Working Directory
Unstaged local changes in your editor.
➔ git add ➔
2. Staging Area (Index)
Files prepped & organized for commit.
➔ git commit ➔
3. Local Repo (.git)
Permanent snapshot in local history.
➔ git push ➔
4. Remote (GitHub)
Synchronized to cloud repository!
💻 Essential Git Terminal Commands for New Web Projects
# Step 1: Initialize Git in your current web project directory
git init

# Step 2: Configure your global developer identity (one-time setup)
git config --global user.name "Shivan Kumar"
git config --global user.email "shivan@devascent.me"

# Step 3: Check current repository status (shows modified/untracked files)
git status

# Step 4: Stage files to the Index
git add index.html style.css app.js  # Or: git add . (stages everything)

# Step 5: Commit staged snapshot with an atomic, descriptive message
git commit -m "feat: initialize landing page layout and modern navbar"

# Step 6: Rename local default branch to main
git branch -M main

# Step 7: Link local repository to your remote GitHub repository
git remote add origin https://github.com/shivan632/devascent-web.git

# Step 8: Push your commits to GitHub
git push -u origin main
Terminal Output
Initialized empty Git repository in C:/Users/shiva/Desktop/DevAscent-Web/.git/ [main (root-commit) 4a82b9e] feat: initialize landing page layout and modern navbar 3 files changed, 142 insertions(+) create mode 100644 app.js create mode 100644 index.html create mode 100644 style.css Enumerating objects: 5, done. To https://github.com/shivan632/devascent-web.git * [new branch] main -> main Branch 'main' set up to track remote branch 'main' from 'origin'.
8

Unit 1 Practical Capstone: Browser Network Diagnostics Utility

This hands-on web application allows students to live-test the concepts learned in this unit: executing real asynchronous HTTP requests via the browser's fetch() API, inspecting response headers, simulating latency, and exploring the rendered DOM elements dynamically.

🌐 index.html — Complete Live Network Diagnostic Lab
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>DevAscent HTTP Inspector</title>
  <style>
    body { font-family: sans-serif; background: #0f172a; color: #f8fafc; padding: 24px; }
    .card { background: #1e293b; padding: 20px; border-radius: 10px; max-width: 600px; margin: 0 auto; }
    button { background: #f97316; color: white; border: none; padding: 10px 16px; border-radius: 6px; cursor: pointer; font-weight: bold; }
    button:hover { background: #ea580c; }
    pre { background: #090d16; padding: 12px; border-radius: 6px; color: #34d399; font-size: 12px; overflow-x: auto; }
  </style>
</head>
<body>

  <div class="card">
    <h2>🌐 Live HTTP Request Inspector</h2>
    <p>Click below to execute an HTTP GET request and inspect the response headers.</p>
    <button onclick="fetchNetworkData()">Send HTTP Request</button>
    <h4>Network Output:</h4>
    <pre id="network-display">Awaiting request trigger...</pre>
  </div>

  <script>
    async function fetchNetworkData() {
      const display = document.getElementById('network-display');
      display.textContent = 'Initiating TCP Handshake & HTTP GET...';
      
      try {
        const startTime = performance.now();
        const response = await fetch('https://jsonplaceholder.typicode.com/todos/1');
        const duration = (performance.now() - startTime).toFixed(2);
        const payload = await response.json();

        display.textContent = 
          `HTTP Status: ` + response.status + ` ` + response.statusText + `\n` +
          `Round-Trip Time: ` + duration + ` ms\n` +
          `Content-Type: ` + response.headers.get('content-type') + `\n\n` +
          `Payload Body:\n` + JSON.stringify(payload, null, 2);
      } catch (err) {
        display.textContent = 'Network Error: ' + err.message;
      }
    }
  </script>
</body>
</html>
Rendered In-Browser Output Upon Click
HTTP Status: 200 OK Round-Trip Time: 64.20 ms Content-Type: application/json; charset=utf-8 Payload Body: { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false }
9

University Exam & Viva Preparation Guide (Frequently Asked Questions)

Q1. Explain the primary distinction between HTTP and HTTPS.
HTTP transmits data as clear, plain-text packets over Port 80, making it vulnerable to sniffing and tampering. HTTPS uses Port 443 and encrypts all communications using the Transport Layer Security (TLS) protocol, guaranteeing data confidentiality, integrity, and server authentication.
Q2. What is the role of DNS in web communication?
DNS (Domain Name System) translates human-friendly alphanumeric domain names (e.g., google.com) into numerical IP addresses (e.g., 142.250.190.46) that network routers require to direct packets across the internet.
Q3. Detail the stages of the Critical Rendering Path (CRP).
The CRP stages are: (1) HTML parsing to form the DOM tree, (2) CSS parsing to form the CSSOM tree, (3) combining DOM and CSSOM to construct the Render Tree, (4) Layout/Reflow to calculate exact element dimensions and coordinates, and (5) Painting/Compositing pixels onto the screen.
Q4. What is the difference between Git and GitHub?
Git is a local, command-line distributed version control software that records changes to code files. GitHub is an online cloud hosting platform that hosts Git repositories for remote team collaboration, backups, and code reviews.
Q5. What does an HTTP 404 status code indicate vs. an HTTP 500 status code?
404 Not Found is a Client Error indicating the server could not locate the requested resource URI. 500 Internal Server Error is a Server Error indicating that the web server crashed or encountered an unhandled exception while trying to fulfill the request.
Q6. What is the Git Staging Area and why is it useful?
The Staging Area (or Index) is an intermediate buffer between your working directory and the commit history. It allows developers to selectively group and review specific file changes before permanently committing them into repository history.