Subscribe once and get notified the moment something relevant to your career is published. No spam, no noise.
<!-- =========================================================
UdaanPath — Node.js Foundations
Chapter 1: Why Node.js? How Full-Stack JavaScript Works
Drop-in content block. All styles are scoped under .udp-ch1
so they cannot affect, or be affected by, the host page.
========================================================= -->
<style>
.udp-ch1, .udp-ch1 * {
box-sizing: border-box;
}
.udp-ch1 {
/* ---- scoped design tokens (light) ---- */
--udp-bg: #F6F1E6;
--udp-surface: #FFFFFF;
--udp-surface-2: #FBF8F1;
--udp-ink: #1C1A16;
--udp-ink-soft: #4A4640;
--udp-muted: #837C6E;
--udp-line: #E1D8C4;
--udp-mustard: #B5762A;
--udp-forest: #1F5C4A;
--udp-forest-soft: #CFE3DA;
--udp-focus: #1F5C4A;
display: block;
background: var(--udp-bg);
color: var(--udp-ink);
font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
line-height: 1.6;
font-size: 17px;
-webkit-font-smoothing: antialiased;
border-radius: 8px;
overflow: hidden;
}
/* ---- scoped design tokens (dark) ---- */
@media (prefers-color-scheme: dark) {
.udp-ch1:not([data-theme="light"]) {
--udp-bg: #14181A;
--udp-surface: #1B2023;
--udp-surface-2: #1F2528;
--udp-ink: #ECE7DC;
--udp-ink-soft: #C6C0B3;
--udp-muted: #938C7E;
--udp-line: #2E3538;
--udp-mustard: #E0A857;
--udp-forest: #5FB396;
--udp-forest-soft: #1E332C;
--udp-focus: #5FB396;
}
}
.udp-ch1[data-theme="dark"] {
--udp-bg: #14181A;
--udp-surface: #1B2023;
--udp-surface-2: #1F2528;
--udp-ink: #ECE7DC;
--udp-ink-soft: #C6C0B3;
--udp-muted: #938C7E;
--udp-line: #2E3538;
--udp-mustard: #E0A857;
--udp-forest: #5FB396;
--udp-forest-soft: #1E332C;
--udp-focus: #5FB396;
}
.udp-ch1 a { color: var(--udp-forest); }
.udp-ch1 h1, .udp-ch1 h2, .udp-ch1 h3 {
font-family: "Fraunces", Georgia, "Times New Roman", serif;
font-weight: 600;
line-height: 1.18;
letter-spacing: -0.01em;
margin: 0;
color: var(--udp-ink);
}
.udp-ch1 .udp-ch1-wrap { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.udp-ch1 .udp-ch1-wide { max-width: 920px; margin: 0 auto; padding: 0 24px; }
/* ---------- Top bar ---------- */
.udp-ch1 .udp-ch1-topbar { border-bottom: 1px solid var(--udp-line); padding: 18px 0; }
.udp-ch1 .udp-ch1-topbar-inner {
display: flex; align-items: baseline; justify-content: space-between;
gap: 16px; flex-wrap: wrap;
}
.udp-ch1 .udp-ch1-brand { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.05rem; color: var(--udp-ink); }
.udp-ch1 .udp-ch1-brand span { color: var(--udp-mustard); }
.udp-ch1 .udp-ch1-crumb { font-size: 0.88rem; color: var(--udp-muted); }
/* ---------- Hero ---------- */
.udp-ch1 .udp-ch1-hero { padding: 64px 0 40px; }
.udp-ch1 .udp-ch1-tag {
display: inline-flex; align-items: center; gap: 8px;
font-size: 0.82rem; color: var(--udp-forest); background: var(--udp-forest-soft);
border-radius: 4px; padding: 5px 11px; margin-bottom: 22px;
font-family: "IBM Plex Mono", monospace;
}
.udp-ch1 .udp-ch1-hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); max-width: 15ch; }
.udp-ch1 .udp-ch1-hero-sub { margin-top: 18px; font-size: 1.12rem; color: var(--udp-ink-soft); max-width: 46ch; }
.udp-ch1 .udp-ch1-hero-meta {
margin-top: 28px; display: flex; gap: 22px; flex-wrap: wrap;
font-size: 0.86rem; color: var(--udp-muted);
}
.udp-ch1 .udp-ch1-hero-meta div { display: flex; align-items: center; gap: 7px; }
.udp-ch1 .udp-ch1-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--udp-mustard); flex: none; }
/* ---------- Sections ---------- */
.udp-ch1 .udp-ch1-block { padding: 46px 0; border-top: 1px solid var(--udp-line); }
.udp-ch1 .udp-ch1-block.udp-ch1-no-rule { border-top: none; }
.udp-ch1 .udp-ch1-kicker {
font-family: "IBM Plex Mono", monospace; font-size: 0.8rem;
color: var(--udp-mustard); margin-bottom: 10px;
}
.udp-ch1 .udp-ch1-section-title { font-size: clamp(1.5rem, 3.4vw, 1.9rem); margin-bottom: 18px; max-width: 26ch; }
.udp-ch1 p { margin: 0 0 16px; color: var(--udp-ink-soft); max-width: 66ch; }
.udp-ch1 p:last-child { margin-bottom: 0; }
.udp-ch1 strong { color: var(--udp-ink); font-weight: 600; }
.udp-ch1 .udp-ch1-lede { font-size: 1.14rem; color: var(--udp-ink); }
/* ---------- Pull note ---------- */
.udp-ch1 .udp-ch1-note {
background: var(--udp-surface); border: 1px solid var(--udp-line);
border-left: 3px solid var(--udp-forest); border-radius: 3px;
padding: 18px 22px; margin: 26px 0;
}
.udp-ch1 .udp-ch1-note p { margin: 0; color: var(--udp-ink-soft); max-width: none; }
.udp-ch1 .udp-ch1-note p + p { margin-top: 10px; }
/* ---------- Restaurant diagram ---------- */
.udp-ch1 .udp-ch1-diagram-shell {
background: var(--udp-surface); border: 1px solid var(--udp-line);
border-radius: 6px; padding: 28px 20px 22px; margin: 30px 0;
}
.udp-ch1 .udp-ch1-diagram-caption { text-align: center; font-size: 0.86rem; color: var(--udp-muted); margin-top: 14px; }
.udp-ch1 svg text { font-family: "Inter", sans-serif; }
.udp-ch1 .udp-station-label { font-size: 15px; font-weight: 600; fill: var(--udp-ink); }
.udp-ch1 .udp-station-sub { font-size: 11.5px; fill: var(--udp-muted); }
.udp-ch1 .udp-flow-label { font-size: 11.5px; fill: var(--udp-ink-soft); font-family: "IBM Plex Mono", monospace; }
.udp-ch1 .udp-station-card { fill: var(--udp-surface-2); stroke: var(--udp-line); stroke-width: 1; }
.udp-ch1 .udp-icon-person { fill: var(--udp-mustard); }
.udp-ch1 .udp-icon-waiter { fill: var(--udp-ink-soft); }
.udp-ch1 .udp-icon-kitchen { fill: var(--udp-forest); }
.udp-ch1 .udp-arrow-req { stroke: var(--udp-mustard); }
.udp-ch1 .udp-arrow-res { stroke: var(--udp-forest); }
/* ---------- Mapping table ---------- */
.udp-ch1 .udp-ch1-map-table { width: 100%; border-collapse: collapse; margin: 8px 0 0; font-size: 0.95rem; }
.udp-ch1 .udp-ch1-map-table th, .udp-ch1 .udp-ch1-map-table td {
text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--udp-line); vertical-align: top;
}
.udp-ch1 .udp-ch1-map-table th {
font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; color: var(--udp-muted);
font-weight: 500; padding-top: 0;
}
.udp-ch1 .udp-ch1-map-table td:first-child { color: var(--udp-mustard); font-weight: 600; white-space: nowrap; }
.udp-ch1 .udp-ch1-map-table td:nth-child(2) { color: var(--udp-forest); font-weight: 600; white-space: nowrap; }
.udp-ch1 .udp-ch1-map-table td:last-child { color: var(--udp-ink-soft); }
.udp-ch1 .udp-ch1-table-scroll { overflow-x: auto; margin: 22px 0 0; }
/* ---------- Glossary ---------- */
.udp-ch1 .udp-ch1-glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; }
@media (max-width: 620px) {
.udp-ch1 .udp-ch1-glossary { grid-template-columns: 1fr; }
}
.udp-ch1 .udp-ch1-term-card { background: var(--udp-surface); border: 1px solid var(--udp-line); border-radius: 5px; padding: 16px 18px; position: relative; }
.udp-ch1 .udp-ch1-term-card::before {
content: ""; position: absolute; top: 14px; left: 0; width: 3px; height: 18px;
background: var(--udp-forest); border-radius: 0 2px 2px 0;
}
.udp-ch1 .udp-ch1-term-name { font-family: "IBM Plex Mono", monospace; font-size: 0.92rem; color: var(--udp-ink); margin-bottom: 6px; }
.udp-ch1 .udp-ch1-term-def { font-size: 0.9rem; color: var(--udp-ink-soft); margin: 0; }
/* ---------- Summary ticket ---------- */
.udp-ch1 .udp-ch1-ticket { background: var(--udp-surface); border: 1px solid var(--udp-line); border-radius: 6px; padding: 30px 30px 26px; }
.udp-ch1 .udp-ch1-ticket h3 { font-size: 1.15rem; margin-bottom: 14px; }
.udp-ch1 .udp-ch1-ticket ul { margin: 0; padding: 0; list-style: none; }
.udp-ch1 .udp-ch1-ticket li {
display: flex; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--udp-line);
color: var(--udp-ink-soft); font-size: 0.96rem;
}
.udp-ch1 .udp-ch1-ticket li:first-child { border-top: none; }
.udp-ch1 .udp-ch1-ticket li::before { content: "✓"; color: var(--udp-forest); flex: none; font-weight: 600; }
/* ---------- Quiz ---------- */
.udp-ch1 .udp-ch1-quiz-item { background: var(--udp-surface); border: 1px solid var(--udp-line); border-radius: 5px; padding: 4px 20px; margin-bottom: 12px; }
.udp-ch1 .udp-ch1-quiz-item summary {
cursor: pointer; padding: 16px 0; font-weight: 500; color: var(--udp-ink);
list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.udp-ch1 .udp-ch1-quiz-item summary::-webkit-details-marker { display: none; }
.udp-ch1 .udp-ch1-quiz-item summary::after { content: "+"; color: var(--udp-muted); font-family: "IBM Plex Mono", monospace; flex: none; }
.udp-ch1 .udp-ch1-quiz-item[open] summary::after { content: "–"; }
.udp-ch1 .udp-ch1-quiz-answer {
padding: 0 0 18px; color: var(--udp-ink-soft); font-size: 0.95rem;
border-top: 1px solid var(--udp-line); padding-top: 14px;
}
.udp-ch1 .udp-ch1-quiz-answer strong { color: var(--udp-forest); }
.udp-ch1 .udp-ch1-quiz-item summary:focus-visible,
.udp-ch1 a:focus-visible,
.udp-ch1 button:focus-visible {
outline: 2px solid var(--udp-focus); outline-offset: 3px;
}
/* ---------- Footer nav ---------- */
.udp-ch1 .udp-ch1-footer { border-top: 1px solid var(--udp-line); padding: 40px 0 60px; }
.udp-ch1 .udp-ch1-next-up {
display: flex; justify-content: space-between; align-items: center; gap: 16px;
background: var(--udp-surface); border: 1px solid var(--udp-line); border-radius: 6px;
padding: 22px 26px; flex-wrap: wrap;
}
.udp-ch1 .udp-ch1-next-label { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; color: var(--udp-muted); margin-bottom: 6px; }
.udp-ch1 .udp-ch1-next-title { font-family: "Fraunces", serif; font-size: 1.15rem; color: var(--udp-ink); }
.udp-ch1 .udp-ch1-next-btn {
background: var(--udp-forest); color: #FFF8ED; border: none; border-radius: 4px;
padding: 11px 20px; font-family: "Inter", sans-serif; font-size: 0.92rem; font-weight: 600; white-space: nowrap;
}
@media (max-width: 560px) {
.udp-ch1 .udp-ch1-hero { padding: 44px 0 30px; }
.udp-ch1 .udp-ch1-block { padding: 34px 0; }
.udp-ch1 { font-size: 16px; }
}
</style>
<div class="udp-ch1">
<div class="udp-ch1-topbar">
<div class="udp-ch1-wrap udp-ch1-topbar-inner">
<div class="udp-ch1-brand">Udaan<span>Path</span></div>
<div class="udp-ch1-crumb">Node.js Foundations — Chapter 1 of 6</div>
</div>
</div>
<header class="udp-ch1-hero">
<div class="udp-ch1-wrap">
<div class="udp-ch1-tag">Chapter 1 · Concepts</div>
<h1>Why Node.js? How full-stack JavaScript actually works</h1>
<p class="udp-ch1-hero-sub">Before you write a single line of Node.js code, you need one mental model in place: what a client is, what a server is, and how the two talk to each other. This chapter builds that model — and gives you a way to picture it that you will keep using for the rest of the course.</p>
<div class="udp-ch1-hero-meta">
<div><span class="udp-ch1-dot"></span> Beginner</div>
<div><span class="udp-ch1-dot"></span> Reading time: ~18 min</div>
<div><span class="udp-ch1-dot"></span> No code required</div>
</div>
</div>
</header>
<div class="udp-ch1-block udp-ch1-no-rule">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">The problem</p>
<h2 class="udp-ch1-section-title">JavaScript used to live in one place: the browser</h2>
<p class="udp-ch1-lede">For most of its life, JavaScript had exactly one job — making web pages interactive inside a browser.</p>
<p>You have already used JavaScript this way. It validated a form, toggled a menu, updated something on the page without a reload. In every one of those cases, the code ran on the visitor's machine, inside Chrome or Firefox or Safari, and nowhere else.</p>
<p>That was a real limitation. Somewhere, separately, a different program had to store data, check passwords, and decide what information to send back. That program could not be written in JavaScript, because JavaScript had no way to run outside a browser. Teams used other languages for that half of the job — and a "full-stack" developer had to learn two of almost everything.</p>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">The shift</p>
<h2 class="udp-ch1-section-title">One engine gets pulled out of the browser</h2>
<p>Every browser has a JavaScript engine buried inside it — the part that actually reads your code and executes it. Chrome's engine is called V8. In 2009, a developer named Ryan Dahl took V8, pulled it out of the browser entirely, and wrapped it so it could run directly on a computer, with no browser involved at all.</p>
<p>That wrapped engine is <strong>Node.js</strong>. It is not a new language and not a framework. It is a <strong>runtime</strong> — a program whose only job is to execute JavaScript outside a browser, on a server, on your laptop, anywhere.</p>
<div class="udp-ch1-note">
<p>A runtime is simply whatever is running your code and giving it access to the outside world. Inside a browser, the runtime gives JavaScript access to a page's buttons and forms. Inside Node.js, the runtime gives JavaScript access to files, networks, and the operating system instead — things a browser deliberately keeps JavaScript away from.</p>
</div>
<p>This one change is why "full-stack JavaScript" is possible at all. The same language can now handle what happens on a person's screen and what happens behind the scenes, in two different runtimes, without switching languages in between.</p>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">The core idea</p>
<h2 class="udp-ch1-section-title">Almost everything you build is a conversation between two programs</h2>
<p>Whatever you eventually build — a shopping site, a chat app, a booking system — it will run as two separate programs having a conversation:</p>
<div class="udp-ch1-note">
<p><strong>The client</strong> is the program the person actually uses. It asks for things. A browser tab, a mobile app — these are clients.</p>
<p><strong>The server</strong> is the program that owns the data and the logic. It waits, listens, and answers. It does not initiate anything on its own.</p>
</div>
<p>The client sends a <strong>request</strong> — "give me this," or "save this for me." The server does some work and sends back a <strong>response</strong>. Every action you have ever taken on a website, underneath, is one round trip of this request–response cycle. Node.js is what lets you write the server side of that conversation in JavaScript.</p>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">Seeing it in practice</p>
<h2 class="udp-ch1-section-title">The same exchange, at a restaurant table</h2>
<p>The client–server idea is simple to state and easy to forget, because you never see it happen — it's wiring behind a screen. So picture something you have seen happen many times instead: ordering food at a restaurant.</p>
<p>You don't walk into the kitchen and cook for yourself. You sit down, decide what you want, and tell a waiter. The waiter carries that order to the kitchen. The kitchen — out of your sight, on its own timeline — prepares the dish. The waiter carries it back. You eat. At no point did you and the kitchen speak directly; the waiter carried a request in, and carried a response back.</p>
</div>
</div>
<div class="udp-ch1-block udp-ch1-no-rule">
<div class="udp-ch1-wide">
<div class="udp-ch1-diagram-shell">
<svg viewBox="0 0 860 300" width="100%" role="img" aria-labelledby="udp-ch1-diagram-title udp-ch1-diagram-desc">
<title id="udp-ch1-diagram-title">Restaurant order flow mapped to a client-server request-response cycle</title>
<desc id="udp-ch1-diagram-desc">A customer sends an order through a waiter to the kitchen, and the kitchen sends food back through the waiter to the customer, mirroring how a client sends a request through a network to a server and receives a response back.</desc>
<g transform="translate(30,60)">
<rect class="udp-station-card" x="0" y="0" width="190" height="170" rx="8"/>
<circle class="udp-icon-person" cx="95" cy="55" r="22"/>
<path class="udp-icon-person" d="M60 130 q35 -34 70 0 v18 h-70 z"/>
<text class="udp-station-label" x="95" y="122" text-anchor="middle">Customer</text>
<text class="udp-station-sub" x="95" y="141" text-anchor="middle">the client</text>
<text class="udp-station-sub" x="95" y="157" text-anchor="middle">decides what it wants</text>
</g>
<g transform="translate(335,60)">
<rect class="udp-station-card" x="0" y="0" width="190" height="170" rx="8"/>
<circle class="udp-icon-waiter" cx="95" cy="50" r="18"/>
<path class="udp-icon-waiter" d="M67 122 q28 -28 56 0 v14 h-56 z"/>
<rect class="udp-icon-waiter" x="118" y="80" width="34" height="24" rx="3"/>
<text class="udp-station-label" x="95" y="122" text-anchor="middle">Waiter</text>
<text class="udp-station-sub" x="95" y="141" text-anchor="middle">the network</text>
<text class="udp-station-sub" x="95" y="157" text-anchor="middle">carries the order & the dish</text>
</g>
<g transform="translate(640,60)">
<rect class="udp-station-card" x="0" y="0" width="190" height="170" rx="8"/>
<path class="udp-icon-kitchen" d="M65 90 h60 a4 4 0 0 1 4 4 v10 a34 34 0 0 1 -68 0 v-10 a4 4 0 0 1 4 -4 z"/>
<rect class="udp-icon-kitchen" x="60" y="84" width="70" height="8" rx="3"/>
<path d="M78 78 q0 -14 -6 -20 M95 78 q0 -18 6 -24 M112 78 q0 -14 6 -20" stroke="var(--udp-forest)" stroke-width="4" fill="none" stroke-linecap="round" opacity="0.55"/>
<text class="udp-station-label" x="95" y="122" text-anchor="middle">Kitchen</text>
<text class="udp-station-sub" x="95" y="141" text-anchor="middle">the server</text>
<text class="udp-station-sub" x="95" y="157" text-anchor="middle">prepares the response</text>
</g>
<path class="udp-arrow-req" d="M225 95 C 270 75, 290 75, 330 95" fill="none" stroke-width="2" marker-end="url(#udp-ch1-arrowReq)"/>
<path class="udp-arrow-req" d="M530 95 C 575 75, 595 75, 635 95" fill="none" stroke-width="2" marker-end="url(#udp-ch1-arrowReq)"/>
<text class="udp-flow-label" x="277" y="65" text-anchor="middle">order</text>
<text class="udp-flow-label" x="582" y="65" text-anchor="middle">request</text>
<path class="udp-arrow-res" d="M635 205 C 595 225, 575 225, 530 205" fill="none" stroke-width="2" marker-end="url(#udp-ch1-arrowRes)"/>
<path class="udp-arrow-res" d="M330 205 C 290 225, 270 225, 225 205" fill="none" stroke-width="2" marker-end="url(#udp-ch1-arrowRes)"/>
<text class="udp-flow-label" x="582" y="243" text-anchor="middle">dish</text>
<text class="udp-flow-label" x="277" y="243" text-anchor="middle">response</text>
<defs>
<marker id="udp-ch1-arrowReq" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto">
<path d="M0,0 L8,4 L0,8 z" fill="var(--udp-mustard)"/>
</marker>
<marker id="udp-ch1-arrowRes" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto">
<path d="M0,0 L8,4 L0,8 z" fill="var(--udp-forest)"/>
</marker>
</defs>
</svg>
<p class="udp-ch1-diagram-caption">The order travels right as a request. The dish travels left as a response. Node.js is the language you use to write what happens at the kitchen.</p>
</div>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">Mapping it precisely</p>
<h2 class="udp-ch1-section-title">Same flow, technical names</h2>
<p>Hold onto the restaurant scene, but now attach the real terms to each part of it. You will meet every row of this table again in later chapters.</p>
<div class="udp-ch1-table-scroll">
<table class="udp-ch1-map-table">
<thead>
<tr><th>At the restaurant</th><th>In your app</th><th>What it means</th></tr>
</thead>
<tbody>
<tr><td>Customer</td><td>Client</td><td>The program the user directly interacts with — a browser tab or mobile app.</td></tr>
<tr><td>Deciding what to order</td><td>Request</td><td>The client stating what it wants: a page of data, a saved change, a file.</td></tr>
<tr><td>Waiter carrying the order</td><td>Network</td><td>The path the request travels to reach the server, and the response travels back on.</td></tr>
<tr><td>Kitchen</td><td>Server</td><td>The program that receives the request, does the work, and decides what to send back.</td></tr>
<tr><td>Cooking</td><td>Processing</td><td>Reading data, running logic, checking rules — the actual work behind the response.</td></tr>
<tr><td>The finished dish</td><td>Response</td><td>What the server sends back — data, a confirmation, or an error.</td></tr>
</tbody>
</table>
</div>
<p style="margin-top:22px;">One detail worth sitting with: the kitchen never contacts you first. It only ever responds to an order that came in. A server behaves the same way — it sits waiting, and only acts when a request arrives. This is why servers are sometimes described as "listening."</p>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">Why it matters for you</p>
<h2 class="udp-ch1-section-title">One language, two runtimes, one developer</h2>
<p>Here is the part that actually changes how you'll work. Before Node.js existed, a developer who wanted to build both the customer-facing side and the kitchen side of an application had to learn two separate languages — one that runs in a browser, and a completely different one for the server.</p>
<p>Node.js removes that split. You already know JavaScript from the browser. This course teaches you how that same language behaves once it's running as the <strong>kitchen</strong> instead of the <strong>dining room</strong> — reading files, managing data flow, and answering requests, rather than reacting to clicks.</p>
<p>This is also exactly why this course stands on its own before you specialize. Whichever combination of tools you choose to build the client-facing side later, the server side of that application — the kitchen — will run on Node.js. Get comfortable with how Node.js thinks first, and every specialization after this becomes easier to pick up, because the hardest conceptual shift — thinking like a server, not a page — is the one you're making right now.</p>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">Glossary</p>
<h2 class="udp-ch1-section-title">Terms to keep straight</h2>
<div class="udp-ch1-glossary">
<div class="udp-ch1-term-card">
<div class="udp-ch1-term-name">client</div>
<p class="udp-ch1-term-def">The program that initiates a conversation by sending a request. Usually something a person is directly using.</p>
</div>
<div class="udp-ch1-term-card">
<div class="udp-ch1-term-name">server</div>
<p class="udp-ch1-term-def">The program that waits for requests, does the necessary work, and sends back a response. Never initiates on its own.</p>
</div>
<div class="udp-ch1-term-card">
<div class="udp-ch1-term-name">request</div>
<p class="udp-ch1-term-def">A message from a client stating what it wants — read some data, save something, delete something.</p>
</div>
<div class="udp-ch1-term-card">
<div class="udp-ch1-term-name">response</div>
<p class="udp-ch1-term-def">What the server sends back after processing a request — the actual data, a confirmation, or an error.</p>
</div>
<div class="udp-ch1-term-card">
<div class="udp-ch1-term-name">runtime</div>
<p class="udp-ch1-term-def">The program that executes your code and decides what it's allowed to access. A browser is one runtime; Node.js is another.</p>
</div>
<div class="udp-ch1-term-card">
<div class="udp-ch1-term-name">full-stack</div>
<p class="udp-ch1-term-def">Comfortable working on both the client side and the server side of an application, not just one.</p>
</div>
</div>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">Recap</p>
<div class="udp-ch1-ticket">
<h3>What to carry forward</h3>
<ul>
<li>Node.js is a runtime — it takes the JavaScript engine out of the browser so JavaScript can run anywhere, including on a server.</li>
<li>Almost every application is two programs talking: a client that requests, and a server that responds.</li>
<li>A server never speaks first. It listens, and answers only when a request arrives.</li>
<li>The restaurant flow — customer, waiter, kitchen — maps directly onto client, network, and server, and you'll reuse this picture through the rest of the course.</li>
<li>This course teaches you how JavaScript behaves as the kitchen. What you build the dining room with, later, is a separate decision.</li>
</ul>
</div>
</div>
</div>
<div class="udp-ch1-block">
<div class="udp-ch1-wrap">
<p class="udp-ch1-kicker">Quick check</p>
<h2 class="udp-ch1-section-title">Before you move on</h2>
<p style="margin-bottom:22px;">No marks, no pressure — just a way to check the model has actually landed. Try answering in your head before opening each one.</p>
<details class="udp-ch1-quiz-item">
<summary>In the restaurant analogy, what does the waiter represent?</summary>
<div class="udp-ch1-quiz-answer"><strong>The network.</strong> The waiter doesn't decide what to cook and doesn't cook anything — they only carry the order in and the dish back. That carrying role is what a network connection does between a client and a server.</div>
</details>
<details class="udp-ch1-quiz-item">
<summary>Why is Node.js described as a "runtime" rather than a language?</summary>
<div class="udp-ch1-quiz-answer"><strong>Because it doesn't change JavaScript itself.</strong> Node.js is a program that executes JavaScript code outside a browser and gives it access to different things — files, networks, the operating system — than a browser would. The language you're writing stays JavaScript either way.</div>
</details>
<details class="udp-ch1-quiz-item">
<summary>True or false: a server can send a request to a client whenever it wants.</summary>
<div class="udp-ch1-quiz-answer"><strong>False.</strong> A server waits and responds; it doesn't initiate contact on its own. Just like a kitchen doesn't send out a dish until an order comes in, a server only sends a response after it receives a request.</div>
</details>
</div>
</div>
<div class="udp-ch1-footer">
<div class="udp-ch1-wrap">
<div class="udp-ch1-next-up">
<div>
<div class="udp-ch1-next-label">Next chapter</div>
<div class="udp-ch1-next-title">Node.js Setup & the Runtime Model</div>
</div>
<button class="udp-ch1-next-btn" type="button">Continue</button>
</div>
</div>
</div>
</div>
1. What is Node.js, most accurately?
2. In the restaurant analogy used in this chapter, what does the "waiter" represent?
3. Which statement best describes how a server behaves?
4. What is the "client" in a typical web application?
5. Why is "full-stack JavaScript" possible today, but wasn't possible before Node.js existed?