Engineering
Building a Static-First Portfolio with a CMS Backend
How I separate public performance from private content operations without reducing article quality.
Williams Madu · · 12 min read
A practical breakdown of how a fast public portfolio can use a protected CMS backend for publishing, editorial images, structured writing and safe frontend hydration.
The goal is not just dynamic content
Moving a blog from static files into a CMS is not automatically an upgrade. If the frontend simply dumps remote text onto a page, the result can be worse than the original hand-crafted article. The goal is to preserve editorial quality while making publishing safer and easier.
That means the backend must store enough structure for the frontend to rebuild the premium article experience: title, subtitle, excerpt, author, reading time, category, tags, cover image, banner image, gallery imagery, SEO and rich sections.
The CMS becomes valuable only when the published result still feels intentional. A reader should not know whether the source was static data or Payload; they should only feel that the article is clear, polished and worth reading.
Keep the public site static-minded
A static-first portfolio should remain fast and predictable. The public frontend can hydrate from CMS APIs, but it should keep a stable layout, graceful fallbacks and carefully normalized data. The dynamic layer should improve operations without weakening the reader experience.
The API should return only public-safe fields. Private admin settings, draft content, archived content and scheduled content should never leak into the public blog. That boundary lets the frontend stay simple and confident.
When the backend is unavailable locally or in production, static fallback content protects the site from looking empty. This is not a shortcut; it is a resilience pattern for a personal brand surface.
Editorial images are part of the contract
Blog images should not be treated as decoration added after the fact. Each post needs a strong card image, a banner image and optional gallery images that support the article. The image contract needs clear alt text and credit fields so the UI remains accessible and professional.
The backend can support uploaded media and permanent image URLs. Uploaded media is useful when asset storage is fully configured. Permanent image URLs are useful for a stable local seed because they avoid requiring a file upload pipeline before the content model can be tested.
The frontend should not care which source was used. It should normalize the media into a single shape and render it consistently across cards, featured areas and article pages.
Structure the article before rendering it
The individual article page needs more than a long paragraph. It needs a table of contents, clear section headings, readable spacing, strong lede text, share actions, a call-to-action and related articles. Those parts create the reading experience that was already strong in the static version.
The frontend adapter should convert Lexical rich text into section objects before rendering. That makes the UI deterministic. Headings become sections, paragraphs stay grouped, upload nodes become media and gallery images sit in their own visual notes area.
This adapter layer is important because it prevents the article page from becoming a direct mirror of backend implementation details. The backend can evolve while the frontend keeps a premium reading structure.
Design the admin workflow around quality
The admin user should not have to guess what makes a post complete. The collection should make editorial fields visible: imagery, metadata, SEO, status, reading time and content. That is how a CMS supports quality rather than only storing text.
A one-time local seed also matters. It gives the developer a realistic set of posts immediately after running the backend, so the frontend can be judged against real page density, image handling and article structure rather than a tiny test paragraph.
The quality bar is simple: the CMS-powered version should maintain the deployed static quality first, then create room to exceed it.
Define an explicit publishing contract
A CMS record is not a frontend component. The server should publish a deliberately small contract containing title, slug, summary, body, publication status, image metadata, and search metadata. The client should not depend on editor-only fields, internal relation IDs, or the order in which Payload happens to serialize a collection.
Treat publication as a state transition: a draft is editable but not discoverable; a scheduled story does not appear before its publication time; an archived story disappears from public indexes. The listing endpoint and the individual-slug endpoint must enforce the same eligibility rules, otherwise a hidden article can be reached through a guessed URL.
For media, persist descriptive alt text, distinguish a card thumbnail from a wide hero image, and use stable object storage rather than transient development URLs. A reader should still understand the article when an image fails to load.
- Server: publish a stable allowlisted DTO, enforce publication status, and return explicit pagination metadata.
- Editor: validate the slug, title, excerpt, publication date, thumbnail, banner and alt text before publishing.
- Client: render supported node types, keep a readable empty state, and provide a safe failure fallback.
- Operations: trace broken media URLs, verify CORS, and monitor failures without exposing private CMS records.
Further reading and references:
type PublicArticle = {
slug: string
title: string
excerpt: string
publishedAt: string
content: LexicalDocument
images: { thumbnail: string; banner: string; alt: string }
}
// Validate and serialize on the trusted server.
// Do not spread internal database records into an API response.An illustrative contract. Keep secret and admin-only fields out of the public response.
Verify the integration like a product, not a screenshot
A green production build proves that the compiler accepted a bundle. It does not prove that the editorial workflow communicates correctly across permissions, drafts, caching, scheduling, API serialization, and responsive rendering. Acceptance must exercise the whole route from editing a record to reading a published article in another browser session.
Create one detailed story with a link, bullet list, numbered list, code example, quote, and multiple images. Confirm each element survives saving and returning to the admin editor. Then confirm that the public article preserves the same order, accessible labels, and meaning on narrow and wide screens.
Repeat the checks with the API disconnected. The fallback should preserve the shell and explain unavailability; it should not silently leak drafts, merge unrelated data sets, or pretend that stale content is current.
- Create a draft with realistic rich content and verify it is not public.
- Publish it, verify list and slug endpoints, and reload the frontend.
- Edit media, links and formatting, then verify the full round trip.
- Archive the article and verify it disappears from both public endpoints.
- Test small screens, keyboard navigation, and a simulated backend outage.
Editorial quality is a data-contract requirement, not a CSS afterthought.