Code review

Read line by line, fixed where it fell short

I reviewed this site's own code the way I would review a pull request at work: every route, controller and middleware, plus the dependencies and the deploy pipeline. This page shows what holds up, what I found and fixed, and what is still open. It is updated as the site changes.

Code reviewed
About 11,500 lines
Found and fixed
10 findings
Still open
1, low risk
Last reviewed
1 November 2026

How I reviewed it

Reviewed since 28 October

Change What I checked Verdict
Laravel 13 Moved from Laravel 12.70 to 13.39, with PHPUnit 12 and Tinker 3. Laravel 13 needs PHP 8.3, which the pipeline already runs. PHPUnit 12 is stricter, and it flagged one test that was quietly ignoring part of its data Done. That test now checks the value it used to skip, and all 381 tests pass
TypeScript version A fourth version of the site in plain TypeScript with no framework. Strict compiler settings, and a type check that fails if the shared page content stops matching what the pages expect. Text is always added as text, and markup only ever comes from content I wrote Sound. The type check runs on every push
3D effects A three.js dot field behind the home page name and a 3D version of the flag's eagle. Both load after the page itself, stay hidden from screen readers, hold still for visitors who ask for reduced motion, pause when the tab is hidden, and fall back quietly where WebGL is missing Sound. The 3D library loads only on the pages that use it
Private job tracker online The tracker I use for job applications can now also be reached under /admin, behind the same IP range and passphrase as the rest of the admin area. Pasted advert text has raw HTML stripped and unsafe links dropped, and the pages are marked not to be indexed Sound. Tests prove it is a 404 outside the IP range and asks for the passphrase inside it

What holds up well

Area What I found Proven by
Output escaping Everything visitors can type is escaped before it reaches a page. The few places that print raw HTML only print content I wrote, or text that was escaped first A Content Security Policy with no unsafe-inline as a second line of defence
Input validation Every form and endpoint validates its input: lengths, formats and allowed values. Route parameters are pinned to patterns, so a file name can never become a path Feature tests for each endpoint
Admin access Admin pages are a 404 outside a set IP range, then need a passphrase that is stored hashed, with guessing rate limited. The passphrase check sits on the whole admin route group, so a new page cannot forget it Tests, including one proving a forged X-Forwarded-For header cannot fake the admin IP
AI chat cost and abuse Each question needs a one-time challenge, and there are limits per minute, per visitor per day, per chat and across the whole site per day. Chat history comes from the server, so a visitor cannot put words in the assistant's mouth Tests that fake the AI model, so they are free and repeatable
Privacy IP addresses are never stored, only a one-way code, and the chat's contact email is sent as plain text so nothing in it can run A test that fails if a raw IP ever reaches the visit log
Deployment The site only deploys once every check passes: security audits, code style, the TypeScript type check, the component tests and the full test suite. The deploy checks the server's settings first and refuses to connect to a server whose key it does not recognise The GitHub Actions workflows

What I found and fixed

Finding Risk Fix
New advisory in the email library Medium. An advisory published on 28 October, after the last review, covers header injection in the library Laravel uses to build emails. The chat's contact form sends email, though its fields are already validated Updated the library to its patched release. Both audits report nothing again
Card game moves were not locked Low. Each move read the game from the cache, changed it and wrote it back, so two requests landing at the same moment could overwrite each other Every change to a game, including joining and dealing, now holds a lock on that game. A move that cannot get the lock within a few seconds is turned away with a message instead of hanging. Tests prove a waiting move changes nothing
Chat limits counted refused questions Low. A question turned away because the chat was full still used one of the visitor's daily questions, and a failed AI call still used one of the site's. Both only made the limits stricter than intended A question still counts the moment it arrives, so two at once cannot both slip under a limit, but the count is given back if it is turned away or the AI call fails. A test covers each case
No front-end unit tests Low. The Vue and React versions were only tested through the server, which checks every page loads and links up Added 27 component tests with Vitest for the navigation, the version switcher and the project cards in the Vue, React and TypeScript versions, including keyboard use and escaping. They run on every push
Code style drift Low. 32 files did not match the Laravel style preset, up from 24 at the last review. Pint was installed, but nothing enforced it Formatted everything, with no change in behaviour, and added pint --test to the pipeline, so new code has to match
Out-of-date dependencies High. The audits listed 49 security advisories across 14 PHP packages, Laravel among them, and 3 in JavaScript packages. Most were in features this site does not use, but one was in the email validation rule the chat's contact form relies on Updated Laravel from 12.17 to 12.70 and the other packages within their current major versions. Both audits now report nothing, and all tests pass
Nothing caught new advisories Medium. The pipeline ran the tests but never checked dependencies, which is how the advisories above built up Added composer audit and npm audit to the pipeline. Any PHP advisory, or a high-severity JavaScript one, now stops the deploy
Passphrase check copied 11 times Medium. Each admin chat page checked the passphrase itself, so a new page that forgot the check would have been open to anyone on the admin IP range Moved the check into middleware on the whole admin route group, and added a test that visits every admin route without the passphrase and expects to be turned away
Leftover debug logging Low. The multiplayer card game wrote a stray debug line to the log each time a second player joined Removed
Out-of-date comment Low. A comment on the chat routes still said the chat was limited to the admin IPs, after it had opened to everyone Reworded to match what the code does

Still open

Finding Risk Plan
Card games are joined on a page view Low. Opening a game's link takes the second seat. If the link is pasted into a chat app that fetches a preview, the preview can take the seat before the friend it was meant for Join only through the form that already exists, and have the game page just show the game