// SYSTEM_BLUEPRINT: V1.0_READY

Drop a Lightning-Fast Blog Into Your App in 5 Minutes.

The framework-agnostic content engine for Fastify, Next.js, and React. Seamlessly merge Markdown or Headless WordPress into your existing app with zero routing changes, automated sitemaps, and sub-millisecond caching.

[HOW_IT_WORKS ↓] [LIVE_DEMO_SANDBOX →]
🧩

Zero Host Rewrites

Your existing database models, platform routes, and controllers remain 100% in control. The plugin simply snaps content and sitemaps right into your current architecture.

⚡

Sub-Millisecond Speed

Two-tier caching (L1 in-memory LRU + persistent Redis) ensures your readers and crawlers get responses in under 0.2ms, with zero load on your CMS or database.

🔍

Automated Rich SEO

Out-of-the-box OpenGraph cards, Twitter preview tags, Schema.org Article JSON-LD, and zero-bandwidth HTTP 304 ETags that eliminate redundant cloud egress bills.

// QUICKSTART_INTEGRATION

How to Add It to Your Stack

In Fastify, register the plugin once. It decorates fastify.universalContent so your existing /sitemap.xml route can pull pre-cached XML chunks with only 2 lines of code:

src/routes/sitemap.route.ts (Host App) TypeScript
import { mergeSitemapUrlsets } from '@crispice/universal-content/seo';

// Your existing sitemap route remains the boss:
fastify.get('/sitemap.xml', async (request, reply) => {
  // 1. Get your existing products/items as usual
  const products = await fastify.db.product.findMany();
  const baseXml = buildSitemapXml(products, 'murageh.co.ke');

  // 2. Fetch pre-cached blog XML chunk from plugin (< 0.05ms)
  const blogChunk = await fastify.universalContent.getSitemapXmlChunk({
    baseUrl: 'https://murageh.co.ke',
  });

  // 3. High-speed, non-destructive splice right before </urlset>
  const finalXml = mergeSitemapUrlsets(baseXml, blogChunk);

  return reply.type('application/xml').send(finalXml);
});

In Next.js App Router, use React Server Components and on-demand ISR revalidation tags:

app/blog/[slug]/page.tsx (Server Component) TypeScript / TSX
import { getNextDocBySlug } from '@crispice/universal-content/next';
import { notFound } from 'next/navigation';

export default async function BlogPostPage({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = await params;
  
  // Fetches from local Markdown or Headless WordPress
  const post = await getNextDocBySlug({ contentDir: './content' }, 'blog', slug);
  if (!post) notFound();

  return (
    <article className="prose max-w-3xl mx-auto py-12">
      <h1>{post.title}</h1>
      <div dangerouslySetInnerHTML={{ __html: post.contentHtml }} />
    </article>
  );
}

In Vite applications, import virtual modules directly in memory with instant sub-10ms HMR:

src/App.tsx TypeScript / JSX
// Dynamic virtual content generated in RAM by Vite compiler
import posts from 'virtual:content/blog';

export function BlogList() {
  return (
    <div className="grid gap-4">
      {posts.map((post) => (
        <a key={post.slug} href={"/blog/" + post.slug} className="card">
          <h2>{post.title}</h2>
          <p>{post.excerpt}</p>
        </a>
      ))}
    </div>
  );
}

// INTERACTIVE_LIVE_SANDBOX

Test the Merged Engine in Real Time

This sandbox demonstrates a real Fastify v5 server running live. Watch how host application platform pages and database catalog items merge seamlessly with universal markdown blog posts:

Combined Sitemap (/sitemap.xml) READY

Googlebot crawls this endpoint. Watch response times drop from 25ms down to 0.2ms:

--
Response Time
--
Total URLs
100%
Cache Rate
0
304 Saves
Platform Pages
Database Products
Markdown Blog
Merged XML Output (/sitemap.xml) XML 0.9
Click "Fetch (Crawler Hit)" to inspect the merged sitemap XML...

Social Previews & Schema RICH RESULTS

Select any database product or blog post to inspect its WhatsApp preview card and Google structured data:

Loading preview...
playground.murageh.co.ke
Loading title...
Loading description...
Structured Data (Google Rich Results) JSON-LD
{ "loading": true }