Back to Projects
CONTRIBUTING

Deedly — AI Legal Document Platform

Contributing developer on an AI-powered legal document management and contract analysis platform.

Next.js 14TypeScriptSupabaseBullMQGemini AIBlockNoteTailwind CSS
Live Demo

// problem

Business Problem

Reading and understanding legal contracts is slow, expensive, and inaccessible. Individuals and businesses sign agreements without fully understanding the risks, obligations, or missing protections.

// constraints

Constraints

  • AI analysis pipeline must handle large documents without blocking the UI
  • Multi-provider AI routing to avoid single-vendor lock-in and manage costs
  • Real-time progress tracking for long-running analysis jobs

// architecture

Architecture

frontend

Next.js 14 App Router with BlockNote rich-text editor, streaming AI chat, and real-time analysis progress

backend

Next.js API Routes with BullMQ background job queue for the 6-stage analysis pipeline

database

Supabase (PostgreSQL + Row Level Security) for documents, analysis results, and user data; Supabase Storage for file uploads

deployment

Vercel with Redis-backed BullMQ workers for async processing

Scalability Strategy

  • 6-stage async analysis pipeline (metadata → clauses → analysis → overview → lifecycle → recommendations)
  • Multi-provider AI router with automatic fallback: Gemini → OpenRouter → GPT-4 → Claude
  • Background job queue with priority scheduling, retries, and progress tracking
  • Usage and cost tracking per user to support tiered pricing

Security Decisions

  • Supabase Auth with Row Level Security — documents never shared between users
  • Private Supabase Storage bucket with authenticated access only
  • Server-side validation on all API endpoints
  • API key isolation per AI provider with environment-managed secrets

Target Outcomes

  • Contributing developer — assisting with feature development and integration work
  • Full 6-stage AI contract analysis pipeline shipping real risk assessments and recommendations
  • Voice chat with Gemini Live API for natural document Q&A
  • Party-perspective analysis (buyer vs seller) for nuanced contract review