Dharmabot is a sophisticated web application designed to provide AI-powered legal support for the Indian legal community. It serves as an intelligent assistant for legal professionals, law students, and citizens seeking information on various legal domains, leveraging the power of Google Gemini AI. The application offers a personalized experience based on user roles with advanced features for legal research, document drafting, and professional networking.
- Natural Language Conversations: Engage with a specialized legal AI trained on Indian law
- Contextual Understanding: AI infers legal service areas and tasks from conversation history
- Multi-turn Conversations: Maintains context across extended legal discussions
- Suggested Prompts: 300+ curated legal prompts across multiple practice areas
- Smart Auto-complete: Intelligent suggestions based on user input
- Find a Lawyer Integration: Citizens get direct access to lawyer directory from AI responses
- Multi-format Support: PDF, DOCX, TXT, and images (JPEG, PNG, WebP, GIF, HEIC, HEIF)
- Advanced PDF Processing: Text extraction with OCR fallback for image-based PDFs
- Intelligent Analysis: AI analyzes documents for legal relevance and key insights
- Batch Processing: Upload and analyze up to 5 documents simultaneously
- Visual Feedback: Real-time processing status with detailed error handling
- Real-time Legal Updates: Optional web search for current legal information
- Smart Keyword Detection: Automatic search activation for queries about recent laws
- Source Citations: Properly cited web sources with clickable links
- Grounding Verification: AI responses backed by authoritative legal sources
- Local Storage: Sessions saved securely in browser storage
- Session Management: Load, rename, and delete previous conversations
- Search & Filter: Find specific conversations quickly
- Export Options: Save important conversations for future reference
- Mock Authentication System: Secure login/signup using localStorage
- Four User Roles: Citizen, Judge, Lawyer, and Law Student
- Personalized Experience: Features and access tailored to user role
- Role-specific Welcome Messages: Customized guidance based on user type
Feature | Citizen | Law Student | Judge | Lawyer |
---|---|---|---|---|
AI Chat | โ | โ | โ | โ |
Document Upload | โ | โ | โ | โ |
Find a Lawyer | โ | โ | โ | โ |
Document Drafting | โ | โ | โ | โ |
Deep Research | โ | โ | โ | โ |
Voicenotes | โ | โ | โ | โ |
Available to: Lawyers, Judges, Law Students
- AI-Powered Generation: Create legal documents from natural language instructions
- 300+ Document Templates: Comprehensive library of Indian legal document types
- Voice Dictation: Speak instructions for hands-free document creation
- Rich Text Editor: Professional Quill.js editor with legal formatting
- Draft Management: Save, load, and manage multiple document drafts
- Export Options: Professional DOCX and TXT export with proper formatting
- Suggested Prompts: Curated list of common legal document types
- Enhanced DOCX Export: Professional formatting with proper headings and spacing
Available to: Judges, Lawyers
- Audio Recording: High-quality voice recording with visual feedback
- AI Transcription: Accurate speech-to-text using Google Gemini
- Legal Note Polishing: Transform raw transcripts into structured legal notes
- Note Management: Save, organize, and manage voicenotes locally
- Audio Playback: Review original recordings alongside transcripts
- Smart Titles: AI-generated titles based on content analysis
Available to: Lawyers, Judges, Law Students
- Comprehensive Legal Research: AI-powered research with web search integration
- Voice Query Input: Dictate research queries for hands-free operation
- Research Session Management: Save and organize research sessions
- Professional Export: Export research to DOCX with clickable citations
- Source Verification: Properly cited sources with direct links
- Research History: Track and revisit previous research sessions
Available to: Citizens, Law Students, Lawyers
- Comprehensive Database: 40+ verified lawyer profiles across Kerala and Karnataka
- Smart Search: Keyword-based search with practice area matching
- Advanced Filtering: Filter by location, expertise, and experience
- Practice Area Keywords: Intelligent matching for terms like "accident," "divorce," "criminal"
- Direct Contact: Email and phone contact options
- Experience-based Sorting: Lawyers sorted by experience and expertise
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Dark/Light Theme: Automatic theme switching with user preference storage
- Smooth Animations: Micro-interactions and transitions for enhanced UX
- Accessibility: WCAG-compliant design with proper ARIA labels
- Professional Aesthetics: Clean, modern interface inspired by leading legal tech platforms
- Local Data Storage: All user data stored locally in browser
- No Server Dependencies: Client-side processing for enhanced privacy
- Secure Authentication: Mock authentication system for demonstration
- Data Encryption: Sensitive data handled securely
- Privacy-First Design: No external data transmission except AI API calls
- React 19 with TypeScript for type-safe development
- Tailwind CSS for responsive, utility-first styling
- Custom CSS for advanced animations and micro-interactions
- Google Gemini API (
gemini-2.5-flash-preview-04-17
) - @google/genai library for seamless AI integration
- Multi-modal Support for text, image, and audio processing
- PDF.js for client-side PDF text extraction and rendering
- Quill.js for rich text editing with legal document formatting
- docx library for professional DOCX export with styling
- marked for Markdown parsing and HTML conversion
- MediaRecorder API for high-quality audio recording
- Web Audio API for real-time audio visualization
- Canvas API for waveform visualization during recording
- React Hooks (useState, useEffect, useContext) for local state
- Context API for theme management and global state
- localStorage for persistent data storage
- Vite for fast development and optimized builds
- ES Modules with import maps for modern JavaScript
- TypeScript for enhanced developer experience and type safety
dharmabot/
โโโ components/ # React UI components
โ โโโ AuthView.tsx # User authentication interface
โ โโโ ChatHistoryPanel.tsx # Sidebar for chat management
โ โโโ ChatInputBar.tsx # Message input with file upload
โ โโโ ResponseDisplay.tsx # Chat message rendering
โ โโโ DocumentDraftingView.tsx # Document creation interface
โ โโโ VoicenoteView.tsx # Voice recording and management
โ โโโ FindLawyerView.tsx # Lawyer directory interface
โ โโโ ResearchView.tsx # Deep research portal
โ โโโ RichTextEditor.tsx # Quill.js wrapper component
โ โโโ ... # Additional UI components
โโโ services/ # Business logic and API services
โ โโโ geminiService.ts # Google Gemini AI integration
โ โโโ localStorageService.ts # Chat session persistence
โ โโโ authService.ts # Mock authentication system
โ โโโ lawyerDirectoryService.ts # Lawyer database management
โ โโโ voicenoteStorageService.ts # Voicenote persistence
โ โโโ documentDraftingStorageService.ts # Draft management
โ โโโ suggestedPrompts.ts # Curated prompt library
โ โโโ draftingPrompts.ts # Document drafting templates
โ โโโ practiceAreaKeywords.ts # Search keyword mapping
โโโ contexts/ # React Context providers
โ โโโ ThemeContext.tsx # Theme management
โโโ types.ts # TypeScript type definitions
โโโ constants.ts # Application constants
โโโ App.tsx # Main application component
โโโ index.tsx # Application entry point
โโโ public/ # Static assets and data
โโโ Logos.png # Application logo
โโโ Lawyer Directory Details.csv # Lawyer database
- Google Gemini API Key - Required for AI functionality
- Modern Web Browser - Chrome, Firefox, Safari, or Edge
- HTTP Server - For serving the application (cannot run via file://)
-
Obtain Gemini API Key:
- Visit Google AI Studio
- Create a new API key for Gemini
- Copy the API key for configuration
-
Set Environment Variable:
# Create .env.local file in project root echo "GEMINI_API_KEY=your_api_key_here" > .env.local
- Clone or Download the project files
- Install Dependencies (if using npm):
npm install
- Start Development Server:
npm run dev # or using serve npx serve . # or using Python python -m http.server
- Access Application: Navigate to
http://localhost:3000
(or provided URL)
- Build Application:
npm run build
- Deploy to Static Hosting:
- Netlify, Vercel, GitHub Pages, or any static host
- Ensure environment variables are configured in hosting platform
- Set up proper redirects for single-page application
- Access the Application via web browser
- Create Account or continue as guest
- Select User Role during registration (affects available features)
- Start Chatting with the AI or explore specialized features
- Ask Legal Questions: Get guidance on rights, procedures, and legal concepts
- Upload Documents: Analyze contracts, notices, or legal documents
- Find Lawyers: Search for qualified legal professionals in your area
- Get Referrals: AI suggests when professional legal help is needed
- Study Assistance: Get explanations of complex legal concepts
- Document Practice: Learn to draft legal documents with AI guidance
- Research Skills: Conduct comprehensive legal research with AI assistance
- Case Analysis: Upload and analyze legal cases and judgments
- Case Research: Deep research on legal precedents and current law
- Document Review: Analyze case documents and legal submissions
- Note Taking: Voice-to-text for court proceedings and case notes
- Legal Writing: Draft orders, judgments, and legal opinions
- Client Consultation: AI-assisted legal advice and case analysis
- Document Drafting: Generate contracts, notices, and legal documents
- Legal Research: Comprehensive research with current legal updates
- Practice Management: Organize cases, documents, and client communications
- Speech Recognition: Accurate transcription in multiple Indian languages
- Voice Commands: Navigate and control the application via voice
- Audio Analysis: AI analysis of recorded legal discussions
- Hands-free Operation: Complete workflows without typing
- Smart Extraction: Automatically identify key clauses and terms
- Risk Analysis: Highlight potential legal risks in contracts
- Compliance Checking: Verify documents against legal requirements
- Version Comparison: Compare different versions of legal documents
- Case Law Search: Find relevant precedents and judgments
- Statutory Analysis: Research current laws and regulations
- Legal Updates: Stay informed about recent legal developments
- Citation Management: Proper legal citation formatting
- Professional Formatting: Export documents with proper legal formatting
- Multiple Formats: DOCX, PDF, and plain text export options
- Citation Links: Clickable references in exported documents
- Template Library: Pre-formatted templates for common documents
- Chrome/Chromium 90+ (Recommended)
- Firefox 88+
- Safari 14+
- Edge 90+
- ES Modules support
- Web Audio API for voice features
- File API for document upload
- localStorage for data persistence
- Fetch API for network requests
- Multi-language Support: Hindi, Tamil, Telugu, and other Indian languages
- Advanced AI Models: Integration with specialized legal AI models
- Collaboration Tools: Multi-user document editing and review
- Case Management: Complete case lifecycle management system
- Mobile Applications: Native iOS and Android applications
- API Integration: Connect with legal databases and court systems
- Offline Capability: Progressive Web App with offline functionality
- Enhanced Security: End-to-end encryption for sensitive documents
- Performance Optimization: Faster loading and processing times
- Accessibility Enhancements: Full WCAG 2.1 AA compliance
- Documentation: Comprehensive guides and tutorials
- Community Forum: User community for questions and discussions
- Bug Reports: GitHub issues for technical problems
- Feature Requests: Feedback portal for new feature suggestions
Dharmabot is an AI-powered legal assistant designed to provide general legal information and assistance. It is not a substitute for professional legal advice. Users should consult with qualified legal professionals for specific legal matters and important decisions.
ยฉ 2024 UB Intelligence. All rights reserved.
Dharmabot - Empowering the Indian Legal Community with AI Technology