An AI-powered document review workspace that transforms unstructured legal contracts into structured, queryable datasets. Designed for legal professionals, auditors, and procurement teams to accelerate due diligence and contract analysis.
- AI-Powered Extraction: Automatically extract key clauses, dates, amounts, and entities from PDFs using Google Gemini 2.5 Pro / 3.0.
- High-Fidelity Conversion: Uses Docling (running locally) to convert PDFs and DOCX files to clean Markdown text, preserving formatting and structure without hallucination.
- Dynamic Schema: Define columns with natural language prompts (e.g., "What is the governing law?").
- Verification & Citations: Click any extracted cell to view the exact source quote highlighted in the original document.
- Spreadsheet Interface: A high-density, Excel-like grid for managing bulk document reviews.
- Integrated Chat Analyst: Ask questions across your entire dataset (e.g., "Which contract has the most favorable MFN clause?").
- Real-Time Progress: Progress bar showing extraction status (X/Y cells completed).
TabularReview.Final.mp4
βββββββββββββββββββββββββββββββββββ
β React Frontend β
β (Vite + TypeScript + Tailwind) β
β β
β βββββββββββ ββββββββββββββββ β
β βDataGrid β β Gemini SDK β β
β βSidebar β β (extraction β β
β βChat β β & chat) β β
β βββββββββββ ββββββββ¬ββββββββ β
β β β
β Google Gemini API β
ββββββββββββ¬βββββββββββββββββββββββ
β /convert (file upload)
ββββββββββββΌβββββββββββββββββββββββ
β FastAPI Backend β
β (Python + Docling) β
β β
β PDF/DOCX β Markdown conversion β
βββββββββββββββββββββββββββββββββββ
Frontend (/): React 19 SPA. Handles the grid UI, Gemini API calls for extraction/chat (client-side via @google/genai SDK), and document viewing.
Backend (/server): Python FastAPI server running Docling for document conversion. Converts uploaded PDF/DOCX files to Markdown text. The frontend sends files here before storing them.
- Frontend: React 19, TypeScript, Tailwind CSS, Vite
- AI Integration: Google GenAI SDK (Gemini 2.5 Flash, 2.5 Pro, 3.0 Pro)
- Backend: Python, FastAPI, Docling (document conversion)
- Node.js 18+ (with npm)
- Python 3.10+
- Google Gemini API Key β get one from Google AI Studio
git clone https://github.com/astevens-lmds/Tabular_Review.git
cd Tabular_ReviewCopy the example file and add your API key:
cp .env.example .envEdit .env and set:
VITE_GEMINI_API_KEY=your_google_api_key_here
VITE_API_URL=http://localhost:8000| Variable | Required | Description |
|---|---|---|
VITE_GEMINI_API_KEY |
Yes | Google Gemini API key for AI extraction and chat |
VITE_API_URL |
No | Backend URL (defaults to http://localhost:8000) |
npm installThe backend is required for document conversion (PDF/DOCX β Markdown).
cd server
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtStart the backend (in one terminal):
cd server
source venv/bin/activate
python main.py
# Server runs at http://localhost:8000Start the frontend (in another terminal):
npm run dev
# App runs at http://localhost:3000cp .env.example .env
# Edit .env and add your Google Gemini API key
docker-compose up --build- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API docs: http://localhost:8000/docs
npx vitest run # Run all tests once
npx vitest # Watch modeTests live in tests/ and cover components (App, DataGrid, AddColumnMenu, KeyboardShortcutsHelp, ErrorBoundary, BatchUploadProgress), utilities (CSV/PDF export, column templates, theming), and type definitions.
cd server
source venv/bin/activate
pytest test_main.py -vBackend tests cover the /convert and /health endpoints, rate limiting, file size limits, CORS headers, and filename validation.
βββ App.tsx # Main application component
βββ index.tsx # React entry point
βββ types.ts # TypeScript type definitions
βββ components/
β βββ DataGrid.tsx # Spreadsheet-like grid
β βββ VerificationSidebar.tsx # Cell inspection & document viewer
β βββ ChatInterface.tsx # AI chat analyst
β βββ AddColumnMenu.tsx # Column creation/editing
β βββ BatchUploadProgress.tsx # Batch upload progress overlay
β βββ ColumnTemplateMenu.tsx # Pre-built column templates
β βββ ErrorBoundary.tsx # React error boundary
β βββ KeyboardShortcutsHelp.tsx # Shortcuts modal
β βββ ProjectManager.tsx # Project save/load
β βββ Icons.tsx # Icon re-exports from lucide-react
βββ hooks/
β βββ useTheme.ts # Dark mode hook
β βββ useKeyboardShortcuts.ts # Keyboard shortcut handler
βββ services/
β βββ geminiService.ts # Gemini API integration
β βββ documentProcessor.ts # Frontend β backend file conversion
β βββ batchExport.ts # Multi-format export
β βββ projectStore.ts # LocalStorage project persistence
βββ tests/ # Vitest test suite
βββ utils/
β βββ sampleData.ts # Built-in sample documents
β βββ columnTemplates.ts # Column template definitions
βββ server/
β βββ main.py # FastAPI backend
β βββ requirements.txt # Python dependencies
βββ .env.example # Environment variable template
βββ vite.config.ts # Vite configuration
βββ tsconfig.json # TypeScript configuration
βββ docker-compose.yml # Docker setup
βββ Dockerfile.frontend # Frontend Docker image
βββ Dockerfile.backend # Backend Docker image
The FastAPI backend includes auto-generated interactive API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- OpenAPI JSON: http://localhost:8000/openapi.json
| Method | Path | Description |
|---|---|---|
POST |
/convert |
Upload a document (PDF, DOCX, etc.) and receive Markdown text. Rate-limited to 30 req/min per IP. |
GET |
/health |
Health check endpoint. Returns {"status": "ok"}. |
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer: This tool is an AI assistant and should not be used as a substitute for professional legal advice. Always verify AI-generated results against the original documents.