Ship it beside the watchlist
By the end of this lesson you will have both pages live from one repository with a link each way, an "Add to watchlist" button that puts a screened name on your watchlist, a feature-pass review of the whole screener, and a network tab showing no browser request to eodhd.com on either page.
One repository, one deployment, two tools. This lesson makes them one product rather than two pages that happen to share a domain.
Two routes, one application
/ your watchlist
/screen your screener
Nothing new to deploy: same repo, same environment variable, same host. That is the return on the rebuild, arriving.
Add navigation between them, and make it the smallest possible thing — two links. A tool you use alone does not need a navigation system; it needs to not be a dead end.
The join that makes them one product
Here is the feature worth building, and it is small: from a screen result, add to watchlist.
A screener answers "which ones deserve attention". A watchlist answers "how are they doing". The natural motion is from one to the other, and one button expresses it. Without that button they remain two tools; with it they become a workflow you actually use.
Notice what it requires. Build Your First Tool kept your list in a file, src/lib/watchlist.ts, and a button in a browser cannot edit a file in your repository. So the names you add need a store of their own that the server, which renders the watchlist, reads beside that file — and both pages have to agree on one shape for a symbol: the screener's codes come without the exchange suffix your watchlist uses, so AAPL has to become AAPL.US on the way in. That is a real design decision arriving late, which is normal.
Re-run the review before you ship
This is the feature pass from lesson 1 of unit 3, and it is due now.
Leaks: does the screen page build its own request, drop api_token, clamp limit, and return only what the table needs? Cost: how many calls does each page cost, measured not guessed? Lies: run the five questions across every numeric column. Failure: what does each page show with no key, no results, a bad filter?
Then the check that actually verifies the whole course: open the deployed site, open the network tab, and confirm no request goes to eodhd.com from the browser. Both pages. The screener is new server code, and this is the only way to know it behaves like the old one.
The starter's CI from Build Your First Tool keeps running on every pull request — the key scan, the tests, the leak check. It is checking the screener too, at no extra effort, which is what a good safety net does. Ask your agent to extend Build Your First Tool's network-tab script to the second page, so this check is not one more thing to remember.
Same licence, sharper edge
A screener produces lists of instruments with fundamentals attached, which feels more like "content" than a watchlist did. It is the same data under the same terms: EODHD's plans are, in their own words, "intended for personal use only as commercial use requires a more thorough approach to licensing and data use".
A screen you run for yourself is personal use. A public page publishing screening results is a different conversation, and the licence page in this lesson's sources is where it starts.
Try it now
Ship both pages, then use the join for real: screen, promote one name to your watchlist, and open the watchlist to find it there. If any step feels awkward, that awkwardness is the design telling you something — write it in PLAN.md rather than pushing through it, because the Build a Dashboard course rebuilds all of this into one surface and that note will be the brief.
The prompt
Mock mode on, plan mode on, and paste:
Add a link each way between the watchlist and the screen page. Then
plan, before any code, an "Add to watchlist" button on each screen
result. The watchlist is a constant in src/lib/watchlist.ts that a
browser cannot write, so propose: where an added symbol is stored, how
the server-rendered watchlist reads it, how it is validated (it comes
from a browser), how a screener code becomes a watchlist symbol, and
what each addition does to the cost of one load. Wait for my approval.
Then build it, tests first. Done means npm test, typecheck, lint and
check:leak green; show me the diff.
The storage decision arriving late is the point of the plan. A good one names a store the server can read, validates every symbol it finds there, caps how many, and prices each added real-time symbol at one more call per load.
When the button works, the feature pass, in a fresh session, plan mode on:
Read REVIEW.md. Review the whole screener against it, lens by lens in
its order: the screen page and every file under src/ it uses, the
watchlist's new store for added symbols, and their tests. For each
finding give the file, the line, the lens and what it would cost a
user. Fix nothing and make no API call. After I approve, save the
list to notes/review-feature.md.
Then fix each finding you agree with as its own small change, test first, or write beside it in the notes why it stays.
Check it yourself
- Screen, add one name, open the watchlist: it is there, and the cost per load on the meter went up by one. On mock, a symbol the mock has no fixture for shows as Unavailable; the name still being there is what this check wants.
- Put a malformed symbol into that storage by hand (lowercase, or with a space or a slash in it) and reload: the watchlist drops it and still renders. A well-formed symbol that does not exist, such as ZZZZZZ with the .US suffix, cannot be caught without a request: it stays as an Unavailable row and costs its call on every live load, which is why additions are capped.
- Run
REVIEW.mdover the whole screener as the feature pass, with the second prompt above, and fix or note every finding before you call it shipped. - Deployed, open the network tab on both pages, or extend Build Your First Tool's network-tab script to the second page: no request goes to eodhd.com from the browser.
Compare with ours
// src/app/page.tsx: the watchlist plus what the screener added
const SYMBOL = /^[A-Z0-9][A-Z0-9.-]{0,19}$/;
const added = readAdded((await cookies()).get("watchlist-added-v1")?.value)
.filter((s) => SYMBOL.test(s)) // it came from a browser
.slice(0, 10); // each one is a call per load
const tickers = [...new Set([...WATCHLIST, ...added])];
The pattern rejects a malformed symbol; whether a well-formed one exists only a request can say, so the cap is the guard there. A cookie, because the page is rendered on the server and browser storage never reaches it. Our screens are US-only, so a screener code becomes a symbol by appending the exchange suffix. The full state at the end of this unit is on the starter's branch ref/build-a-screener/u4.

Checkpoint
npm test && npm run typecheck
git status # only the files this step touched, no .env*
git add -A
git commit -m "Screen to watchlist: a link each way and one button, validated on the server"
Then answer this lesson's questions.