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.
src/features/blog
api
components
hooks
repositories
schemas
types
utilsUse 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.
/blog
/blog/my-post-slugServer 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.
GET /api/blog
POST /api/blog
GET /api/blog/:postId
PATCH /api/blog/:postId
DELETE /api/blog/:postId
POST /api/blog/upload-coverClient 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.tsxfor the public blog index.src/features/blog/components/blog-post-page.tsxfor the public post page.src/features/blog/components/blog-post-form.tsxfor the create and edit form.src/features/blog/components/blog-content-editor.tsxfor the editor surface.src/features/blog/repositories/blog-posts.repository.tsfor database queries.src/features/blog/schemas/create-blog-post.schema.tsfor create validation.src/features/blog/schemas/update-blog-post.schema.tsfor update validation.src/features/blog/utils/blog-post-seo.tsfor canonical URLs and image URLs.src/features/blog/utils/blog-content-sanitize.server.tsfor allowed HTML tags and attributes.src/app/rss.xml/route.tsfor RSS output.src/app/sitemap.tsfor sitemap entries.