How dhanushshetty18/legal-techai works
Legal-TechAI combines an Android client, a Next.js web interface, a FastAPI legal-document engine, and a separate e-filing drafting app. Its main documented workflow captures or uploads documents, extracts and processes text, then supports inconsistency review and legal Q&A; case search and document drafting are additional user-facing branches. The README also describes OCR-driven form hydration and statutory checklists. Backend route registration and selected upload, RAG, and client API code were sampled; links to unsampled feature internals are omitted.
Main entry points: main.py FastAPI Application · AppRepository.kt Android Repository · drafting.py Drafting API · ApiService.kt Android API Service
Components 20
Client Applications
- Android Screens
android/app/src/main/java/com/legaltechai/app/ui/screens - Android Repository
android/app/src/main/java/com/legaltechai/app/data/AppRepository.kt - Android API Service
android/app/src/main/java/com/legaltechai/app/network/ApiService.kt - Web Workflows
frontend/src/app
API Routing
- FastAPI Application
backend/main.py - Upload Route
backend/routers/ingest.py - RAG Route
backend/routers/rag.py - Inconsistency Route
backend/routers/inconsistency.py - OCR Routes
backend/routers/ocr_extract.py - Case Database
backend/database.py
Document Processing
- Text Chunking
backend/modules/chunker.py - OCR Extraction
backend/modules/ocr_extractor.py
Legal Analysis
- Inconsistency Analysis
backend/modules/inconsistency/core.py - Legal Q&A Service
backend/modules/rag/service.py
E-Filing Drafting
- Filing Interface
e-filing-updated/frontend/src/app/file-case/page.tsx - Drafting API
e-filing-updated/backend/routers/drafting.py - Word Draft Generator
e-filing-updated/backend/modules/engine_mode_a.py - PDF Draft Generator
e-filing-updated/backend/modules/engine_mode_b.py
Other components
- Legal User
- Gemini AI Service
Connections 16
- Legal User → Android Screens: uses
- Android Repository → Android API Service: calls
- Android API Service → FastAPI Application: HTTP requests
- Android Repository → Case Database: caches cases
- Legal User → Web Workflows: uses
- Legal User → Filing Interface: uses
- FastAPI Application → Upload Route: registers
- FastAPI Application → RAG Route: registers
- FastAPI Application → Inconsistency Route: registers
- FastAPI Application → OCR Routes: registers
- Upload Route → Text Chunking: cleans and chunks
- RAG Route → Legal Q&A Service: invokes
- Legal Q&A Service → Gemini AI Service: embeds and generates
- FastAPI Application → Case Database: initializes tables
- Drafting API → Word Draft Generator: generates Word
- Drafting API → PDF Draft Generator: generates PDF