Fundamentals of Web Applications
Introduction to Internet application development; emphasis on computer science fundamentals of technologies underlying web applications. Topics include: scripting and functional languages, language-based virtual machines, database query languages, remote procedure calls over the Internet, and performance and security concerns in modern distributed applications.
Study notes
Independent, AI-drafted study guide · Public sources linked below · Added November 5, 2026
Independent full-stack guide aligned with the Fall 2026 outline. Public Fall 2024 lectures are linked as additional reading; they use a somewhat different stack. Instructor materials and assessment examples are not reproduced.
The browser-to-server request path
A web application combines a browser interface, an HTTP service, and usually persistent data. A user action may update local state, send a request, trigger server validation, change a database, and return a representation. Trace that entire path when debugging. HTML supplies document structure, CSS controls presentation, and JavaScript supplies behavior. A rendered button does not establish that its API works. Inspect the actual request method, URL, headers, body, status, and response content before assuming a visual error originates in the browser.
References: COMP 2406 A/B — Fall 2026 course outline · MDN — Overview of HTTP
HTTP, resources, and API contracts
HTTP requests identify a target and an intended operation. Responses contain a status, headers, and optionally a body. Define API contracts around resources and state transitions. A GET should be safe in the protocol sense: it should not be used to request a purchase or deletion. Idempotence means repeating an operation has the same intended effect as performing it once, not that responses must be byte-identical. Choose status codes that describe the outcome, and document request validation and error shapes. JSON is a data format, not automatic validation or authorization.
References: COMP 2406 A/B — Fall 2026 course outline · MDN — Overview of HTTP
JavaScript execution and asynchronous work
JavaScript functions can return before asynchronous work completes. A promise represents an eventual result; await pauses the surrounding async function while other eligible work can proceed. It does not make CPU-heavy synchronous code stop blocking the event loop. Handle rejected promises deliberately and avoid sending a response before required work has completed. Independent I/O operations may run concurrently, but operations with data dependencies must preserve order. Middleware forms a request-processing chain, so a handler must either respond, pass control appropriately, or terminate with a defined error path.
References: COMP 2406 A/B — Fall 2026 course outline · Node.js — The event loop
DOM updates, forms, and validation boundaries
The DOM represents the document that scripts inspect and update. Prefer explicit state and event handlers to scattered mutations that make interface behavior difficult to trace. Client-side validation gives timely feedback, but server-side validation is still required because clients can be altered or bypassed. Treat text from users and remote systems as data when inserting it into the page. Labels, focus behavior, keyboard operation, and error associations matter for usable forms. A successful HTTP response should update the interface from the confirmed result rather than assuming the submitted object was stored unchanged.
References: COMP 2406 A/B — Fall 2026 course outline · MDN — Overview of HTTP
Persistence, sessions, and access control
A data model expresses entities, relationships, and constraints. Validate fields at the API boundary and enforce important invariants in the persistent store when supported. Authentication identifies an actor; authorization checks whether that actor may perform the specific operation on the specific resource. A session identifier links browser requests to server-side state or a validated claim. Protect the session lifecycle, including creation, expiry, and logout, rather than merely showing a login form. Never rely on hiding an interface control to prevent unauthorized database access.
References: COMP 2406 A/B — Fall 2026 course outline · MDN — Overview of HTTP
Worked flow: creating and editing a reading list
Suppose a signed-in user creates a reading list. The server validates the title, obtains the user identity from the trusted session, stores ownership using that identity, and returns the new record’s identifier. On a later update, it checks both the list identifier and ownership before writing. It does not trust an ownerId supplied in the request body. If persistence fails, return an error and preserve the user’s draft. If a request is retried after a timeout, consider a request identifier or another duplicate-prevention design when repeated creation would be harmful.
References: COMP 2406 A/B — Fall 2026 course outline · MDN — Overview of HTTP
Practice & worked answers
Original exercises for this guide.
1. Why must server validation repeat checks already performed in the browser?
Show worked answer
The browser is outside the server’s trust boundary. A caller can bypass the form and construct a request directly, so only server-side checks can protect the server’s invariant.
2. Does await make a long numerical loop nonblocking?
Show worked answer
No. The synchronous loop still occupies the event-loop thread. Await yields around asynchronous work; CPU-heavy tasks require an appropriate separate execution strategy or smaller scheduled work units.
3. A logged-in user edits another user’s list by changing its ID. What must change?
Show worked answer
The update path must enforce resource-specific authorization using the trusted identity and stored ownership. Authentication alone does not establish permission for every list.
Public notes & references
Course sources establish the scope above. Reference materials support the explanations; linked lecture notes and books remain with their authors.
2026
Topics
- Below is a summary of topics the course will cover
- Markup Languages (e.g., HTML, CSS)
- JavaScript
- Synchronous vs Asynchronous function calls
- Client-side & Server-side coding in JavaScript and data exchange with JSON, AJAX
- Node.js and the NPM system
- Server-side templating (using EJS, PUG, etc.)
- JavaScript execution environments: Browsers, Node.js, and Express.js framework
- RESTful Web API's
- JSON databases (using MongoDB)
- Authentication and Authorization using Sessions and Cookies
Readings
- the most recent edition of "Eloquent JavaScript" by Marijn Haverbeke. It is also free!
Prerequisites & course information
Precludes additional credit for SYSC 4504 . Prerequisite(s): ( COMP 1006 or COMP 1406 ) with a minimum grade of C- . Lectures three hours a week, tutorial one and a half hours a week.
Sources
- Course catalogue ↗2026–2027
- Fundamentals of Web Applications ↗2026