Product Name: Blog Torch
Version: 0.1.0
Last Updated: February 18, 2026
Document Type: Product Specification
Blog Torch is a premium developer-focused blogging platform that combines technical writing, code presentation, and storytelling into a unified, notebook-style experience. It bridges the gap between traditional blogging platforms and interactive developer notebooks, making it ideal for showcasing ML experiments, technical tutorials, project narratives, and developer portfolios.
"Where Code Meets Storytelling" - Blog Torch empowers developers to share their technical work through narrative-driven posts that seamlessly integrate code, outputs, visualizations, and prose.
- Software developers and engineers
- Machine learning practitioners and researchers
- Data scientists
- Technical writers and educators
- DevOps engineers
- Open source contributors
- Anyone documenting technical projects or experiments
- Block-based architecture - Flexible content composition with multiple block types
- Notebook-style presentation - Familiar to developers, combines code + outputs
- Developer-first UX - Syntax highlighting, code blocks, markdown support
- Social features - Built-in community engagement through likes, comments, follows
- Modern tech stack - Next.js 16, React 19, TypeScript, MongoDB, Clerk authentication
- Provider: Clerk authentication
- Sign-up/Sign-in: Secure authentication flows with social providers
- Webhook Integration: Real-time user synchronization via Clerk webhooks
- Session Management: Persistent authentication across the platform
Each user profile includes:
-
Basic Information:
- Unique username
- Display name
- Profile image
- Bio/description
- Location
-
Social Links:
- Personal website URL
- GitHub profile
- Twitter/X profile
-
User Role System:
USER- Standard user with posting and interaction capabilitiesADMIN- Administrative privileges
-
Profile Statistics:
- Number of posts
- Followers count
- Following count
- Total likes received
The editor is the heart of Blog Torch, featuring:
- Drag-and-drop reordering - Intuitive block organization using
@dnd-kit - Real-time preview - See content as you write
- Auto-save to drafts - Prevent content loss
- Responsive design - Works seamlessly on desktop and mobile
MARKDOWN Block
- Rich text formatting using Markdown syntax
- Support for GitHub Flavored Markdown (GFM)
- Typography optimized for technical writing
- Inline code, links, lists, tables, blockquotes
- Rendered with
react-markdownandremark-gfm
CODE Block
- Syntax highlighting powered by Shiki
- Multi-language support (JavaScript, Python, TypeScript, etc.)
- Line numbers
- Copy-to-clipboard functionality
- Theme-aware (adapts to light/dark mode)
- Language detection and display
- Configurable through
rehype-pretty-code
OUTPUT Block
- Display code execution results
- Multiple MIME type support:
- Plain text output
- Image output (PNG, JPEG, SVG)
- Base64 encoded data
- Styled output containers
- Useful for showing terminal outputs, logs, results
IMAGE Block
- Upload and display images
- Image URL support
- Alt text for accessibility
- Optional captions
- Lazy loading for performance
- Responsive image sizing
EMBED Block
- Embed external content
- YouTube video embeds
- Generic URL embeds
- Responsive iframe containers
- Security: referrer policies and sandboxing
DIVIDER Block
- Visual section separators
- Improve content readability
- Customizable styling
CALLOUT Block
- Highlighted information boxes
- Draw attention to important notes
- Support for different callout types (info, warning, tip, etc.)
- Save Draft - Save work-in-progress without publishing
- Publish Post - Make content publicly visible
- Update Published Post - Edit and republish
- Delete Blocks - Remove individual content blocks
- Add Blocks - Insert new blocks at any position
- Reorder Blocks - Drag and drop to rearrange content
- Title - Post headline (required)
- Excerpt - Brief summary for cards and previews
- Cover Image - Featured image URL
- Tags - Categorization and discovery
- Primary Languages - Array of programming languages featured
- Slug - Unique URL identifier (auto-generated or custom)
- Source - Track content origin (
EDITORorIPYNB_IMPORT)
- Hero Section - Branded introduction with CTAs
- Latest Posts Grid - Display 9 most recent published posts
- Post Cards - Include:
- Title
- Excerpt
- Author information
- Tags (first 3)
- Like count
- View count
- "Read" button
- Search Functionality - Search posts by title, content, tags
- Filter Options (planned):
- By tags
- By programming languages
- By popularity (likes, views)
- By recency
- Grid Layout - Responsive 3-column grid (desktop)
- Pagination - Load more posts dynamically
- Clean Reading Experience - Typography optimized for technical content
- Sequential Block Rendering - Content flows naturally
- Syntax Highlighting - Code blocks with proper highlighting
- Social Interactions - Like, comment, bookmark buttons
- Author Card - Quick access to author profile
- Related Posts (planned) - Discover similar content
- View Tracking - Increment view count on page load
- Share Functionality (planned) - Social media sharing
Likes
- One-click appreciation for posts
- Like counter on posts
- Aggregated like counts
- User can like each post once
- Remove like (unlike)
Comments
- Threaded comment system
- Parent-child comment relationships
- Display comment threads under posts
- Edit and delete own comments
- Comment count displayed on posts
- Real-time comment updates
Bookmarks
- Save posts for later reading
- Personal bookmark collection
- Quick access to saved posts
- Bookmark/unbookmark toggle
- Follow other users
- View follower/following lists
- Activity feed from followed users (planned)
- Follower notifications (planned)
- Tag Model - Unique tags with name and slug
- Post-Tag Relationship - Many-to-many association
- Tag Display - Badges on post cards
- Tag-based Discovery - Filter posts by tags
- Tag Creation - Automatic or manual tag creation
- Tag Analytics (planned) - Popular tags, trending topics
- Primary Languages - Array field on posts
- Language Badges - Display featured programming languages
- Language Filtering - Discover posts by language
Each post tracks:
- View Count - Total page views
- Like Count - Total likes received
- Comment Count - Total comments and replies
- Timestamp Data:
- Created at
- Updated at
- Published at
- Component Library - Built with Radix UI primitives
- Styling - Tailwind CSS (v4) with custom configuration
- Typography -
@tailwindcss/typographyfor article styling - Icons - Lucide React icon library
- Animations - Framer Motion for smooth transitions
- Light/Dark Mode - System-aware theme switching
- Theme Toggle - Manual theme override
- Persistent Preference - Theme saved to user preferences
- Provider -
next-themesintegration
-
Navbar - Persistent navigation with:
- Logo/brand
- Navigation links (Home, Explore, New Post)
- User menu (Profile, Sign out)
- Theme toggle
-
Responsive Design - Mobile-first approach
-
Card Components - Consistent post presentation
-
Form Components - Input, textarea, buttons with validation
- Toast Notifications - Non-intrusive feedback using Sonner
- Loading States - Skeleton screens and spinners
- Error Handling - Graceful error messages
- Accessibility - ARIA labels, keyboard navigation, semantic HTML
- Provider: MongoDB
- ORM: Prisma
- Schema Models:
- User
- Post
- Block
- Tag
- PostTag (junction table)
- Like
- Comment
- Bookmark
- Follow
- CRUD Operations - Full create, read, update, delete for all entities
- Relationships - Proper foreign key constraints
- Cascade Deletes - Clean up related data on deletion
- Indexing Strategy - Optimized queries on:
- Author + creation date
- Published status + published date
- Like count (for trending)
- Post blocks by order
prisma:generate- Generate Prisma Clientdb:push- Push schema changes to databasedb:studio- Launch Prisma Studio for data inspection
- Zustand - Lightweight state management
- Local State - React hooks (useState, useReducer)
- Form State - Controlled components
- Next.js Server Actions - Form submissions and mutations
- Server Components - Data fetching in React Server Components
- Optimistic Updates (planned) - Immediate UI feedback
- Clerk Integration - Industry-standard auth
- Protected Routes - Middleware-based route protection
- API Route Protection - Server-side auth checks
- Webhook Validation - Svix signature verification
- Zod Schemas - Runtime type validation
- Input Sanitization - XSS prevention with
rehype-sanitize - SQL Injection Protection - Prisma parameterized queries
- CSRF Protection - Next.js built-in protection
- User Roles - Role-based access control
- Ownership Checks - Users can only edit own content
- Admin Controls - Elevated permissions for admins
- Rate Limiting (planned) - Prevent abuse
- Framework: Next.js 16 (App Router)
- React Version: 19.2.3
- Language: TypeScript
- Styling: Tailwind CSS v4
- UI Components: Radix UI primitives
- Animation: Framer Motion
- Form Handling: React Hook Form (implied)
- Markdown Rendering: react-markdown with remark-gfm
- Code Highlighting: Shiki + rehype-pretty-code
- Runtime: Node.js (Next.js server)
- API: Next.js API Routes and Server Actions
- Database: MongoDB
- ORM: Prisma 6.16.0
- Authentication: Clerk
- Linting: ESLint
- Type Checking: TypeScript strict mode
- Package Manager: npm/yarn/pnpm
- Build Tool: Next.js bundler
blog/
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── api/ # API routes
│ │ ├── editor/ # Post editor pages
│ │ ├── explore/ # Discovery page
│ │ ├── p/[slug]/ # Post view page
│ │ ├── sign-in/ # Authentication
│ │ └── sign-up/
│ ├── components/ # React components
│ │ ├── blocks/ # Content block renderers
│ │ ├── layout/ # Layout components
│ │ ├── providers/ # Context providers
│ │ └── ui/ # UI primitives
│ ├── lib/ # Utilities
│ └── server/ # Server-side modules
│ ├── auth.ts # Authentication logic
│ ├── db.ts # Database client
│ ├── posts.ts # Post queries
│ └── users.ts # User queries
├── prisma/
│ └── schema.prisma # Database schema
└── public/ # Static assets
- App Router - Leveraging Next.js 16 App Router for improved performance
- Server Components - Default to server components for better initial load
- MongoDB - Flexible schema for block-based content
- Clerk - Outsourced auth for security and ease of use
- Block Architecture - Extensible system for new content types
- TypeScript - Type safety across the entire stack
- User clicks "Start writing" or "New post"
- System creates a new draft post
- User redirected to editor page
- User adds title and excerpt
- User adds content blocks:
- Click "+" button to add block
- Select block type from menu
- Fill in block content
- Drag blocks to reorder
- User clicks "Save Draft" (auto-saves periodically)
- User previews how post will look
- User clicks "Publish" when ready
- System validates post (requires title)
- Post becomes publicly visible
- User redirected to published post view
- User lands on home page
- User browses latest posts in grid
- User clicks "Explore" for more posts
- User optionally uses search/filters
- User clicks "Read" on interesting post
- System displays post with all blocks rendered
- View count incremented
- User can like, comment, or bookmark
- User can click author to view profile
- User can click tags to find related posts
- User reads a post they enjoy
- User clicks "Like" button (heart icon)
- Like count increments
- User scrolls to comments section
- User writes comment in text field
- User submits comment
- Comment appears with user's profile info
- User can reply to other comments
- User follows post author
- User bookmarks post for later
- User signs up/signs in
- User completes profile information:
- Username
- Display name
- Bio
- Profile picture
- Social links
- User publishes first post
- Other users discover and follow
- User gains followers
- User's profile shows stats and post list
- Profile becomes portfolio of work
- Advanced search with full-text indexing
- Filter by multiple tags simultaneously
- Sort by trending, popular, recent
- Personalized recommendations
- Tag pages with tag descriptions
- Author pages with full profile
- Co-authoring posts
- Post drafts with multiple contributors
- Commenting with mentions (@username)
- Comment likes and threading improvements
- Direct messaging between users
- Jupyter Notebook (.ipynb) import
- Automatic conversion to blocks
- Preserve code + output structure
- Support for notebook metadata
- Batch import multiple notebooks
- Post performance metrics
- Audience demographics
- Traffic sources
- Engagement trends over time
- Export analytics data
- Premium memberships
- Paid posts/gated content
- Newsletter subscriptions
- Donation/tip functionality
- Sponsored posts
- Collaborative real-time editing
- Version history with rollback
- AI-assisted writing suggestions
- Template library
- Custom CSS per post
- Math equation support (LaTeX)
- Diagram support (Mermaid)
- Topic-based communities
- Moderation tools
- Reporting and flagging
- User reputation system
- Badges and achievements
- iOS native app
- Android native app
- Offline reading
- Push notifications
- Monthly Active Users (MAU)
- Sign-up conversion rate
- User retention rate (30-day, 90-day)
- Posts published per week
- Average blocks per post
- Draft-to-publish ratio
- Time spent in editor
- Average session duration
- Posts read per session
- Like rate (likes / views)
- Comment rate (comments / views)
- Bookmark rate
- Follow relationships formed
- Average followers per user
- Comment thread depth
- User-to-user interactions
- GDPR compliance for EU users
- CCPA compliance for California users
- User data export functionality
- Right to deletion (account removal)
- Privacy policy clearly displayed
- Terms of Service agreement required
- Content moderation guidelines
- DMCA takedown process
- Abuse reporting mechanism
- WCAG 2.1 Level AA compliance target
- Screen reader compatibility
- Keyboard navigation support
- Color contrast requirements
- Getting started guide
- Editor tutorial with examples
- Block type reference
- Markdown syntax guide
- FAQs
- API documentation (if public API)
- Database schema documentation
- Component library docs
- Contribution guidelines
- In-app help tooltips
- Support email
- Community forum (planned)
- Video tutorials
Blog Torch represents a modern approach to technical blogging that respects the developer's workflow while providing powerful storytelling tools. By combining notebook-style content blocks with social features and a beautiful, accessible interface, Blog Torch aims to become the premier platform for developers to share their work, build their brand, and engage with a technical community.
The platform is built with scalability, extensibility, and user experience as core priorities, ensuring it can grow alongside its community while maintaining the quality and performance users expect.
User (id, clerkId, username, displayName, bio, imageUrl, role, social links)
├── Posts (authored posts)
├── Comments (authored comments)
├── Likes (liked posts)
├── Bookmarks (bookmarked posts)
├── Followers (users following this user)
└── Following (users this user follows)
Post (id, slug, title, excerpt, coverImageUrl, published, featured)
├── Author (User reference)
├── Blocks (ordered content blocks)
├── Tags (associated tags)
├── Likes (users who liked)
├── Comments (post comments)
└── Bookmarks (users who bookmarked)
Block (id, type, order, data as JSON)
└── Post reference
Tag (id, name, slug)
└── Posts (via PostTag)
Comment (id, body, parentId for threading)
├── Author (User reference)
├── Post reference
└── Replies (child comments)
Like, Bookmark, Follow (junction tables with user and target references)# Database
DATABASE_URL=mongodb://...
# Authentication (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...
CLERK_WEBHOOK_SECRET=whsec_...
# Optional
NEXT_PUBLIC_APP_URL=https://yourdomain.comPrimary accent colors:
- Orange:
#F97316(from-orange-500) - Pink:
#EC4899(to-pink-500)
The gradient branding reflects energy, creativity, and the "torch" metaphor - illuminating code and ideas.
- Time to First Byte: < 200ms
- Largest Contentful Paint: < 2.5s
- First Input Delay: < 100ms
- Cumulative Layout Shift: < 0.1
- Lighthouse Score: > 90 (all categories)
Document Status: Living Document
Maintained By: Product & Engineering Team
Review Cycle: Quarterly or as major features are added