‹ Build a Dashboard Lesson 12 of 16
Contents Lesson 12 of 16

4 min read · professional

Review the whole surface

Course 2's four lenses, run on a composed product. Composition creates failures that no individual tool had, so this is a genuinely different pass rather than a repeat.

Leaks — now with someone else's data

The proxy was reviewed twice already. What is new is the store.

Every read and write is scoped by the authenticated user. The vulnerability is one missing WHERE user_id = ?, and it will not show up in any manual test, because you are always testing as yourself.

So test it as the other person: create two users, save a layout as one, request it as the other, and assert 404 rather than 403. A 403 confirms the document exists, which is itself a leak.

Also check what the layout export contains. It is a file people will share, and if config ever held anything sensitive it is now in someone's downloads folder.

Cost — the union, priced

One number: dataNeeds unioned across visible panels, priced by the table from course 1.

Then the questions that only apply to a cockpit: does switching layouts refetch symbols already cached? Does selecting a symbol trigger a refresh of panels that did not change? Does a hidden or collapsed panel still contribute to dataNeeds? That last one is the classic — a panel scrolled out of view quietly costing calls every refresh.

Measure the union against the meter. If they disagree, something is fetching outside the data layer, and that is the architecture breaking.

Lies — one clock, one label

All of course 2's lenses still apply to every numeric column. What composition adds is time.

The header must show the oldest timestamp across panels, not the newest and not the fetch time. Each panel shows its own age. And a stale panel says so rather than looking identical to a fresh one — a cockpit where you cannot tell which parts are current is a cockpit that will eventually mislead you at the worst moment.

Failure — one panel, not the page

From the previous unit: five states per panel, four error kinds, an error boundary each. Verify by breaking things deliberately rather than by reading the code.

New here: what happens when the store is unreachable? The cockpit should still render from whatever it has and say the layout could not be saved. A dashboard that shows nothing because a save failed has confused two concerns.

The licence line, again, because a dashboard invites it

Same terms: personal use. A cockpit is the most shareable-looking thing in this track — it is one screen, it looks like a product, and the temptation to put it behind a public URL for friends is real.

A tool you run for yourself is personal use. A hosted dashboard serving other people from your key is a different conversation, and the licence page in this lesson's sources is where it starts.

Try it now

Run all four lenses and write the findings in REVIEW.md before reading them back. Then hand the file and your data layer to your assistant and ask which of the four lenses your checklist is weakest on. Its answer is usually right, and it is the cheapest way to improve a checklist.