Inside this portfolio: what it does and how it works
Most portfolios are a page of links. This one answers questions about my work, keeps its own leads and traffic, manages its own photos and checks itself on every change. Here is every part of it, how each one works, and the problems that decided how it is built.
On this page
- The stack in one paragraph
- What is on the site
- One file holds the words
- The AI twin
- Retrieval, not memory
- Streaming, sources and what to ask next
- Two bugs worth knowing about
- No sign-up, and honest about storage
- The admin and its co-pilot
- Every number in one request
- A co-pilot that cannot change anything
- Contact: store first, email second
- Analytics without cookies
- The gallery
- Writing
- Found by search engines and AI assistants
- Fast on a phone
- Phones and themes
- The résumé
- Checks on every push
- Try it
- FAQ
Most portfolios are a page of links to work that lives somewhere else. This one is also a working product: it answers questions about my work, keeps its own leads and traffic, manages its own photos, and checks itself on every change. It is the project I know best, so this is the complete tour: every part of it, how each one works, and the problems that decided how it is built.
It is written for two readers at once: someone hiring for a full-time role, and someone looking for a developer to build their product. Both see the same pages. What differs is which evidence they look for.
The stack in one paragraph
Next.js 15 with the App Router and TypeScript, deployed on Vercel. Supabase is the only backend: Postgres for the data, pgvector for search, Storage for photos, and Auth for the one account that can sign in, which is mine. OpenAI runs the two assistants, and Resend sends me an email when someone gets in touch. Styling is Tailwind with a small set of named recipes, and there is no UI kit and no animation library. Pages render on the server unless they need to respond to the visitor.
What is on the site
- Home: who I am, featured work, a short about section, what I build for clients, an FAQ, and a way to get in touch.
- Work: one case study per project, grouped as day job, freelance and personal. Each states the problem, what I built, the results and the stack, and links to the essays about it.
- Writing: essays like this one, about the builds behind the case studies and how I work.
- AI twin: an assistant that answers questions about my work from this site's pages.
- Gallery: photos, each with its own page and a full-screen viewer.
- Contact: the hiring page for both kinds of hire, with the résumé.
Some parts are read mostly by machines: a sitemap, an RSS feed of the essays, llms.txt and llms-full.txt for AI assistants, structured data on every page, and a generated social card for every page and essay.
Behind a sign-in there is an admin: a dashboard, the traffic, the leads, the AI twin's conversations, the gallery manager, and an assistant of its own.
One file holds the words
Every piece of copy, from the bio to the services, projects, experience and skills, lives in one TypeScript file. The pages render from it, and so does everything derived from it: the structured data, the sitemap, both llms files, the social cards and the AI twin's knowledge. Change a project's description once and all of those follow on the next deploy. The twin's copy is the one exception, and it is covered below.
The résumé is a single field too. Every link to it, on the home page, the contact page, the footer, in the structured data, the sitemap and the llms files, reads the same value, so replacing the file is one edit.
That file also showed me how much an import can weigh. The navigation bar needed my name and read it from the content file. The navigation bar is on every page and runs in the browser, so that one import shipped every case study and the twin's whole brief to every visitor: about 10 KB compressed, on every page. My name, email, phone and résumé link now live in a separate file that imports nothing, and code that runs in the browser may only read that one.
Essays and case studies link to each other from the same source. An essay lists the case studies it explains in its front matter; the case study then shows the essay under "In depth", and the essay links back. A slug that does not exist fails the build, so renaming a project cannot leave a dead link behind.
The AI twin
The twin is the part visitors notice. Ask it what I have built, what I am strongest at or whether I am available, and it answers in my voice from this site's content, with links to the pages it used. The case study has the summary. This is how it works.
Retrieval, not memory
A general model asked about me will invent things, and invent them plausibly: a project I never built, a stack I have never used. On a site whose job is to represent my work accurately, that is worse than having no assistant.
So the twin answers from retrieved text. A script reads every case study, essay, service, FAQ answer and résumé entry, cuts them into passages of about 1,200 characters, and stores each one with an embedding (OpenAI's text-embedding-3-small, 1,536 dimensions) in Postgres with pgvector, behind an HNSW index. A question is embedded the same way, and a database function returns the six closest passages above a similarity floor. Only those reach the model, gpt-4o-mini, labelled with their titles and paths. Its instructions say to prefer them for anything factual, and to point to the contact page rather than guess.
The script hashes each passage and skips the ones that have not changed, so editing one project re-embeds one project. It does not run on deploy, though, and that has bitten me: after I removed some text from the site, the twin went on quoting it until the passages were rebuilt. Rebuilding is now part of every content change, after a dry run that prints how many passages each kind of content produced. That count exists because a pattern in the script once stopped matching and quietly dropped every case study's problem and solution, with no error.
Streaming, sources and what to ask next
Answers stream: the words appear as the model writes them. Until the first one arrives, a line of shimmering words ("Searching his work…", "Reading the case studies…") stands in for the usual typing dots, and it disappears the moment the text starts.
Under each answer, a folded "Sources" line lists up to three pages it was drawn from. The server picks them, not the model: a passage counts if it scored well and close to the best match, or if the answer links to its page.
Above the message box, three suggested questions wait to be tapped. A second model call writes them from the same passages, so they are specific to what was just asked, and the site has the material to answer them. It runs alongside the answer, which takes longer to stream, so it adds no wait. The model can also put buttons there, such as booking a call or opening the résumé, once the conversation gets to that point.
All of that travels at the end of the same response, after a marker the browser splits on. The browser holds back only the few characters that could be the start of that marker, so the first words show the moment they arrive.
Two bugs worth knowing about
The first: with tool calling on, gpt-4o-mini sometimes answers a question by calling the tool that suggests buttons and writes no text at all. The response is complete and empty, and the visitor watches a reply that never fills in. Rewording the instructions did not change it. The server now notices a turn with no text and asks again with the tool turned off.
The second only happens in production. The server used to close the stream and then save the reply "in the background". On Vercel there is no background: once a response has ended, the function can be frozen, and the save with it. One day the tables held three conversations and one message between them. The questions had been saved and the answers lost. A local server finishes the save either way, which is why it never showed up in development. The reply is now saved first and the stream closed after, at the cost of one round trip to the database after the last word.
No sign-up, and honest about storage
There are no visitor accounts. A visitor's first message creates an anonymous id in their browser, so the history drawer can list their earlier conversations. The drawer says plainly that the chats are stored on the site and that I can read them: clearing the browser's data ends the visitor's access to them, not their existence.
Every message costs money in model calls, so the endpoint is rate limited before any call is made: per network, per visitor id, and with a daily ceiling for the whole site, because an anonymous id costs nothing to replace.
The admin and its co-pilot
The admin is where I find out what happened: a dashboard, the full activity feed, the lead inbox, every twin conversation with its token count, and the gallery manager. One account can open it, and the database checks that as well, through row-level security. If the app's check were ever wrong, the data still would not come back.
Every number in one request
All the admin's numbers are columns of a single database view. A page asks for the columns it needs, and every column asked for while a page renders goes out as one request. A new metric is a new column, so adding one never adds a round trip.
Two measurements shaped it. Every admin read used to take 500 to 880 ms, which I read as a slow database for months. It was distance: Vercel runs functions in Washington, DC unless told otherwise, and the database is in Mumbai. The admin now runs in Mumbai. Then the security policies turned out to call a function that Postgres ran once for every row, about 80% of each rollup's time. Wrapping the call in a select makes Postgres run it once per query.
Moving between sections is instant. Each section is prefetched in full and kept fresh in the background, so a click shows the page from memory and updates it in place.
A co-pilot that cannot change anything
Inside the admin there is a second assistant, on gpt-4.1. It reads the same data the pages show, through the same functions, so it cannot disagree with the dashboard. Every request starts from a live snapshot and the page I have open, so "summarise the week" or "who is waiting for a reply?" is one question instead of a tour of four pages.
It can put buttons under an answer: open a lead, open a conversation, mark a lead handled. The server checks each against the data, and nothing changes until I click. That is deliberate. An assistant that can act on a misread instruction is a worse tool than one that can only suggest.
Contact: store first, email second
The contact form saves the message to the database before it tries to send me the notification email. If the email provider is down, the enquiry is still there, marked as not emailed, and it shows in the admin. The visitor only sees a warning if both failed. A hidden field catches bots that fill in every field, and the endpoint is rate limited.
The database lets anyone add a lead and nobody but me read one, so the public key the site ships with cannot read the inbox.
Analytics without cookies
Page views, and the actions that matter, such as a résumé download, a tap through to the contact page or a message to the twin, are recorded in my own database. The actions also go to Vercel Analytics.
No cookie is set and no IP address is stored. The server combines the IP, the browser's user agent, a secret and the date, keeps a short hash of the result, and discards the rest. The same visitor on the same day gets the same hash, so "visitors today" is a real number. Tomorrow it is a different hash, so nobody can be followed from one day to the next. Known bots are dropped, a referrer is cut down to its domain, and query strings are removed from paths, because they can carry an email address.
The gallery
Photos are uploaded from the admin, and the work happens in the browser: it reads the date and place from the photo's metadata, resizes and re-encodes it, and gives it a readable file name before uploading it and saving its row. If saving the row fails, the upload is deleted.
Alt text writes itself unless I write it. An empty field means it is composed when the page renders, from the photo's category, date and place. The generated sentence is only a fallback: every photo in the gallery has its own description.
Photos are served from the site's own address rather than straight from the storage provider, which marks its files as not to be indexed. Through the site, they can appear in image search. The database checks each photo's category, so a typo cannot create an uncategorised tile. The full-screen viewer follows your finger as you swipe by writing the position straight to the element on each frame. As React state, every move re-rendered every photo in the gallery.
Writing
Each essay is a Markdown file with front matter: title, summary, date, tags, and optionally an FAQ and the case studies it explains. The front matter becomes the page's metadata, its structured data (including an FAQ block that search engines can read), a table of contents, a reading-progress bar, an entry in the RSS feed and its own social card.
Search titles are capped at 60 characters and descriptions at 155, and both are counted, because results cut anything longer. When a title once ran long, the part the results page cut off was my name and "Open to roles".
Found by search engines and AI assistants
Every page carries structured data built as one connected graph: I am defined once as a Person and the site once as a WebSite, and every case study, essay and photo points at those two. robots.txt names the AI crawlers and lets them in, and llms.txt gives an assistant a map of the site that starts with how to hire me. I wrote that part up in Making this site readable by AI assistants.
When a deploy finishes, a GitHub workflow tells Bing which pages changed, through IndexNow. It fingerprints what a reader would notice on each page, meaning the text, title, description, structured data and alt text but not the markup, which changes on every build. Then it sends only the pages whose fingerprint changed, because search engines learn to ignore a site that pings pages that did not change. ChatGPT's search is built on Bing, so this covers part of AI search too.
The social cards are drawn on demand: my portrait, the page title and the site's display font. The font and the portrait are embedded in the code, because most cards are drawn on the edge runtime, which has no filesystem, and a card that has to fetch something can fail without anyone noticing.
Fast on a phone
I measure before I optimise, and the biggest win came from a file nobody would have suspected. A loading screen at the root of the app wrapped every page in a placeholder, and React then sent each page's real content at the end of the document, to be swapped in by a script. The home page's main content appeared 2.5 seconds after it loaded. Without that file it appears in about 0.2 seconds. The same day's changes took the gallery from 5.7 seconds to 0.3. Those are measured on a fast connection; on a throttled one, the home page went from 2.5 seconds to around 0.5.
Then everything visible on first load stopped waiting for JavaScript. Content that fades in on scroll, the page transition, and images held back until a "loaded" flag each kept something already in the HTML hidden for a second or two on a slow phone. A small script at the end of the page now reveals what is on screen before React starts. Layout shift is zero on every page.
The database client now loads only when something needs it, which took the AI twin's first download from 191 KB to under 130 KB. Motion is CSS only, on one easing curve, and it switches off for anyone whose system asks for reduced motion.
Phones and themes
On a phone the site gets its own navigation: a tab bar at the bottom that steps aside when you scroll down or the keyboard opens. On the twin, the conversation is a pane exactly as tall as what you can see, so the message box sits on the keyboard on both iPhone and Android, which make room for the keyboard in different ways. The site has a light and a dark theme, and it can be added to a home screen and opened like an app.
The résumé
The résumé is one Word document. A script has Word export the PDF, and refuses to save it unless the PDF's text matches the document character for character and still fits on one page. Every push checks that the PDF on the site matches the Word file on the site, so the two cannot drift apart.
Two layout choices are for applicant tracking systems, not for looks. Dates sit on the same line as the role, and skills are written as "Label: values". A gap that looks like a second column is read out of order by the parsers those systems use, which detached the dates from their roles.
Old résumé links redirect to the current file, because they were pasted into job applications, where a broken link fails without anyone hearing about it.
Checks on every push
Every push is linted, type-checked and built, and then tested against the production build:
- an accessibility audit of every page at desktop, tablet and phone widths, which fails on a single WCAG 2.1 AA violation;
- a link check that crawls the site and fails on any broken link. Its first run found the footer's "Résumé" opening the contact form;
- a report of load-speed measurements for every page.
The build has to pass with no secrets at all. Every integration falls back to something sensible, so a missing key is never the reason a deploy breaks. On my machine, a visual check screenshots every page at three widths and fails on anything that overflows sideways.
Every trap that cost real time is written down in the repository as what it looked like and what it turned out to be. There are about thirty of them now, and each is there so nobody pays for the same discovery twice.
Try it
The quickest way to see most of this is to ask the AI twin something about my work and open the sources under its answer. If you want something like it for your own product, whether an assistant over your content, an admin that answers questions or a form that never loses a message, tell me about it. I read every message and reply personally, usually within 24 hours.
Frequently asked questions
- What is this portfolio built with?
- Next.js 15 with the App Router and TypeScript, deployed on Vercel. Supabase is the only backend: Postgres for the data, pgvector for search, Storage for photos and Auth for the one account that can sign in. OpenAI runs the two assistants and Resend sends the email when someone gets in touch.
- Does the AI twin make things up?
- It answers from passages retrieved from this site's own pages, not from what a model remembers about the world, and it lists the pages it drew on under each answer. When the passages do not answer a question, it is told to say what it does know and point to the contact page rather than guess.
- Do I need an account to use the chat?
- No. Your first message creates an anonymous id in your browser, so the history drawer can show your earlier conversations. The chats are stored on the site and I can read them; clearing your browser's data ends your access to them.
- Can you build something like this for my product?
- Yes. An assistant that answers from your own content, an admin that answers questions about your data, and forms that never lose a message are the kind of work I take on. An AI feature in an existing product usually takes one to three weeks. Start with a message on the contact page.
If you are deciding whether to hire me, the stack matters less than how I make decisions. These are the six rules I keep on every build, each with the project that taught it to me and a link to the evidence.
ReadOne vector search across a mixed corpus returns confident nonsense, because semantic closeness is not topical relevance. Filtering on metadata first, then searching, then reranking fixed it. Here is what each stage actually earns.
Read