Form validation
The server checks every submission and shows the errors next to the fields. The browser reuses the same rules to check while you type.
The rules are plain functions in one module, imported by the route and by the script of the page. Without JavaScript, the form still works: it posts to the server, which answers with the form, the errors and what you typed so far. With JavaScript, fields are checked when you leave them, and errors disappear as soon as you fix them. The server checks anyway, since anyone can skip the browser.