Advanced Web Applications Development

After the day

Running this yourself

How to re-run the four labs with your own students: the timings, where people get stuck, what to cut for a two-hour session, and how to stretch it into a semester.

In this chapter

  • The timings, and what decides the day
  • Where people get stuck in each lab
  • Cutting it to two hours, or stretching it to a semester
  • What to tell your students this project is not

You came as a participant. This page assumes you are about to be the one at the front.

Everything here is reusable: the repository is public, the pages are public, and nothing depends on me being in the room. What follows is what I would tell anyone taking it over.

The one thing that decides the day

Not the labs. The setup.

Fifteen people installing PostgreSQL on shared wifi is how a four-hour session becomes a two-hour one. Send the setup page at least two days ahead, and ask for something back — a screenshot of npm test passing. The screenshot is not bureaucracy. It is the only way to know, before the room fills, who is ready.

Expect a third of them not to send it. Those are the people to find twenty minutes early on the day.

Have the offline fallback ready: one machine with the repository and node_modules already in place, zipped, on a USB stick. Someone’s laptop will refuse to install, and you do not want to discover that at 09:05.

The shape of four hours

Start Minutes Block
0:00 15 Everyone clones and runs it. Nobody moves on until all pairs see the app
0:15 20 Briefing: the request’s journey, the data model
0:35 35 Lab A — fare search
1:10 15 Briefing: validation, status codes, break the unsafe search live
1:25 30 Lab B — add a fare
1:55 10 Break
2:05 20 Briefing: hashing, sessions, who may change a fare
2:25 40 Lab C — login
3:05 15 Briefing: testing, and a demo of tests running on push
3:20 25 Lab D — tests
3:45 15 Debrief

Work in pairs, a lecturer with a student where you can, swapping who types at each lab. A pair that falls behind checks out the next checkpoint branch and rejoins — say that out loud at the start, so nobody sits stuck and quiet.

Where people get stuck

These are the real ones. I hit most of them building it.

Lab A. Forgetting async or await, then reading a promise as if it were a route. Leaving the old res.status(501) above the new code so it answers first. Getting D35 instead of D45 — the orderBy is missing or ascending, which is the whole lesson arriving as a bug.

Lab B. No Content-Type: application/json header, so req.body is undefined. Posting a fare dated in the future and wondering why search does not show it — that is Lab A’s rule working correctly, and it is worth stopping to say so.

Lab C. Two that look identical and are not: the server restarted, so the in-memory sessions are gone; or curl was run without -b jar.txt. Also expect someone to guard the whole router instead of the POST, which locks parents out of reading fares. Ask the room what that would cost.

Lab D. The step that matters is breaking the search on purpose and watching the tests stay green. Protect the time for it. If people rush past it, the lab becomes “write some tests” and loses its point.

Everywhere. npm run reset is the recovery command. Teach it in the first fifteen minutes so you can say “reset and catch up” without explaining it later.

Two hours instead of four

Run A, B and D, and drop Lab C.

The sequence still tells a whole story: read the data, write to it, prove the reading works. Lab C is the biggest single block and the most self-contained, which makes it the cheapest to cut and the easiest to teach on its own another day. Lab D cannot be cut — it needs Lab A, and it carries the most transferable idea in the module.

Minutes Block
10 Clone and run
15 Briefing: the journey, the data model
35 Lab A
10 Briefing: validation and status codes
25 Lab B
20 Lab D (skip the stretch tasks)
5 Debrief

A semester instead of a day

Each lab is a week, and the material after it is the rest of the course.

  1. Weeks 1–2. The data model. Why a fare has a date. Let them design a second model — clinic appointments, school fees — and defend it.
  2. Weeks 3–4. Lab A, then extend it: search by name, filter by vehicle type, paginate.
  3. Weeks 5–6. Lab B. Validation becomes a topic of its own: what belongs in the database, what belongs in the API, what belongs in the form.
  4. Weeks 7–9. Lab C, then roles, then tokens for a mobile client.
  5. Weeks 10–12. Lab D, then CI, then deployment.
  6. The rest. The items on Where to take it next, one per pair, presented to the class.

The repository supports this: each checkpoint branch is a known-good starting point, so a student who falls behind in week 5 is not finished for the semester.

Assessing it

The hardest part of taking this into a graded module, and the part that changed most recently: a finished submission is no longer evidence that anyone understood it. Four ways to mark this that survive that, and the skill they all test, are on Assessing it — the next page.

Be honest about what is missing

Tell your students what this project is not. The session store is a Map in one process. There is no rate limiting, so the slow password hash is doing all the work. The fares are invented, and the app says so on every screen — which is itself worth discussing, because a system that presents guesses as official figures is a system that will be believed.

The three questions

Every lab ends with the same three: where would your students get stuck, what would you cut, what would you add.

Do not let those be rhetorical. Write the answers down on the day, while the lab is fresh, and keep them with your own copy of the material. The second time you run this, those notes will be worth more than anything on this page.

Saved in this browser only.