CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

Refactor: Extract login page and implement feature panels architecture #3948

Merged⚡ AI-generatedXSccantynz wants to mergeclaude/product-readiness-assessment-6YNCEmainopened Apr 22, 2026
ccantynzcommented Apr 22, 2026

Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/48co.nz-Dictation/pull/4


Summary

This PR performs a major architectural refactoring of the authentication and feature system. The monolithic login page is extracted into a dedicated route, and a comprehensive set of feature panels (Citation, Compliance, Redaction, Diarization, Precedent, Conflict, E-signature, Share, Matter, and Multi-Doc) are implemented as self-contained client components with supporting server-side logic.

Key Changes

Authentication & Routing

  • Extracted login page: Moved app/page.tsx (741 lines) → app/login/page.tsx (749 lines) with PWA install detection and multi-view auth (login/register/forgot/admin)
  • Updated middleware: Added public routes for /about, /contact, /pricing, /terms, and /share/[token]
  • New public pages: Added /about, /contact, /pricing, /terms with metadata and footer components
  • Error handling: Added global error boundary (app/error.tsx) and 404 page (app/not-found.tsx)

Feature Panels (Client Components)

Implemented 10 self-contained feature panels in app/components/features/:

  • CitationPanel: Legal citation detection (case law, statutes, regulations) with jurisdiction support
  • CompliancePanel: Rule-based compliance checking with severity levels (critical/warning/info)
  • RedactionPanel: PII detection and redaction (email, phone, ID, financial, address, DOB, amounts, names, case numbers)
  • DiarizationPanel: Speaker turn detection with context-aware labeling (deposition, meeting, interview, client-call)
  • PrecedentPanel: TF-IDF similarity matching against historical dictations
  • ConflictPanel: Conflict-of-interest detection against client roster with confidence scoring
  • EsignPanel: E-signature envelope creation (DocuSign & Adobe Sign) with recipient management
  • SharePanel: Shareable link generation with expiry, password protection, and view tracking
  • MatterPanel: Matter/client management with time entry logging and export (CSV, Actionstep, Clio, MyCase, PracticePanther)
  • MultiDocPanel: Parallel multi-document generation (up to 4 variants) with independent streaming

Core Libraries

  • lib/citations.ts: Pure regex-based legal citation parser (NZ, UK, US, AU jurisdictions)
  • lib/compliance.ts: Rule engine for document-mode-specific compliance checks
  • lib/redaction.ts: PII detection with Luhn algorithm for credit card validation
  • lib/diarization.ts: Text-heuristic speaker turn detection (explicit prefixes, Q/A patterns, paragraph breaks)
  • lib/precedent.ts: TF-IDF cosine similarity for historical document matching
  • lib/name-extract.ts: Person/organisation name extraction with titled names and case-caption patterns
  • lib/client-roster.ts: In-memory client store with globalThis singleton pattern
  • lib/matter-store.ts: Matter and time entry management with export functionality
  • lib/share-store.ts: Share link store with PBKDF2 password hashing and expiry tracking
  • lib/esign.ts: DocuSign and Adobe Sign integration with JWT auth and envelope creation
  • lib/multi-doc.ts: Multi-document chain orchestration helpers
  • lib/env-check.ts: Runtime environment variable validation

API Routes

  • POST /api/multi-doc: Parallel document generation with per-mode streaming
  • POST /api/citations: Citation analysis endpoint
  • POST /api/compliance: Compliance checking endpoint
  • POST /api/redact: PII detection and redaction endpoint
  • POST /api/diarize: Speaker diarization endpoint
  • POST /api/precedents: Precedent matching endpoint
  • POST /api/conflicts: Conflict-of-interest checking endpoint
  • POST /api/esign/send: E-signature envelope creation
  • GET /api/esign/status: E-signature configuration status
  • POST /api/share: Create and list share links
  • POST /api/share/view/[token]: View and

https://claude.ai/code/session_018xBL6hUgyq6Pj1p6wvbVFm

ccantynzcommented Apr 22, 2026

Originally written by @vercel[bot] on GitHub.


The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
alecrae.app Error Error Apr 22, 2026 9:50am

Request Review

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts