Agency website with a private CMS and lead pipeline, audited and launched
A digital agency's site with a quote builder, an AI chat assistant and a private admin panel for content and leads, which I audited, hardened and deployed on a persistent volume.
The problem
A digital agency needed its site to do real work: let visitors browse services, build a quote, send a brief and chat with an assistant, while the owner edits content and handles leads without a developer. The build I took over looked finished, but it had never been run the way production would run it, and leads were kept in a single file with no protection.
How I built it
I audited it by running it, not by reading it: 24 findings, 17 proven by running a production copy and opening the output, 7 from the code only, each with a command to repeat the check. I fixed 50 items in three packages (backend and infrastructure, public site, admin panel), then packaged the site as one Docker container for Northflank with a persistent volume for leads, settings and uploads. After launch I added a three.js butterfly background with controls in the admin panel.
What got hard
- Started the documented way, the server ran Vite's developer mode and handed its own backend source to anyone who asked for it.
The production server is now the default and only npm run dev starts Vite. The deploy guide has a post-deploy check that /server.ts, /server.cjs and /package.json each return 404 on the live address.
- Leads could be erased silently: a cut-off leads file was replaced by the next submission (tested: 2 leads became 1).
Writes now go through a temporary file and a rename, and the server refuses to start unless the data folder is a separately mounted volume. On the live service a test lead survived a restart.
- The admin login's guess limit could be bypassed with a forged X-Forwarded-For header, and the right fix depends on how many proxies sit in front of the server.
The number of trusted proxies is now an explicit setting, with a written test: twelve bad logins from one machine must give eight 401s and then 429, and a bad login from a second network must still be a 401.
- A decorative 3D butterfly background must never make text harder to read.
I built a low-resolution mask of every text line box so wings, glows and trails fade to nothing behind text, and measured it with a contrast script. Line boxes failing WCAG because of the butterflies went from 55 of 1090 (worst 1.1:1) to 0 of 1090 (worst 4.55:1) at 1920x1080, 1440x900 and 390x844. Without WebGL2, or after a lost GPU context, the page falls back to a still image.
The result
Deployed to Northflank on 23 October 2026 as one container with a persistent volume. Known dependency advisories went from 26 (1 critical, 9 high) to 0, the live chat answered through Gemini, and a test lead survived a restart.
The ← and → keys turn the page too.