Europe/Helsinki
ProjectsOctober 14, 2026

Personal Portfolio with a Supabase-Backed CMS

image
This is the site you're reading now. It started from the open-source Magic Portfolio template. I've since added a content backend so I can write posts, add projects and update my profile from a browser, without touching code or redeploying. The site is built with Next.js 15 (App Router), React 19 and TypeScript, styled with the Once UI design system, and deployed on Vercel.
  • Supabase as the content source, with a local fallback: Blog posts, projects, gallery images, social links and all site copy are read from Supabase through two server-only loaders. If Supabase isn't configured, a request fails, or a table is empty, the site falls back to the local MDX files and config, so it can still build fully static.
  • Incremental Static Regeneration: Supabase responses are cached and refreshed on a fixed interval, so pages stay fast and still pick up new content without a rebuild.
  • Admin CMS at /admin: A headless Refine app rendered with Once UI components. From it I manage blog posts, projects, the gallery, social links, site settings and the files in Supabase Storage.
  • Instant updates on save: Every write from the CMS calls a revalidation endpoint that clears the cached Supabase data, so changes show up on the public site right away.
  • MDX validation before saving: Post bodies are compiled in the editor before they're saved, so a broken MDX post can't take down a page.
  • Settings editor that stores only changes: The site content form is generated from the local defaults, and only the fields I change are saved to Supabase. Fields I haven't touched keep their original JSX formatting.
  • Automatic versioning: A GitHub Actions workflow bumps the version on every push to main, reading the commit messages to decide between a minor and a patch bump. The current version is shown in the footer.
  • Admins sign in with Supabase email/password. The session is kept in cookies, and Next.js middleware redirects signed-out visitors away from /admin.
  • Write access is enforced in the database with Row Level Security policies. Only users listed in an admins table can write, whatever the client sends.
  • The CMS only uses Supabase's publishable key in the browser. The secret key is used only by a local seed script.
  • Next.js 15 and React 19: App Router, Server Components and ISR.
  • TypeScript: For the whole codebase.
  • Once UI: Layout primitives, components and theming.
  • Supabase: Postgres, Auth, Row Level Security and Storage.
  • Refine: Data and auth layer for the admin CMS.
  • MDX (next-mdx-remote): For rendering blog posts and project write-ups.
  • Vercel and GitHub Actions: For hosting, deploys and version bumps.
  • Biome, Prettier and Husky: For formatting and linting.
The hardest part was adding a database without losing what made the template good: a fast, static site that works with no backend. I kept the local files as the default and treated Supabase as an optional layer on top, deciding the fallback per piece of content. Keeping all data access in server-only loaders also meant client components get their data as props and never talk to the database directly. I also learned to put security where it actually holds. The admin UI checks whether you're an admin, but that check is only there for the interface. The real rule lives in the database's RLS policies. I can now publish a post or update my profile in a couple of minutes from any browser, and it shows up on the live site immediately. The site still builds and runs from local files alone if the backend is ever unavailable.

Related projects