Spacerr
  • Features
  • Pricing
  • FAQ
  • Docs
Get Access
Spacerr
  • Introduction
  • Features
  • Tech Stack
  • Setup
  • Configuration
  • Agents
  • Database
  • Jobs
  • Admin
  • Settings
  • Billing
  • Storage
  • Email
  • Support
  • Localization
    • Overview
    • Publishing
    • Blog SEO
  • SEO
  • Analytics
  • UI And Navigation
  • Deploying To Production
  • Testing And QA
  • Troubleshooting

Search documentation

Search documentation pages.

Documentation/Blog

Blog

Spacerr includes a database backed blog, not a folder of static markdown files. Posts are rendered through public blog routes, edited through protected admin screens, and connected to SEO, RSS, sitemap, and structured data.

What It Includes

The blog surface includes:

  • Public blog index pages.
  • Public blog post pages.
  • Admin and moderator publishing access.
  • Create, edit, and delete flows.
  • Cover image uploads through Vercel Blob.
  • Sanitized rich HTML content.
  • SEO title, description, keywords, canonical URLs, Open Graph, Twitter cards, and JSON LD.
  • RSS feed generation.
  • Sitemap entries for blog index pages and every post.
  • Related post suggestions on the post page.

Feature Layout

Most blog code lives under src/features/blog.

txt
src/features/blog
  api
  components
  hooks
  repositories
  schemas
  types
  utils

Use components for the public and editor UI, hooks for create and update mutations, repositories for blog data access, schemas for request validation, and utils for content sanitizing, HTML rendering, metadata, and blog specific errors.

Data Storage

Blog posts are stored in the database and loaded through the blog repository. The Database section covers the exact model and database workflow.

Public Routes

Blog pages are served from the public content routes.

txt
/blog
/blog/my-post-slug

Server Data

Blog reads and writes go through src/features/blog/repositories/blog-posts.repository.ts. The blog index reads preview data, and the post page reads the full post by slug.

API Routes

Blog API routes are centralized in ApiRoutes and implemented under src/app/api/blog.

txt
GET    /api/blog
POST   /api/blog
GET    /api/blog/:postId
PATCH  /api/blog/:postId
DELETE /api/blog/:postId
POST   /api/blog/upload-cover

Client requests go through src/features/blog/api/blog-posts.api.ts, so the UI does not duplicate endpoint strings.

Where To Customize

Use these files first:

  • src/features/blog/components/blog-index-page.tsx for the public blog index.
  • src/features/blog/components/blog-post-page.tsx for the public post page.
  • src/features/blog/components/blog-post-form.tsx for the create and edit form.
  • src/features/blog/components/blog-content-editor.tsx for the editor surface.
  • src/features/blog/repositories/blog-posts.repository.ts for database queries.
  • src/features/blog/schemas/create-blog-post.schema.ts for create validation.
  • src/features/blog/schemas/update-blog-post.schema.ts for update validation.
  • src/features/blog/utils/blog-post-seo.ts for canonical URLs and image URLs.
  • src/features/blog/utils/blog-content-sanitize.server.ts for allowed HTML tags and attributes.
  • src/app/rss.xml/route.ts for RSS output.
  • src/app/sitemap.ts for sitemap entries.
Localization

Learn how localized routes, message files, language switching, and locale aware helpers work.

Blog Publishing

Learn how blog publishing works in Spacerr.

On this page
What It IncludesFeature LayoutData StoragePublic RoutesServer DataAPI RoutesWhere To Customize