bharatlegal

Next.jsTypeScriptMongoDBMongooseNextAuthGroqTailwindCSS
this one started as legalease, a project me and my friends cooked up in a single night during the elevate summer of code hackathon, where we landed second runner-up. i kept building on it afterwards, and it grew into bharatlegal: a full-stack platform (next.js app router, typescript, mongodb/mongoose) aimed at making indian statutory law (bns, bnss, ipc, crpc, consumer protection act, etc.) understandable and actionable for ordinary citizens.
the core piece is a rag-style chat pipeline over groq's llama/gpt-oss models that detects statutory references in a user's query via regex, fetches verified bare-act text from an internal statute api, and grounds the llm's response in that real text before streaming the reply token-by-token — instead of letting it hallucinate citations. beyond the chatbot, it has a document analysis pipeline (pdf/docx/txt extraction into llm-based risk scoring and structured obligations/clauses), a personal case/matter tracker synced to india's ecourts cnr numbering system with a live lookup against public aws open data judgment buckets, and a legal drafting studio.
everything sits behind nextauth (jwt sessions, google oauth + credentials) with per-user data isolation enforced at the query level across cases, matters, drafts, conversations, and documents, to keep one user's data from leaking into another's. i also wrote a ~800-line verification test suite (bun test) covering the core business logic, run in ci.
the core piece is a rag-style chat pipeline over groq's llama/gpt-oss models that detects statutory references in a user's query via regex, fetches verified bare-act text from an internal statute api, and grounds the llm's response in that real text before streaming the reply token-by-token — instead of letting it hallucinate citations. beyond the chatbot, it has a document analysis pipeline (pdf/docx/txt extraction into llm-based risk scoring and structured obligations/clauses), a personal case/matter tracker synced to india's ecourts cnr numbering system with a live lookup against public aws open data judgment buckets, and a legal drafting studio.
everything sits behind nextauth (jwt sessions, google oauth + credentials) with per-user data isolation enforced at the query level across cases, matters, drafts, conversations, and documents, to keep one user's data from leaking into another's. i also wrote a ~800-line verification test suite (bun test) covering the core business logic, run in ci.