CMS And Content

CMS owns the Editor.js canvas, document validation, public rendering, legal pages, and public content routes.

On this page

Content routes

Content typeDashboard pathPublic path
Blog post/content/posts/blog/[slug]
Case study/content/case-studies/case-studies and /case-studies/[slug]
Page/content/pages/privacy, /terms, /disclaimer, and managed pages
FAQ/content/faq/faq
Changelog/content/changelog/changelog and /changelog/[version]/[slug]
Team member/content/team/team and /team/[id]
SEO/content/seoPublic metadata and content metadata

Where to look

AreaMaintainer reference
Editor routes
Implementation referencesrc/app/(editor)/content/editor/[kind]/[id], preview
Editor UI
Implementation referencesrc/features/cms/ui/editor
Public UI
Implementation referencesrc/features/cms/ui/public
Server
Implementation referencesrc/features/cms/server/documents, faq, changelog, dashboard
Shared helpers
Implementation referencesrc/features/cms/shared/documents, editor, faq, changelog
Styles
Implementation referencesrc/app/styles/post-editor.css, src/app/styles/post-content.css
Implementation reference3 areas

These Product code locations explain how the documented behavior is implemented. Expand them when you are ready to customize or maintain this area.

CMS and editor actions

Editor routes, actions, queries, and upsert services keep content validation and persistence server-owned.

  • src/features/cms/server/documents/actions/editor.ts
  • src/features/cms/server/documents/queries/editor.ts
  • src/features/cms/server/documents/services/editor-upsert.ts

Editor canvas

Editor UI, canvas state, history, validation, and local recovery stay inside the CMS feature.

  • src/features/cms/ui/editor/page.tsx
  • src/features/cms/shared/editor/canvas/state.ts
  • src/features/cms/shared/editor/canvas/history.ts
  • src/features/cms/ui/editor/hooks/use-local-recovery.ts

Public rendering

Public post queries, content rendering, legal layouts, and route-kind helpers keep public output consistent.

  • src/features/cms/server/documents/queries/public.ts
  • src/features/cms/ui/public/articles/content-renderer.tsx
  • src/features/cms/ui/public/pages/legal-document.tsx
  • src/features/cms/shared/documents/kinds.ts

Reference paths are relative to the Shipflash-Product checkout.

Content publishing flow

  1. 1

    Edit client-side canvas state

    The editor manages block state, selection, history, recovery, and validation before submit.

    Relevant Product code
    • src/features/cms/ui/editor/page.tsx
    • src/features/cms/shared/editor/canvas/state.ts
    • src/features/cms/shared/editor/validation/validation.ts
  2. 2

    Submit through server actions

    Editor actions validate payloads and delegate persistence to content-owned services.

    Relevant Product code
    • src/features/cms/server/documents/actions/editor.ts
    • src/features/cms/server/documents/services/editor-upsert.ts
  3. 3

    Revalidate public routes

    Maintenance actions keep published content routes in sync with database changes.

    Relevant Product code
    • src/features/cms/server/documents/actions/maintenance.ts
  4. 4

    Render public content

    Public queries and renderers map stored content kinds into blog, FAQ, changelog, case study, page, legal, and team surfaces.

    Relevant Product code
    • src/features/cms/server/documents/queries/public.ts
    • src/features/cms/ui/public/articles/content-renderer.tsx
    • src/features/cms/shared/documents/kinds.ts

Editor validation items

Use this example as a starting point, then adapt it to your product's rules and configuration.

Validation errors are projected into stable field labels for the editor UI.

ts
export function buildValidationItems(
  fieldErrors: Record<string, string | undefined> | null,
): ValidationItem[] {
  if (!fieldErrors) return [];
  return Object.entries(fieldErrors)
    .filter(([, message]) => Boolean(message))
    .map(([key, message]) => ({
      key,
      label: labelForField(key),
      message: message ?? "",
    }));
}
Source reference
  • src/features/cms/shared/editor/validation/validation.ts

Publishing rules

  • Keep editor state, validation, rendering, and persistence separate.
  • Require valid scheduled times for scheduled posts.
  • Preview public output before publishing important content.
  • Use content-owned metadata for SEO fields.
  • Keep remote image URL upload disabled unless you intentionally add that trust boundary.