← All writing

1 min read

Why I rebuilt this site with a Fastify + Neon backend so I can publish projects and notes without touching code.

  • #meta
  • #nextjs
  • #fastify

My old portfolio had a problem: every new project or small update meant editing code, committing and redeploying. So I rebuilt it with a proper backend, and now content lives in a database I can edit from an admin page.

The stack

  • Next.js 16 renders the site, with React Three Fiber for the 3D bits.
  • Fastify serves a small JSON API.
  • Zod schemas validate every request and also generate the OpenAPI docs.
  • Drizzle ORM keeps the Postgres schema and queries type-safe.
  • Neon hosts the Postgres database.
  • Swagger UI documents every endpoint.

How it fits together

The site makes one request for everything it needs:

const res = await fetch(`${API_URL}/api/portfolio`, {
  next: { tags: ["portfolio"] },
});
const { settings, projects, posts, experience, skills } = await res.json();

When I save something in the admin page, the API pings the site to revalidate the portfolio tag, so changes show up within seconds without a redeploy.

More notes to come — now that publishing them doesn't need a code change.