• ShipSaaSDocumentation
  • Introduction
  • Getting Started
    • Installation
    • Environment Setup
    • Database Setup
    • Development Guide
  • Database
    • Repository Pattern
    • Drizzle Queries
    • Migration Workflow
    • Drizzle Studio
    • Best Practices
  • File Management
    • File Upload Component
    • Server Actions
    • Storage Configuration
  • Authentication Methods
    • Credentials Authentication
    • Magic Link Authentication
    • Two-Factor Authentication (2FA)
    • Social Authentication
    • API Keys & Bearer Tokens
    • Organizations (Multi-tenant)
  • Authorization & Permissions
    • Roles & Hierarchy
    • Route Protection
    • API Protection
    • CASL Permissions
  • Email & Notifications
    • Resend Setup
    • React Email Templates
    • Notification System
    • Email Workflows
    • Customization & Extension
  • Stripe & Payments
    • Stripe Setup
    • Better Auth Integration
    • Checkout Methods
    • Subscription Management
    • Admin Dashboard
    • Webhook Events
  • Architecture & Development
    • Presentation Layer
    • Service Layer
    • Persistence Layer
    • Helpers Architecture
    • Project Structure
    • Development Workflow
  • Testing
    • General Testing
    • Unit Testing
    • UI Component Testing
    • Repository Testing
    • Service Testing
    • End-to-End Testing
  • Deployment
    • Vercel Deployment
    • GitHub Actions CI/CD
    • Database Backup & Restore
    • Database Migrations
    • Troubleshooting Deployment
  • AI Agents Integration
  • Blog Management
    • Blog Setup
    • MDX Blog
    • Database Blog
  • Async Tasks
    • Setup
    • Email Workflows
    • Payment Processing
    • Maintenance Jobs
  1. Documentation
  2. Blog Management
  3. Database Blog
Buydocschangelogsdemocommunity

Database Blog

PreviousMDX BlogNextAsync Tasks
On this page
Admin DashboardDashboard FeaturesCreating Blog PostsMulti-Language SupportLanguage ManagementTranslation WorkflowContent Management FeaturesPublishing WorkflowContent OrganizationAnalytics and InsightsContent AnalyticsPerformance TrackingDatabase SchemaCore TablesBlog Routes

Manage dynamic blog content through the admin dashboard with full internationalization support.

Dynamic Content Management: The database blog system provides a complete admin interface for content teams to create, edit, and manage blog posts with multi-language support.

Admin Dashboard

Access the blog admin dashboard at /admin/blog with proper permissions.

Blog Admin Dashboard:

Blog admin dashboard with post management

Dashboard Features

Content Management

  • • Create and edit posts
  • • Markdown editor with preview
  • • Image upload and management
  • • SEO metadata editor
  • • Publishing workflow

Markdown Editor Interface:

Blog markdown editor with preview

Organization

  • • Category management
  • • Hashtag system
  • • Content filtering and search
  • • Bulk operations
  • • Analytics dashboard

Categories and Status Management:

Blog categories and status management

Creating Blog Posts

1

Access Admin Dashboard

  1. Login to your application
  2. Navigate to /admin/blog
  3. Click "New Post" button

Requires ADMIN or REDACTOR role permissions to create posts.

2

Fill Post Information

Basic Information:

  • Title: Post title (required)
  • Slug: URL-friendly identifier (auto-generated)
  • Description: Meta description for SEO
  • Category: Select or create content category
  • Status: Draft or Published

Content:

  • Markdown Editor: Write your content with live preview
  • Image Upload: Add images directly in the editor
  • Formatting: Full markdown support with toolbar

SEO Configuration:

Blog SEO configuration interface
3

Add Taxonomy

Categories:

  • Select existing category or create new
  • Used for content organization
  • Affects navigation and filtering

Hashtags:

  • Add relevant tags for discoverability
  • Auto-complete from existing tags
  • Used for content search and related posts
4

Save and Publish

Draft Mode:

  • Save as draft for review
  • Preview content before publishing
  • Share draft links with team

Publishing:

  • Set publishing date (immediate or scheduled)
  • Change status to "Published"
  • Content goes live automatically

Multi-Language Support

The database blog includes comprehensive internationalization features:

Language Management

1

Supported Languages

Configure supported languages in your application:

The blog system supports multiple languages including English, French, and Spanish.

Multi-language Blog Management:

Multi-language blog management interface
2

Create Translations

In Admin Dashboard:

  1. Create Base Post in your primary language
  2. Click "Add Translation" button
  3. Select Target Language from dropdown
  4. Fill Translation Content:
    • Translated title
    • Localized slug
    • Translated description
    • Translated content
3

Language-Specific Content

Each translation includes translated title, slug, description, and content.

Example URLs:

  • English: /en/blog/getting-started-nextjs
  • French: /fr/blog/commencer-avec-nextjs
  • Spanish: /es/blog/empezar-con-nextjs

Translation Workflow

1

Content Creation Process

  1. Create Master Post in primary language
  2. Save as Draft for review
  3. Add Translations for each target language
  4. Review All Languages before publishing
  5. Publish Simultaneously or per language
2

Translation Status

Admin Dashboard shows:

  • Languages available for each post
  • Translation completeness status
  • Last modified dates per language
  • Missing translation indicators
3

Language Fallbacks

Automatic Fallback Logic:

  • If translation missing, show primary language
  • Fallback chain: requested → default → available
  • SEO hreflang tags for language variants
  • Language switcher shows available translations

Content Management Features

Publishing Workflow

Draft Management:

  • Save work in progress as drafts
  • Preview drafts with special URLs
  • Share drafts with team for review
  • Track revision history
typescript
// Post status management
enum PostStatus {
  DRAFT = 'DRAFT',
  PUBLISHED = 'PUBLISHED',
  ARCHIVED = 'ARCHIVED'
}

Publishing Options:

  • Immediate publishing upon status change
  • Scheduled publishing for future dates
  • Bulk publishing operations

Access Control:

typescript
// Blog permissions by role
const permissions = {
  'blog-post:create': ['ADMIN', 'REDACTOR'],
  'blog-post:read': ['ADMIN', 'REDACTOR', 'MODERATOR'],
  'blog-post:update': ['ADMIN', 'REDACTOR'],
  'blog-post:delete': ['ADMIN'],
  'blog-post:publish': ['ADMIN', 'REDACTOR']
}

Role Capabilities:

  • ADMIN: Full access, can delete and manage users
  • REDACTOR: Create, edit, publish content
  • MODERATOR: View and comment on content

Content Organization

1

Categories

Category Management:

  • Create hierarchical categories
  • Assign colors and icons
  • SEO-friendly category pages
  • Category-based navigation
2

Hashtag System

Tag Features:

  • Auto-complete from existing tags
  • Tag popularity and usage stats
  • Tag-based content discovery
  • Tag cloud visualization
3

Content Filtering

Admin Filters:

  • Filter by status (draft, published)
  • Filter by category
  • Filter by author
  • Filter by date range
  • Search in title and content
  • Language-specific filtering
4

File Management

Media Management:

  • Upload images directly in editor
  • Organize media files
  • Image optimization
  • File browser with preview

File Management Interface:

Blog file management interface

Analytics and Insights

Content Analytics

Post Metrics

  • • Page views per post
  • • Reading time analytics
  • • Social shares tracking
  • • Comment engagement
  • • Language performance

Content Insights

  • • Popular categories
  • • Top performing tags
  • • Author performance
  • • Content freshness
  • • SEO performance

Performance Tracking

The blog system tracks basic analytics like page views and engagement metrics for each post.

Frontend Blog Detail Page:

Frontend blog post detail page

Database Schema

Core Tables

sql
CREATE TABLE post (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  status post_status NOT NULL DEFAULT 'DRAFT',
  nb_view INTEGER DEFAULT 0,
  nb_like INTEGER DEFAULT 0,
  category_id UUID REFERENCES category(id),
  author_id UUID REFERENCES users(id),
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW(),
  published_at TIMESTAMP
);
sql
CREATE TABLE post_translation (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  post_id UUID REFERENCES post(id) ON DELETE CASCADE,
  language supported_language NOT NULL,
  title VARCHAR(255) NOT NULL,
  slug VARCHAR(255) NOT NULL,
  description TEXT,
  content TEXT NOT NULL,
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW(),

  UNIQUE(post_id, language),
  UNIQUE(slug, language)
);
sql
-- Categories
CREATE TABLE category (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name VARCHAR(100) NOT NULL UNIQUE,
  slug VARCHAR(100) NOT NULL UNIQUE,
  description TEXT,
  color VARCHAR(7), -- Hex color
  created_at TIMESTAMP DEFAULT NOW()
);

-- Hashtags
CREATE TABLE hashtag (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name VARCHAR(50) NOT NULL UNIQUE,
  created_at TIMESTAMP DEFAULT NOW()
);

-- Post-Hashtag Junction
CREATE TABLE post_hashtag (
  post_id UUID REFERENCES post(id) ON DELETE CASCADE,
  hashtag_id UUID REFERENCES hashtag(id) ON DELETE CASCADE,
  PRIMARY KEY (post_id, hashtag_id)
);

Blog Routes

The database blog is available at the following routes:

  • Public Blog: /blog - View published posts
  • Admin Dashboard: /admin/blog - Create and manage posts (requires admin access)
  • Individual Posts: /blog/[slug] - View specific post by slug

Database Blog Ready! Your dynamic blog system is fully configured with multi-language support, admin dashboard, and comprehensive content management features. Access /admin/blog to start creating content.