· Ed Dowding · Portfolio  · 3 min read

Codraft (DocVote)

Real-time collaborative document editor with element-based voting system for surfacing the best ideas in Ministry for the Future-style policy planning and scenario development.

Real-time collaborative document editor with element-based voting system for surfacing the best ideas in Ministry for the Future-style policy planning and scenario development.

The Problem

Traditional collaborative documents suffer from two fundamental issues: consensus-driven editing flattens out diverse perspectives, and asynchronous commenting makes it difficult to identify which ideas have genuine support. Policy planning, scenario development, and strategic foresight work—the kind of collaborative writing imagined in Kim Stanley Robinson’s “Ministry for the Future”—requires both preserving alternative viewpoints AND surfacing collective wisdom.

Teams need a way to write together that allows divergent thinking while democratically identifying the strongest ideas, all without the overhead of formal voting processes or losing momentum in endless revision cycles.

What I Built

Codraft (originally DocVote) is a collaborative document editor where every paragraph, heading, and list item can be independently voted on, commented upon, and versioned. Think Google Docs meets Reddit’s voting system, but for serious policy work.

Element-Based Architecture

  • Documents broken into discrete, votable elements (paragraphs, headings, lists)
  • Each element maintains its own vote score, comment threads, and version history
  • Writers can propose alternatives; readers signal preference through voting
  • High-scoring elements naturally rise to prominence without requiring formal consensus

Real-Time Collaboration

  • Multiple users editing simultaneously with Supabase Realtime
  • Live presence indicators showing who’s currently working on the document
  • Conflict resolution built into the element structure
  • Permission-based access control for collaborative workspaces

Voting System for Ideas

  • Upvote/downvote on individual paragraphs to surface best thinking
  • Vote scores drive document analytics (e.g., “most controversial section,” “highest consensus”)
  • Track engagement patterns to identify which ideas resonate

Version History & Comments

  • Full version tracking for content changes over time
  • Threaded comments attached to specific elements, not just the document
  • Revert to previous versions at the element or document level

The Tech Stack

  • Frontend: Next.js 14 (App Router) + React 18 + TypeScript for modern, type-safe development
  • Editor: TipTap (ProseMirror-based) for rich text editing with element granularity
  • Backend: Supabase for PostgreSQL database, real-time subscriptions, and authentication
  • Security: Row Level Security (RLS) policies ensuring proper data isolation
  • UI/UX: Tailwind CSS + Shadcn/ui components for clean, responsive design
  • Deployment: Vercel-ready with environment-based configuration

Lessons Learned

Granularity Changes Collaboration Dynamics Breaking documents into votable elements transformed how teams interacted with content. Instead of arguing in comment threads about entire sections, writers could propose alternatives and let the group signal preference through voting. This reduced conflict and accelerated decision-making without sacrificing quality.

Real-Time Requires Simplicity Early architectures attempted complex operational transformation for simultaneous editing. Switching to an element-based model simplified conflict resolution dramatically—each element is atomic, so concurrent edits rarely collide. Sometimes the right data structure is half the battle.

Voting Isn’t Always Democratic Teams discovered they could weight votes based on expertise (subject matter experts’ votes counting more) or role (stakeholders vs. advisors). The architecture supported this through flexible RLS policies. The lesson: democratic tools need governance layers to work in hierarchical organizations.

Async Commenting Beats Meetings Threaded comments on specific elements replaced dozens of hours of meetings. Teams could debate controversial paragraphs asynchronously, with voting providing clear resolution signals. The time savings were measured in days per document cycle.

Element-Level Analytics Reveal Consensus Gaps Tracking vote distributions (e.g., “50/50 split on this paragraph”) surfaced points requiring deeper discussion. Analytics became facilitation tools, helping teams prioritize where to focus collaborative attention rather than endlessly revising everything.

Back to Blog

Related Posts

View All Posts »
Mother's Almanac

Mother's Almanac

AI-powered parenting encyclopedia that generates evidence-based guidance on-demand. Built with Next.js 15, Supabase, Claude AI, and a 3-layer caching system with RAG document upload and semantic search.

Contextual Feedback

Contextual Feedback

Open-source React library enabling section-targeted feedback collection. Users visually identify specific UI elements they're commenting on, eliminating vague feedback and providing administrators with precise contextual information.

Moneypenny (WhatsApp AI Desktop Client)

Moneypenny (WhatsApp AI Desktop Client)

Native desktop WhatsApp client with AI-powered message summarisation, priority inbox, and keyboard-first navigation. Built with Tauri (Rust), React, and multi-provider LLM support.

Panauricon (Limitless Elephant)

Panauricon (Limitless Elephant)

Continuous voice capture app with 30-minute auto-segmented recording, Google Gemini transcription, location tagging, and full-text search. Designed for capturing thoughts, conversations, and ideas without interruption.