Files
insertr/RELEASE_PLAN.md
Joakim 448b66a974 Fix critical enhancement hanging bug caused by nil context in content injection
Replace nil context with context.Background() in content.go to prevent database operations from hanging indefinitely. Clean up outdated documentation files and add current project structure analysis.
2025-10-26 21:26:48 +01:00

18 KiB

Insertr Release Plan & Feature Roadmap

Last Updated: October 26, 2025
Status: Consolidated from all project documentation
Purpose: Unified release planning to replace haphazard development approach


Current State Assessment

Implemented & Working

Core Architecture

  • Unified Go binary (serve + enhance commands)
  • Multi-database support (SQLite dev, PostgreSQL prod)
  • HTML-first content processing engine
  • Container expansion with syntactic sugar (class="insertr" on containers)
  • Style detection and preservation system
  • Version control with complete edit history
  • Build-time content enhancement

Authentication System

  • Mock authentication for development
  • Authentik OIDC integration for production
  • JWT-based session management
  • Secure cookie handling

Frontend Library

  • Zero-dependency JavaScript library (222KB built)
  • Style-aware editor with automatic CSS detection
  • HTML preservation engine
  • API client with authentication integration
  • Control panel UI
  • Form-based editing interfaces

Content Management

  • Full REST API for content operations
  • Content versioning and rollback
  • Multi-site content management
  • Real-time content injection during development

Class System

  • .insertr - Basic element editing
  • .insertr-gate - Authentication triggers
  • .insertr-add - Dynamic content collections
  • Container expansion intelligence

Developer Experience

  • Hot reload development workflow
  • Multiple demo sites for testing
  • Just/npm script integration
  • Comprehensive configuration system

🟡 Partially Implemented

Content Types

  • 🟡 .insertr-content - Planned but not fully implemented
  • 🟡 Rich text editing - Basic implementation, needs enhancement
  • 🟡 Media management - No implementation
  • 🟡 SEO metadata - No implementation

Publishing Workflow

  • 🟡 Draft/publish system - Fully designed in DRAFT_PUBLISH_FEATURE.md but not implemented
  • 🟡 Content approval workflows - Not implemented
  • 🟡 Scheduled publishing - Not implemented

Error Handling & UX

  • 🟡 Error states and feedback - Basic implementation
  • 🟡 Offline handling - Not implemented
  • 🟡 Loading indicators - Basic implementation
  • 🟡 Auto-save - Not implemented

Missing for v1.0

Critical Gaps

  • Comprehensive testing (no test files found)
  • Production deployment guides
  • Performance benchmarking
  • Error logging and monitoring
  • CDN hosting setup for library assets

User Experience Gaps

  • Media upload and management
  • SEO optimization tools
  • Content search and filtering
  • Bulk content operations

Enterprise Features

  • Role-based permissions
  • Multi-user collaboration
  • Audit trails
  • Performance monitoring

Version 1.0 Release Plan

Target Release Date: January 31, 2026 (3 months)

v1.0 Success Criteria

Primary Goal: Production-ready CMS that delivers on "The Tailwind of CMS" promise with zero-config HTML-first editing.

Must-Have Features:

  1. Zero Configuration: Add class="insertr" to any element and get editing
  2. Perfect HTML Preservation: Maintain all CSS styling and attributes
  3. Production Authentication: Secure OIDC integration for real deployments
  4. Version Control: Complete edit history with rollback capabilities
  5. ⚠️ Reliable Publishing: Draft/publish workflow for production content management
  6. ⚠️ Essential Testing: Comprehensive test coverage for reliability
  7. ⚠️ Production Deployment: Clear guides for real-world deployments

Quality Gates:

  • 🎯 90%+ Test Coverage across core functionality
  • 🎯 Production Deployment examples for 3+ hosting platforms
  • 🎯 Performance Benchmarks meeting static site standards
  • 🎯 Security Audit completed for authentication and content handling
  • 🎯 Documentation Complete for all core features

v1.0 Feature Implementation Plan

Phase 1: Foundation & Quality (4-6 weeks)

Priority: CRITICAL - Must complete before adding new features

1.1 Comprehensive Testing Framework

# Target test structure
tests/
├── unit/
│   ├── frontend/          # JavaScript unit tests
│   │   ├── core/              # Business logic tests
│   │   ├── ui/                # Component tests
│   │   └── utils/             # Utility function tests
│   └── backend/           # Go unit tests
│       ├── api/               # HTTP handler tests
│       ├── auth/              # Authentication tests
│       ├── db/                # Database tests
│       └── engine/            # Content processing tests
├── integration/
│   ├── api_test.go        # Full API integration tests
│   ├── auth_test.go       # Authentication flow tests
│   └── enhancement_test.go    # Build pipeline tests
└── e2e/
    ├── editing_workflow/  # End-to-end editing tests
    ├── publishing_flow/   # Draft/publish workflow tests
    └── authentication/    # Auth integration tests

Implementation Tasks:

  • JavaScript Testing: Jest + Testing Library setup
  • Go Testing: Unit tests for all packages with testify
  • API Integration Tests: Full HTTP API test suite
  • E2E Testing: Playwright tests for editing workflows
  • Performance Tests: Benchmark suite for enhancement pipeline
  • CI/CD Integration: GitHub Actions with test automation

Success Criteria:

  • 90%+ code coverage across frontend and backend
  • All core user workflows covered by E2E tests
  • Performance benchmarks established and monitored
  • CI/CD pipeline blocks releases on test failures

1.2 Error Handling & Monitoring

// Target error handling structure
type InsertrError struct {
    Code      string    `json:"code"`
    Message   string    `json:"message"`
    Details   any       `json:"details,omitempty"`
    UserMsg   string    `json:"user_message"`
    Timestamp time.Time `json:"timestamp"`
    RequestID string    `json:"request_id"`
}

type Logger interface {
    Info(msg string, fields ...any)
    Warn(msg string, fields ...any)
    Error(msg string, err error, fields ...any)
}

Implementation Tasks:

  • Structured Logging: JSON logging with levels and context
  • Error Types: Standardized error codes and user messages
  • Request Tracing: Request ID tracking through system
  • Health Checks: Comprehensive health monitoring endpoints
  • Metrics Collection: Prometheus-compatible metrics
  • Frontend Error Handling: User-friendly error states and recovery

1.3 Performance Optimization

Implementation Tasks:

  • Frontend Bundle Optimization: Code splitting and lazy loading
  • Database Query Optimization: Indexes and query performance
  • Caching Layer: Multi-tier caching for content and assets
  • Content Enhancement Performance: Optimize HTML processing pipeline
  • Memory Management: Proper cleanup and resource management

Phase 2: Draft/Publish System (3-4 weeks)

Priority: HIGH - Essential for production content management

Based on comprehensive design in DRAFT_PUBLISH_FEATURE.md:

2.1 Database Schema Implementation

-- Add state tracking to content_versions table
ALTER TABLE content_versions ADD COLUMN state TEXT DEFAULT 'history' NOT NULL 
CHECK (state IN ('history', 'draft', 'live'));

-- Create indexes for efficient state-based queries
CREATE INDEX idx_content_versions_state ON content_versions(content_id, site_id, state);
CREATE UNIQUE INDEX idx_content_versions_unique_draft 
ON content_versions(content_id, site_id) WHERE state = 'draft';
CREATE UNIQUE INDEX idx_content_versions_unique_live 
ON content_versions(content_id, site_id) WHERE state = 'live';

2.2 API Implementation

New Endpoints:

  • GET /api/content/{id}?state=draft|live|history
  • POST /api/content/{id}/save-draft
  • POST /api/content/{id}/publish
  • POST /api/content/{id}/rollback/{version_id}
  • GET /api/content/{id}/diff
  • POST /api/enhancement/preview
  • GET /api/status/changes

2.3 Frontend Implementation

UI Components:

  • Draft/Publish Controls: Replace "Enhance" with "Save Draft"/"Publish"
  • State Indicators: Visual indicators for draft vs published content
  • Publishing Dashboard: Overview of unpublished changes
  • Diff Viewer: Compare draft vs published content
  • Auto-save: LocalStorage drafts with conflict resolution

Phase 3: Essential Features (4-5 weeks)

Priority: HIGH - Core features expected in modern CMS

3.1 Media Management System

// Media handling architecture
type MediaAsset struct {
    ID          string            `json:"id"`
    SiteID      string            `json:"site_id"`
    Filename    string            `json:"filename"`
    ContentType string            `json:"content_type"`
    Size        int64             `json:"size"`
    URL         string            `json:"url"`
    Metadata    map[string]string `json:"metadata"`
    CreatedAt   time.Time         `json:"created_at"`
    CreatedBy   string            `json:"created_by"`
}

Implementation Tasks:

  • File Upload API: Multipart upload with validation
  • Image Optimization: Automatic resizing and format conversion
  • CDN Integration: Asset hosting and delivery optimization
  • Media Browser: Frontend file management interface
  • Image Editor Integration: Basic crop/resize functionality

3.2 SEO & Metadata Management

// SEO interface structure
class SEOManager {
    generateMetaTags(content) {
        // Auto-generate meta descriptions
        // Open Graph optimization
        // Twitter Card generation
    }
    
    analyzeContent(html) {
        // Heading structure validation
        // Readability scoring
        // SEO recommendations
    }
}

Implementation Tasks:

  • Meta Field Management: Title, description, keywords
  • Open Graph Tags: Social media optimization
  • Structured Data: JSON-LD schema generation
  • Content Analysis: SEO recommendations and scoring
  • Sitemap Generation: Automatic XML sitemap creation

3.3 Enhanced Content Types

Complete .insertr-content Implementation:

  • Rich Text Editor: Enhanced editing with formatting toolbar
  • Block Management: Drag-and-drop content blocks
  • Style Detection: Advanced CSS style preservation
  • Content Structure: Heading hierarchy validation
  • Markdown Support: Optional markdown shortcuts

Phase 4: Production Readiness (2-3 weeks)

Priority: CRITICAL - Must complete for v1.0 release

4.1 Deployment & Documentation

Implementation Tasks:

  • Production Deployment Guides: Netlify, Vercel, CloudFlare Pages
  • CDN Setup: Library hosting and version management
  • Docker Images: Containerized deployment options
  • Database Migrations: Schema versioning and update scripts
  • Security Documentation: Authentication setup and best practices

4.2 Developer Experience

Implementation Tasks:

  • CLI Enhancements: Project scaffolding and migration tools
  • Integration Examples: Hugo, Jekyll, Next.js, Gatsby
  • VS Code Extension: Syntax highlighting and tooling
  • Development Tools: Debug mode and diagnostic utilities
  • Performance Profiling: Development optimization tools

4.3 Quality Assurance

Implementation Tasks:

  • Security Audit: Authentication and content handling review
  • Performance Benchmarking: Compare against competing solutions
  • Accessibility Audit: WCAG compliance for editor interfaces
  • Browser Compatibility: Cross-browser testing and support
  • Load Testing: Multi-site performance under load

v1.0 Feature Checklist

Core Functionality

  • .insertr class editing with style preservation
  • .insertr-gate authentication integration
  • .insertr-add dynamic content collections
  • ⚠️ .insertr-content rich text editing (needs enhancement)
  • ⚠️ Version control with rollback (needs UI polish)
  • Draft/publish workflow
  • Media upload and management
  • SEO metadata management

Authentication & Security

  • Mock authentication for development
  • Authentik OIDC for production
  • JWT session management
  • Role-based permissions (v2.0)
  • Security audit completion

API & Backend

  • Full REST API for content operations
  • Multi-database support (SQLite/PostgreSQL)
  • Content versioning system
  • Draft/publish endpoints
  • Media upload endpoints
  • Performance monitoring

Frontend & UI

  • Zero-dependency JavaScript library
  • Style-aware editor
  • Control panel interface
  • Draft/publish UI controls
  • Media browser interface
  • Error states and loading indicators
  • Auto-save functionality

Developer Experience

  • Hot reload development workflow
  • Multi-site demo environment
  • Configuration management
  • Comprehensive testing framework
  • Production deployment guides
  • CLI enhancement tools
  • Integration examples

Quality & Performance

  • 90%+ test coverage
  • Performance benchmarks
  • Error handling and monitoring
  • CDN integration for assets
  • Browser compatibility testing

Post-v1.0 Roadmap

Version 1.1 (Q2 2026) - Enhanced UX

Focus: User experience improvements and missing convenience features

Key Features:

  • Real-time Collaboration: Multi-user editing with conflict resolution
  • Advanced Media Management: Image editing, gallery management
  • Content Templates: Reusable content blocks and page templates
  • Enhanced SEO Tools: Advanced analytics and optimization
  • Mobile Editing: Responsive editor interfaces

Version 1.5 (Q3 2026) - Enterprise Features

Focus: Enterprise adoption and advanced workflows

Key Features:

  • Role-based Permissions: Granular access control
  • Approval Workflows: Multi-step content approval processes
  • Audit Trails: Comprehensive activity logging
  • API Analytics: Usage monitoring and optimization
  • White-label Solutions: Agency and reseller capabilities

Version 2.0 (Q4 2026) - Platform Evolution

Focus: Platform expansion and ecosystem development

Key Features:

  • Plugin Architecture: Third-party extensions and integrations
  • Visual Page Builder: Drag-and-drop page construction
  • AI Content Assistance: Smart suggestions and optimization
  • E-commerce Integration: Product management and shopping carts
  • Advanced Analytics: Content performance and user engagement

Version 2.5 (Q1 2027) - Next-Generation CMS

Focus: Innovation and market leadership

Key Features:

  • Edge Computing: Content personalization at edge locations
  • Advanced AI: Content generation and automated optimization
  • Cross-platform Publishing: Multi-channel content distribution
  • Advanced Performance: Sub-second global content delivery
  • Developer Ecosystem: Marketplace and community platform

Implementation Strategy

Development Approach

  1. Quality First: Comprehensive testing before new features
  2. User-Centric: Focus on real-world use cases and pain points
  3. Performance Obsessed: Maintain zero runtime overhead advantage
  4. Documentation Driven: Complete docs for every feature
  5. Community Building: Open development with transparent roadmap

Release Schedule

  • Monthly Releases: Regular feature additions and improvements
  • Security Patches: Immediate response to security issues
  • LTS Versions: Long-term support for major releases
  • Beta Releases: Early access for testing and feedback

Success Metrics

  • Adoption: 1000+ production deployments by end of 2026
  • Performance: Sub-2-second editor load times maintained
  • Community: 100+ contributors and 5000+ GitHub stars
  • Enterprise: 50+ enterprise customers with dedicated support
  • Ecosystem: 20+ community plugins and integrations

Risk Mitigation

Technical Risks

  1. Performance Degradation: Continuous benchmarking and optimization
  2. Security Vulnerabilities: Regular audits and penetration testing
  3. Browser Compatibility: Automated cross-browser testing
  4. Scalability Issues: Load testing and performance monitoring

Market Risks

  1. Competition: Focus on unique value proposition and innovation
  2. Adoption Barriers: Comprehensive documentation and examples
  3. Enterprise Requirements: Flexible architecture for custom needs
  4. Technology Evolution: Modular design for easy adaptation

Operational Risks

  1. Team Scaling: Clear development processes and documentation
  2. Community Management: Dedicated community engagement resources
  3. Support Load: Self-service documentation and automation
  4. Infrastructure Costs: Efficient resource usage and optimization

Conclusion

This release plan consolidates all existing documentation into a concrete, actionable roadmap for v1.0. The focus is on completing the production-ready foundation with essential features before expanding into advanced capabilities.

Key Principles:

  • Quality over quantity: Better to ship fewer features that work perfectly
  • User-focused development: Real-world use cases drive feature priorities
  • Performance first: Maintain the core advantage of zero runtime overhead
  • Documentation complete: Every feature fully documented and tested

The goal is to transition from the current haphazard development approach to a structured, milestone-driven process that delivers a genuinely production-ready CMS that fulfills the "Tailwind of CMS" vision.


Next Steps:

  1. Review and approve this consolidated plan
  2. Begin Phase 1 implementation (Testing & Quality)
  3. Establish weekly progress reviews and milestone tracking
  4. Set up project management tools for feature tracking
  5. Begin community engagement and early user feedback collection

This document supersedes all previous roadmap documents and serves as the single source of truth for Insertr development planning.