How jamietso/tabular_review works
Project Type and Purpose
• This is a full-stack, AI-powered web application ("Tabular Review for Bulk Document Analysis") that lets legal professionals upload large volumes of contracts, automatically extract structured data, inspect source citations, and interact via a spreadsheet UI and chat analyst.
• Frontend: React + TypeScript + Tailwind CSS (Vite-bundled).
• Backend: A Python microservice (“Docling”) for high-fidelity PDF/DOCX → Markdown conversion.
• AI Integration: Google Gemini via GenAI SDK (Gemini 2.5 Pro / 3.0 Pro).
File Structure Analysis
• Top-Level Files / Configs:
– vite.config.ts, tsconfig.json, package.json, pnpm-lock.yaml → frontend build & TypeScript config
– .env.example → placeholder for VITE_GEMINI_API_KEY
• Directories:
– services/ → client-side logic calling AI and data-processing endpoints (geminiService.ts, documentProcessor.ts)
– utils/ → sampleData.ts (for mocking), types.ts (shared TypeScript types)
– server/ → Python Docling service (main.py + requirements.txt)
• Key Patterns:
– UI layer (React) ←→ Service layer (services/*.ts) ←→ External endpoints (Python backend + Google Gemini API)
– No persistent database – state is managed in UI (client state) and transiently in the Python service.
README Insights
• Describes AI-powered extraction, dynamic schema, verification & citations, spreadsheet interface, integrated chat.
• Specifies two backends: local Docling (server/main.py) and Google Gemini (external AI service).
• No mention of persistent storage – assumes ephemeral processing.
Blueprint
a. Main Components
1. Client Browser (React App)
2. Frontend Layers:
– Presentation Components (components/*)
– Service Layer (services/documentProcessor.ts, services/geminiService.ts)
3. Local Conversion Service (Python Docling microservice)
4. External AI Service (Google Gemini via HTTPS)
5. (Optional) In-memory or browser storage for session data
b. Relationships & Data Flows
1. User → React UI (upload PDF/DOCX)
2. React → POST to Docling service → Markdown text returned
3. React → Call Google Gemini API via geminiService → JSON extraction (clauses, dates, entities)
4. React state updated → DataGrid renders structured table
5. On cell click → React fetches citation location from original Markdown / PDF via documentProcessor
6. Chat Interface: React → Gemini API (with contextual prompt intersecting full dataset) → display answers
c. Architectural Patterns & Design Principles
– Component-based UI: single responsibility for each React component
– Service abstraction: keep AI & conversion logic out of UI components
– Microservice for document conversion decouples heavy PDF parsing from frontend
– Stateless backend: no persistence, scales horizontally if needed
d. Key Technologies/Frameworks
– Frontend: React 19, TypeScript, Tailwind CSS, Vite
– Backend: Python 3.x, Docling library
– AI: Google GenAI SDK (Gemini 2.5 / 3.0 Pro)
– Packaging: pnpm, pip + venv