Blog Features

Overview

The Next.js 15 StarShip Developer Kit includes a powerful blog system with role-based access control and AI-powered features. This documentation will introduce you to the key features and how to use them effectively.

Access Control

The blog system implements a secure access control model:

  • Public Access - All visitors can read published blog posts
  • Admin-Only Creation - Only administrators can create, edit, or delete blog posts
  • Draft Management - Administrators can create draft posts that aren't visible to the public

This ensures content quality while maintaining security over your site's content.

Content Creation

The blog system provides a modern content creation experience:

  • Rich Text Editor - A comprehensive TipTap editor with formatting controls for professional content creation
  • Image Management - Upload, resize, and manage images with Supabase storage integration
  • Content Flexibility - Support for Markdown, MDX, and HTML content
  • Draft System - Save works in progress and publish when ready
  • Instant Publishing - Content is stored in the database, so no redeployment is needed when adding new posts

AI-Powered Assistance

The blog system includes several AI-powered features to enhance your content creation process:

  • Content Generation - Create complete blog posts from outlines or topics
  • SEO Optimization - Generate SEO-friendly titles, meta descriptions, and keywords
  • Content Enhancement - Get suggestions to improve your writing
  • Image Descriptions - Generate alt text for images to improve accessibility

These AI tools help streamline content creation while maintaining quality and engagement.

User Experience

The blog system is designed with both creators and readers in mind:

  • Responsive Design - Mobile-optimized blog reading experience
  • Fast Loading - Optimized image loading and content delivery
  • Author Attribution - Display author information and social links

Default Author Configuration

You can configure default author information for blog posts using environment variables:

NEXT_PUBLIC_DEFAULT_AUTHOR_NAME=Anonymous
NEXT_PUBLIC_DEFAULT_AUTHOR_LINK= social handle or web link

These variables will be used as fallbacks if no author is specified in the post metadata. This allows you to ensure all blog posts have consistent author attribution, even when not explicitly set.

Getting Started

To begin using the blog system:

  1. Log in as an admin - Only administrators can access the blog creation tools
  2. Navigate to the blog section - Either through the navigation menu or by visiting /blog
  3. Click "Create Post" - This option is only visible to administrators
  4. Create your content - Use the rich text editor to create your post
  5. Save as draft or publish - Decide whether to publish immediately or save as a draft

Once published, your post will be immediately available to all visitors without requiring a site redeployment.

Managing Blog Posts

As an administrator, you can manage all blog content:

  • View All Posts - See a list of all published and draft posts
  • Edit Posts - Update content, images, and metadata at any time
  • Delete Posts - Remove posts that are no longer needed
  • Publish/Unpublish - Control visibility by changing the publication status

This administrative control ensures you maintain full ownership of your content.

Blog Pages

The blog system includes several key pages:

  • /blog - Main blog listing page with all published posts
  • /blog/[slug] - Individual blog post pages
  • /blog/new - Create new blog post (admin only)
  • /blog/edit/[id] - Edit existing blog posts (admin only)

These pages provide a complete blog experience for both readers and administrators.

Setting Up AI Features

To enable the AI-powered content features, you'll need to configure your environment with an OpenAI API key:

  1. Get an OpenAI API key - Sign up at platform.openai.com and create an API key
  2. Update your environment - Add the following to your .env.local file:
    OPENAI_API_KEY=your_api_key_here NEXT_PUBLIC_OPENAI_API_KEY=your_api_key_here
  3. Restart your development server - For the changes to take effect

Once configured, you'll see AI options appear in the blog editor, including:

  • Generate content from an outline
  • Generate SEO metadata
  • Get writing improvement suggestions
  • Create image alt text

Note: Using these features will consume tokens from your OpenAI account. Be sure to monitor your usage to avoid unexpected charges.