Explore
WEBSTER / SOFTWARE ENGINEERING← Senior DeveloperEducational reference · continually evolving

Chapter 02 / 15 · Webster International

Getting Started: Your First Working System

Install a practical toolchain, build a tiny client–server application, debug it and ship it with reproducible checks.

← Complete index

The big idea

The fastest way to understand software is to trace one complete user action from the browser through an API into durable data and back.

01 / FIELD NOTE

Choose an outcome and a vertical slice

Mental model: a vertical slice is a thin, observable path through UI → HTTP contract → validation → durable write → response → read-back, not a set of disconnected components. Define an acceptance test before choosing a framework: who acts, what record changes, and what must still be true after a refresh. Start with one note or booking, then add complexity only after this path works. Debug from the visible symptom backwards: inspect form values, Network status/body, server logs with request ID, then stored row. A 201 response without a committed record is not a completed slice.

Why it matters

An end-to-end thread exposes mismatched contracts, persistence gaps and accessibility failures early; success is a verifiable user outcome, not a count of files or services.

In practice

Scenario A — a dog-walking operator creates a client note and reloads to see the same title. Scenario B — a musician submits a venue inquiry and receives a stable inquiry ID; duplicate submissions must not silently create extra leads. In both, use a labeled form, visible pending/success/error feedback and server-side validation.

JavaScript · runnable Node.js
// Runnable in Node.js: one domain rule for the first slice
function titleOf(input) {
  if (typeof input !== 'string') throw Error('Title must be text');
  const title = input.trim();
  if (title.length < 1 || title.length > 80) throw Error('Title must be 1–80 characters');
  return title;
}
console.assert(titleOf('  First note  ') === 'First note');
for (const bad of ['', ' '.repeat(3), 'x'.repeat(81), null]) {
  try { titleOf(bad); throw Error('Accepted invalid title'); }
  catch (error) { if (error.message === 'Accepted invalid title') throw error; }
}
console.log('Validation passed');
Hands-on exercise · reveal the verification check
Try it

Write a one-sentence acceptance criterion for creating a note, then test blank, 81-character, and valid titles; reload the app after a successful save.

Check your result

Blank and overlong titles produce field-specific errors and no write; a valid title returns an ID and survives refresh; keyboard-only submission works.

02 / FIELD NOTE

Set up your workstation

Mental model: the toolchain is part of the build contract. Runtime version + package manifest + lockfile + install command + environment configuration should produce a repeatable result on a clean machine. Use a supported Node LTS and record its major version; a lockfile captures resolved dependencies but does not freeze the OS, native modules or external services. Prefer npm ci in CI, because it refuses manifest/lockfile mismatches. Debug by comparing node --version, npm --version, npm config, lockfile and actual install errors before deleting caches.

Why it matters

Deterministic setup cuts onboarding time and prevents a different transitive dependency from breaking CI or a deployment.

In practice

Scenario A — a new developer clones a CRM and runs npm ci, npm test and npm start using disposable test credentials. Scenario B — CI fails while a laptop passes; the developer reproduces with a clean install and discovers the committed lockfile was stale.

terminal · conditional runnable
# Terminal · runnable after a package-lock.json exists
node --version
npm --version
npm ci
npm test
# If npm ci rejects the lockfile, update it intentionally with npm install
# and review package-lock.json before committing.
Hands-on exercise · reveal the verification check
Try it

Clone into a fresh directory, follow only the README, run npm ci and the test command, then deliberately make package.json disagree with the lockfile.

Check your result

Clean setup succeeds without personal secrets; npm ci rejects the mismatch rather than silently rewriting the lockfile; README explains how to repair it.

03 / FIELD NOTE

Understand files and project structure

Mental model: separate code by execution boundary and responsibility, not by fashionable folder count. public/ is delivered to browsers; server/ holds trusted request handling and business rules; tests/ proves behavior; migrations/ changes stored schemas; configuration is injected at runtime. A browser bundle is public even if its filename says secret. Debug missing assets with the browser Network panel and the deployed build artifact, not merely the source tree. Confirm Docker ignore/build rules include required files.

Why it matters

Predictable ownership makes changes reviewable and prevents private configuration from leaking into downloadable client assets.

In practice

Scenario A — a booking form lives in public/, while tenant authorization and booking persistence live in server/. Scenario B — a guide chapter JS file works locally but is excluded by .dockerignore; a no-JavaScript HTML fallback keeps lessons readable while the asset 404 is fixed.

JavaScript · runnable Node.js
// Runnable in Node.js: classify assets by public exposure
const paths = ['public/app.js','server/keys.js','tests/api.test.js','migrations/001.sql'];
const exposed = paths.filter(p => p.startsWith('public/'));
console.assert(exposed.length === 1 && exposed[0] === 'public/app.js');
console.log('Browser-visible:', exposed.join(', '));
// Illustrative rule: never put real secrets in browser-visible files.
Hands-on exercise · reveal the verification check
Try it

Draw the browser/server/storage boundary for a form and trace one asset from source to deployed URL; block its JS request in DevTools.

Check your result

You can identify where authorization runs; no secret appears in public assets; essential page content remains available without the script.

04 / FIELD NOTE

Create a real request-response loop

Mental model: fetch resolves when an HTTP response arrives, including 400/404/500; it rejects for network-level failures. The browser owns display and user feedback; the server owns validation, authorization and the durable write. POST /api/notes should validate a title, persist once, return 201 with a stable identifier and optionally a Location header. On the client check response.ok and parse the documented error shape. Debug request method, URL, Content-Type, payload, status and response body in DevTools before changing code.

Why it matters

Understanding transport versus business errors prevents false success messages and isolates failures to the correct boundary.

In practice

Scenario A — a note form sends valid JSON, receives 201 and displays the new note after a GET. Scenario B — a booking form receives 409 for a full slot and retains entered values with a clear corrective message rather than claiming the network failed.

JavaScript · browser illustrative
// Browser JavaScript · illustrative (requires a running /api/notes endpoint)
async function createNote(title) {
  const response = await fetch('/api/notes', {
    method: 'POST', headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({title})
  });
  if (!response.ok) throw Error(`Save failed: HTTP ${response.status}`);
  if (response.status !== 201) throw Error('Expected 201 Created');
  return response.json();
}
// Call on submit; announce success only after createNote resolves.
Hands-on exercise · reveal the verification check
Try it

Use DevTools to send valid, blank and duplicate submissions. Simulate a 409 and a disconnected network; compare what fetch does in each case.

Check your result

201 returns an ID; 400/409 resolve with response.ok false; a network failure rejects; the UI reports distinct, accessible outcomes and never duplicates a saved record.

05 / FIELD NOTE

Learn the test pyramid without dogma

Mental model: unit tests constrain a pure rule, integration tests cross a real boundary, and end-to-end tests exercise the browser and deployed-like application. A passing mock only proves the assumptions encoded in the mock. Prefer a small number of critical-path browser checks plus many fast rule tests; use a disposable database for integration. When a test flakes, record seed, timing, environment and trace instead of adding arbitrary sleeps. Test failures must explain behavior, not just implementation detail.

Why it matters

Layered evidence catches validation mistakes, lost persistence, inaccessible interactions and environment mismatches at different costs.

In practice

Scenario A — unit-test note-title trimming and 80-character bounds; integration-test that a saved note survives a fresh database connection. Scenario B — browser-test a keyboard-only booking journey, including a visible error and focus restoration.

JavaScript · runnable Node.js test file
// Save as title.test.cjs; run: node --test title.test.cjs
const test = require('node:test');
const assert = require('node:assert/strict');
const normalize = value => {
  const s = String(value).trim();
  if (!s || s.length > 80) throw Error('Invalid title');
  return s;
};
test('normalizes a valid title', () => assert.equal(normalize(' Hi '), 'Hi'));
test('rejects blank input', () => assert.throws(() => normalize('   '), /Invalid/));
test('rejects overlong input', () => assert.throws(() => normalize('x'.repeat(81)), /Invalid/));
Hands-on exercise · reveal the verification check
Try it

Run the three node:test cases, intentionally break normalization, then add an integration test with a real temporary database and a browser keyboard test.

Check your result

The introduced bug fails the relevant unit test; a fresh connection reads the committed record; the browser test verifies focus and feedback without a mouse.

06 / FIELD NOTE

Practise Git and review

Mental model: a commit is a snapshot with a parent, a branch names a movable commit, and a pull request compares two histories. Keep one behavior change per reviewable patch; inspect git diff --check and staged diffs before committing. The PR should name the problem, approach, tests, risks and rollback. Debug conflicts by reading both versions and their common ancestor, not choosing 'ours' blindly. Never rewrite a shared branch without coordination.

Why it matters

Traceable changes support review, rollback, security investigation and repeatable releases.

In practice

Scenario A — a form-validation change includes code, test and a screenshot in one PR. Scenario B — a teammate changes the same API contract; resolve the merge conflict by preserving both new validation and the revised response shape, then rerun tests.

terminal · illustrative workflow
# Terminal · runnable inside a Git repository
 git status --short
 git switch -c feature/notes-validation
 git diff --check
 git add public server tests
 git diff --cached --check
 git diff --cached
 git commit -m 'Validate note creation and test errors'
 git log --oneline -3
# Do not run git add on paths that do not exist in your project.
Hands-on exercise · reveal the verification check
Try it

Create a focused branch, change one validation rule and its test, review the staged diff, then write a PR description with rollback and verification.

Check your result

The diff contains only relevant files, no secrets or whitespace errors, tests identify the changed rule and the PR names its base branch.

07 / FIELD NOTE

Deploy and verify rather than assume

Mental model: source commit → build artifact → deployment revision → running process → HTTP response are distinct facts. A green build proves compilation, not that the correct container is running or data survives a restart. Use an immutable revision identifier exposed by a safe health/version endpoint, compare it to the intended SHA, check static assets and perform a harmless read/write on disposable staging data. Debug 404 assets by inspecting build ignore rules and actual image contents; debug missing records by inspecting volumes and connection configuration.

Why it matters

A deployment is complete only after the target environment serves the intended code and passes representative smoke checks.

In practice

Scenario A — a guide page returns 200 but its JS modules return 404 because build exclusions omitted them; test both HTML and asset endpoints. Scenario B — a CRM release returns 200 but writes vanish on restart; verify the persistent volume mount and backup before promotion.

JavaScript · runnable Node.js
// Runnable in Node.js: compare expected and served revisions
function verifyRevision(expected, served) {
  if (!/^[a-f0-9]{7,40}$/i.test(expected)) throw Error('Invalid expected SHA');
  if (served !== expected) throw Error(`Wrong revision: ${served}`);
  return 'Verified revision ' + served;
}
console.assert(verifyRevision('abc1234', 'abc1234') === 'Verified revision abc1234');
try { verifyRevision('abc1234', 'deadbee'); throw Error('Mismatch accepted'); }
catch (e) { if (e.message === 'Mismatch accepted') throw e; }
console.log('Revision gate passed');
// Real deployment: obtain served SHA from trusted /version metadata.
Hands-on exercise · reveal the verification check
Try it

Create a release checklist that compares commit SHA to served revision, verifies 15 chapter assets, tests a read/write/restart cycle and records a rollback target.

Check your result

A deliberately wrong SHA fails the gate; all required assets return 200; staging data survives restart; production remains unchanged until approval.

08 / FIELD NOTE

A seven-day practice plan

Mental model: learn through a repeating loop of hypothesis → smallest working change → observed result → documented evidence. Day 1 environment/Git; day 2 semantic HTML/form; day 3 HTTP/JSON; day 4 durable data; day 5 unit/integration/browser tests; day 6 error handling/logging and basic authorization; day 7 staged verification and README. Each day ends with a demonstrable artifact and a failing-case test, not a time quota. Debug by keeping a short log of what you expected, what actually happened and which boundary differed.

Why it matters

Small verified iterations compound into a transferable mental model and expose misunderstandings before they become architecture.

In practice

Scenario A — build notes, then add due dates and verify sorting across refresh. Scenario B — build a venue inquiry form, then add ownership checks and demonstrate that a second user cannot read the first user's inquiry.

JavaScript · runnable Node.js
// Runnable in Node.js: make progress measurable, not calendar-only
const gates = ['form accessible','POST validates','record persists',
  'unit and integration pass','errors visible','staging SHA matches'];
const evidence = Object.fromEntries(gates.map(g => [g, false]));
evidence['form accessible'] = true;
evidence['POST validates'] = true;
const remaining = Object.entries(evidence).filter(([,passed]) => !passed).map(([g]) => g);
console.assert(remaining.length === 4);
console.log('Remaining gates:', remaining.join('; '));
Hands-on exercise · reveal the verification check
Try it

Keep a seven-entry lab journal with one observed result, one failure case and one source link per day; demonstrate a complete note workflow on day seven.

Check your result

A second person can clone, test, run, use the app with keyboard, restart and read the same note using only the README; missing gates are listed explicitly.

09 / APPLIED RESEARCH

Read a repository before making changes

Locate entrypoint, package scripts, route handler, data ownership, environment configuration, test suites and deployment watcher. Write a short map before running a generator or accepting AI edits.

Why it matters

Understanding the real runtime prevents building code that cannot be reached or deployed.

In practice

For Webster staging, read the actual Railway start command and watched paths before assuming a Git push rebuilt the site.

Hands-on exercise · reveal the verification check
Try it

Trace an existing button to the function and storage it touches.

Check your result

You can name the exact files involved and one useful test.

10 / APPLIED RESEARCH

Local toolchain and reproducible commands

Pin supported runtime versions, use a lockfile, isolate environment variables and document scripts for start, test and migration. Make onboarding a sequence of repeatable commands, not institutional memory.

Why it matters

Dependencies drift and hidden setup steps cause failures unrelated to business logic.

In practice

A new engineer should clone, install, run migrations against disposable data, start app and execute tests without personal secrets.

Hands-on exercise · reveal the verification check
Try it

Write a README quickstart for a fresh machine.

Check your result

Another developer can run it using only safe test variables.

11 / APPLIED RESEARCH

HTTP journey lab in the browser

Create a small form and watch request headers, JSON body, response status and persisted record in DevTools. Change one field and observe validation and recovery when offline.

Why it matters

A concrete request-response cycle unites frontend, backend, networking and storage concepts.

In practice

Build POST /notes; verify a saved note survives refresh and a failed POST shows an error without pretending to save.

Hands-on exercise · reveal the verification check
Try it

Save a record, disconnect network and repeat the action.

Check your result

You can distinguish client failure, server rejection and database loss.

12 / APPLIED RESEARCH

Foundational terminal literacy

Learn working directory, relative versus absolute paths, environment variables, process exit codes, piping, redirection and file permissions. Use dry-run commands before deleting or overwriting.

Why it matters

Many deployment and data-loss incidents begin with a command run in the wrong directory or environment.

In practice

Run pwd, git status, find a project entrypoint, inspect a log without printing secrets and explain a command's exit status.

Hands-on exercise · reveal the verification check
Try it

Locate and run one unit test with a nonzero failing case.

Check your result

Explain the difference between shell error and application error.

13 / APPLIED RESEARCH

Practice a real bug and a rollback

Introduce a failing validation case, write a regression test, change only the affected branch, then inspect diff and revert in a disposable branch. Record the test before/after state.

Why it matters

You learn debugging, version control and scope control through an actual failure rather than a tutorial slide.

In practice

Reject an empty note with 422; test it and then revert the fix temporarily to prove the test detects it.

Hands-on exercise · reveal the verification check
Try it

Produce before/after test evidence and a one-commit diff.

Check your result

The bug reappears if the change is removed, then disappears if restored.

14 / APPLIED RESEARCH

First deployment and evidence checklist

Ship to staging, check the exact running revision, HTTP health, asset status, logs and a full browser task with reload. Separate source control, build, deployed and verified milestones.

Why it matters

Runtime packaging and cache behaviour can invalidate perfectly fine source code.

In practice

Check the guide's lesson JS modules return 200, that the user sees 142 lessons and that each anchor lands correctly.

Hands-on exercise · reveal the verification check
Try it

Write a five-item release checklist for a small feature.

Check your result

Every item has an observed result or an honest NOT RUN.

Build the first vertical slice

15 / FIELD NOTE

Start with the web request lifecycle, not a framework tutorial

Trace DNS resolution, TLS, HTTP request, server routing, database query and HTML or JSON response. Inspect the browser Network panel for headers, status, payload and timing. Then identify which layer owns data validation, authorization and caching.

Why it matters

This mental model makes later debugging and architecture lessons much easier to understand.

In practice

Create a tiny GET /events endpoint, call it with curl and DevTools, then locate the data query in server logs.

Hands-on exercise · reveal the verification check
Try it

Sketch a sequence diagram for browser to server to database.

Check your result

Explain one failure and its visible symptom at each hop.

16 / FIELD NOTE

Environment variables, secrets and reproducible setup

Separate configuration from source. Document required variables with safe placeholders, use an example environment file, and store real credentials in a secret manager. Pin dependency manifests and runtime versions, run a clean install and verify that an unfamiliar developer can start the project.

Why it matters

Reliable onboarding and deployment require consistent environments, not invisible machine-specific settings.

In practice

Set DATABASE_URL and API_BASE_URL through local configuration, verify that tests use an isolated database and ensure logs redact secrets.

Hands-on exercise · reveal the verification check
Try it

Set up a clean project checkout using written steps only.

Check your result

Rebuild and run tests without reading local personal configuration.

17 / FIELD NOTE

Command line literacy: filesystem, pipes, exit codes and processes

Learn pwd, ls, cd, cat, grep or ripgrep, head, tail, ps, kill, exit codes and shell quoting. Use standard input/output and structured files deliberately. Understand foreground processes, environment inheritance and the risks of running a copied command with elevated permissions.

Why it matters

Many deployment bugs are ordinary process or path mistakes rather than framework defects.

In practice

Find the server process, inspect the last 50 error lines, filter for one request ID and verify which port is listening.

Hands-on exercise · reveal the verification check
Try it

Practice locating a process and following a bounded log.

Check your result

Record the port and process ID without revealing a secret.

18 / FIELD NOTE

Debug with a vertical slice and a repeatable red-green loop

Start with one failing assertion reproducing the defect, run it, make the smallest correction, and verify regression coverage. Choose a representative user path that traverses UI, API and persistence rather than creating an empty dashboard with dozens of mock interactions.

Why it matters

An end-to-end slice proves integration boundaries and prevents phantom progress.

In practice

For a booking form, create a client, submit a valid booking, confirm it is stored, then test invalid dates and duplicate submissions.

Hands-on exercise · reveal the verification check
Try it

Write a failing test for a duplicate booking attempt.

Check your result

After the fix, both the failure and happy path pass.

19 / FIELD NOTE

Practical Git workflow: small commits, reviews and conflict resolution

Use feature branches, meaningful commits, diffs, review descriptions and reproducible tests. Learn how HEAD, branches, staging and remotes relate, and how to inspect a conflict before resolving it. Protect the deployment branch and match built artifacts to a specific commit.

Why it matters

Traceability is essential when several agents or developers touch the same website.

In practice

Create one commit for a data schema, one for a view and one for a test, then verify a deployment matches the expected SHA.

Hands-on exercise · reveal the verification check
Try it

Create a feature branch, edit a file and inspect the diff before committing.

Check your result

A second checkout reproduces the intended state.