Shipflash logoDocs

Posts And Content

Posts owns the CMS, Editor.js canvas, content 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 /blog/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

AreaPaths
Editor routessrc/app/(editor)/content/editor/[kind]/[id], preview
CMS UIsrc/features/posts/ui/cms
Public UIsrc/features/posts/ui/blog, src/features/posts/ui/legal
Serversrc/features/posts/server
Shared helperssrc/features/posts/shared/kind.ts, editor-submit.ts, cover-image.ts, share.ts, cms
Stylessrc/app/styles/post-editor.css, src/app/styles/post-content.css

Code-backed content map

CMS and editor actions

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

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

Editor canvas

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

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

Public rendering

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

  • src/features/posts/server/posts/queries/public-posts.ts
  • src/features/posts/ui/blog/content-renderer.tsx
  • src/features/posts/ui/legal/legal-document-layout.tsx
  • src/features/posts/shared/kind.ts

Content publishing flow

  1. 1

    Edit client-side canvas state

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

    • src/features/posts/ui/cms/editor.tsx
    • src/features/posts/shared/cms/canvas/state.ts
    • src/features/posts/shared/cms/validation/validation.ts
  2. 2

    Submit through server actions

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

    • src/features/posts/server/posts/actions/editor.ts
    • src/features/posts/server/posts/services/editor-upsert.ts
  3. 3

    Revalidate public routes

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

    • src/features/posts/server/posts/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.

    • src/features/posts/server/posts/queries/public-posts.ts
    • src/features/posts/ui/blog/content-renderer.tsx
    • src/features/posts/shared/kind.ts

Editor validation items

Source: src/features/posts/shared/cms/validation/validation.ts

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 ?? "",
    }));
}

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.