Case Study
GitLaw (2025–Present) — Building a GitHub-Style Platform for Legal Documents
A legal-tech platform combining Git-backed version control, collaborative editing, electronic signatures, community templates, AI-assisted analysis, organization management, and subscription billing.
Problem
Legal teams work with large volumes of documents but lack:
- Legal-grade version control and auditability
- Integrated electronic signatures
- Community templates and sharing workflows
- AI-assisted drafting and analysis tuned for legal content
- Fine-grained access control and organization management
- Structured metadata (jurisdiction, categories, confidence levels)
Solution
GitLaw is a legal document management and collaboration platform that provides:
- Rich legal document editor (TipTap / ProseMirror)
- Git-backed version history via Gitea
- Integrated electronic signatures (Documenso)
- Public community library for publishing and forking legal templates
- AI chat for document analysis and drafting
- Organization management with role-based access
- Stripe subscription billing with usage-based credits
- Elasticsearch-powered full-text search
- Email notifications for sharing and signing workflows
- Public REST API + Zapier integration
High-Level Architecture
Frontend
- Next.js (App Router, SSR, RSC)
- React 19
- TypeScript (strict)
- Tailwind CSS
- Radix UI
- TipTap / ProseMirror editor
Backend
- NestJS (microservices)
- PostgreSQL
- Elasticsearch
- Redis
- Stripe billing
- Google Gemini (AI features)
Patterns
- Domain-Driven Design
- Microservices architecture
- Feature-first code organization
Scope of Ownership
Frontend-focused full-stack engineer with ownership across the following areas:
Billing
Built pricing pages, checkout flows, subscription management, usage tracking, and organization billing using Stripe.
Community
Developed a public document library with discovery, filtering, document publishing, a star system, public user profiles, and SEO-optimized server-rendered pages.
eSign
Implemented end-to-end electronic signature workflows including PDF field placement, recipient management with multiple roles, embedded signing experience, signed document delivery, and email notifications.
Files
Built the core file management system: CRUD operations, full-text search, version history, metadata management, forking, and publishing. This feature is the backbone for the editor, community, e-signature, and AI workflows.
Landing Page
Composed the server-rendered homepage with live data from billing and platform features.
Settings
Implemented settings interfaces for billing, profile, contacts, organizations, and API key management with context-aware routing.
Key Decisions
- 1
Adopted reactive state management patterns for complex cross-cutting features like billing — enables fine-grained reactivity without prop drilling
- 2
Feature-first code organization over layer-first — keeps each domain self-contained and independently navigable
- 3
Integrated a third-party e-signature provider rather than building from scratch — signing infrastructure is a solved problem; effort is better spent on workflow orchestration
- 4
Server-rendered community pages for SEO — public document discovery requires search engine visibility
Tradeoffs
- Reactive state management adds a learning curve for new developers but eliminates state synchronization bugs across features
- Microservices increase deployment complexity but enforce domain boundaries and allow independent scaling
- Third-party e-signature integration couples the signing workflow to an external service but provides mature signing infrastructure
Lessons
- Feature-first code organization pays off immediately on a platform with many cross-cutting concerns
- E-signature integration is mostly workflow orchestration — managing states, recipients, and notification timing is the hard part
- Server-rendered SEO pages and client-heavy interactive pages can coexist cleanly with proper route organization