Got a project in mind? Book a free 30-minute call

Saadaan Hassan
Case study

saadaan.dev: Rebuilding My Own Site Like a Client Project

saadaan.dev: Rebuilding My Own Site Like a Client Project

Summary

The site you're reading, rebuilt as a side project: an audit, a twelve-phase plan, a custom CMS, an AI chat grounded in published work, and AI drafting that can never publish.

My part

My RoleSole developer
Stack
Next.jsReactTypeScriptTailwind CSSSupabasePostgreSQLVercel AI SDKGroqMCP

The problem

My portfolio had grown the way side projects do. It started in 2024 as a static React site, moved to Next.js and Supabase with an admin panel in early 2026, and in March picked up a "digital clone": a chat on the homepage that answered as me. It looked impressive. It also described a tech stack I wasn't using, because it answered from a fixed prompt rather than from my actual work.

In September 2026 I audited the whole thing the way I'd audit a client's codebase. In short:

  • both apps were on a framework version with known critical vulnerabilities;
  • database permissions were broader than they should have been;
  • the schema lived in one hand-run SQL file, with no migrations;
  • there were no backups, no error monitoring, no CI and no tests;
  • the chat ignored the real content, and the site's description for AI assistants listed tools I didn't use.

So I treated my own site as a client project: a written plan, evidence at every step, and a decision record whenever I changed direction.

The rules it never breaks

  • The chat answers from published work, not from memory. It's instructed to call tools that read the same published case studies, services, experience and posts the pages show, and never to invent a client, a metric or a price. Instructions alone can't make a model perfectly obedient, so the tools only ever return content that's already public.
  • AI can draft, never publish. The credential my AI assistants use can create drafts and nothing else.
  • Edits never silently overwrite each other. Every save carries the version it was based on. If the content changed in the meantime, the save fails instead of quietly merging.
  • Only the owner can change content, and the database enforces that itself, not just the admin's screens.

What I built

A public site and a separate admin

Two Next.js apps on Vercel share one Supabase database. The admin manages case studies, services, experience, companies and blog posts, plus an inbox for contact messages, a read-only log of chat conversations, and the CV. Sign-in is protected by a CAPTCHA, and a case study saves together with the services it belongs to in a single transaction.

Ask Saadaan, rebuilt

The "digital clone" became Ask Saadaan: a chat widget on every page, with a full-page version too. It answers through four tools that read published case studies, services, experience and posts, and shows what it finds as cards under a short reply. It speaks plainly, the way an experienced engineer talks to a client, never quotes a price, and offers a link to get in touch or book a call.

A small filter rewrites em dashes as the answer streams in, because instructions alone didn't stop the model using them. Links to other pages on the site open in place and close the chat. It's rate limited per visitor, and the conversation logs I keep have emails and phone numbers stripped out before they're stored.

An MCP drafting server

I can ask Claude Code, Codex or other assistants to draft a blog post or a case study straight into the admin. The server runs only on my own machine and can do three things: create a draft post, create a draft case study, and read what's already published. It can't publish, edit, delete, or even read drafts.

Writing, search and answer engines

The site has a blog with an RSS feed, and an llms.txt file that lists the real case studies and posts. Structured data describes me, the site, and each case study, service and post. The FAQ's visible questions and its structured data come from the same source, so they can't drift apart, and the sitemap uses real update dates.

Decisions worth explaining

Adopting a headless CMS, then reverting six days later

When the blog and drafting features came up, the custom admin looked like it would grow a lot, so I evaluated Directus. A prototype passed a 19-point review, and I moved the site onto it.

Six days later I reverted. Running Directus meant a second hosted service with a measured cold start of over 90 seconds, a source-available license to keep track of, and a second permission system alongside the database's own. Most of what made it attractive (roles, CAPTCHA, error tracking, atomic saves, typed data and real migrations) was already built into the custom admin. For five content types edited by one person, the extra service wasn't worth it. The revert removed more than 21,000 lines.

It had a cost: content edits now take up to an hour to appear, because the instant cache refresh went with Directus. I accepted that.

Drafting without a login

The first version of the drafting server signed in like a normal user. It failed in production, because the CAPTCHA that protects admin sign-in rejects every automated sign-in, and there's no way to exempt a single account. Rather than weaken that protection, drafting now goes through one narrow database function that checks a hashed secret and can only ever write drafts. A leaked secret could create junk drafts and nothing more.

Migrations as the single source of truth

Every schema change is a migration in Git. CI rebuilds the database from scratch, checks for schema drift and that the generated types still agree, and runs test suites against the access rules. When I fixed a bug in the drafting tool this month (new case studies were created without a position in the list, which clashed with the rule that every position is unique), the fix shipped the same way: one migration, the old version saved first, and a throwaway draft to prove it worked.

Rewriting the site around one sentence

Once the foundations were solid, I rewrote the copy around one sentence: "I build software around how a business actually works." Five overlapping services became three, and every old service URL redirects to its new page, so nothing that had already been shared or indexed broke.

How it's run

  • CI checks the migrations, the access rules, that no privileged key ends up in the browser bundle, the end-to-end flows, and accessibility.
  • The accessibility checks run 28 times, across Chromium, Firefox, WebKit and a mobile profile.
  • Backups are scripted, encrypted snapshots with a tested restore, because the free database plan doesn't include any.
  • Errors go to Sentry with personal data scrubbed, an uptime monitor and a health check watch the site, and Dependabot watches the dependencies.

Limits

  • Content edits take up to an hour to show on the live site.
  • Mobile performance scores sit around 80, and about a third of the JavaScript shipped isn't used yet. Trimming it is next.
  • Renaming a case study changes its URL, and the old address isn't redirected yet.
  • The chat follows instructions, but it isn't infallible, so its replies are labelled as AI-generated.

How it was built

This was a side project, fitted around my main work: an hour or two on some days, nothing at all on others, spread between the audit on 11 September and the repositioning on 2 October 2026. Working in short, irregular sessions is exactly why the twelve-phase plan and the twelve decision records mattered: each session could pick up where the last one stopped. AI coding agents did most of the typing: Codex for the first eight phases, then Claude Code. The plan, the rules above, and the calls to change direction, including undoing one, were mine.

Project Showcase

System Visuals

The Ask Saadaan chat answering "What have you shipped?" with case study cards
Freelance and contract

Have a similar engineering problem?

Let’s discuss your requirements, constraints, and what a useful solution would look like.