{"id":27341329,"url":"https://github.com/ddihora1604/nyaymitra","last_synced_at":"2026-04-07T18:32:26.706Z","repository":{"id":287429762,"uuid":"961222681","full_name":"ddihora1604/NyayMitra","owner":"ddihora1604","description":"NyayMitra is a comprehensive legal assistance platform offering AI chatbot support, lawyer search with maps, legal document analysis, case tracking, contract drafting, and interactive legal flowcharts to simplify access to justice for all.","archived":false,"fork":false,"pushed_at":"2025-09-25T10:56:08.000Z","size":5586,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-25T12:29:56.206Z","etag":null,"topics":["agentic-ai","chromadb","chromedriver","crewai","gemini","langchain","llama","nextjs","openmap","python","rag","reactflow","streamlit","unicorn"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddihora1604.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-06T03:05:01.000Z","updated_at":"2025-09-25T10:56:11.000Z","dependencies_parsed_at":"2025-04-11T17:48:24.583Z","dependency_job_id":"8740562c-f1be-465f-a99c-7b7b6014118b","html_url":"https://github.com/ddihora1604/NyayMitra","commit_stats":null,"previous_names":["ddihora1604/nyaymitra"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ddihora1604/NyayMitra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddihora1604%2FNyayMitra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddihora1604%2FNyayMitra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddihora1604%2FNyayMitra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddihora1604%2FNyayMitra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddihora1604","download_url":"https://codeload.github.com/ddihora1604/NyayMitra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddihora1604%2FNyayMitra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31524525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","chromadb","chromedriver","crewai","gemini","langchain","llama","nextjs","openmap","python","rag","reactflow","streamlit","unicorn"],"created_at":"2025-04-12T16:03:13.843Z","updated_at":"2026-04-07T18:32:26.691Z","avatar_url":"https://github.com/ddihora1604.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NyayMitra - AI-Driven Legal Assistance Platform\n\nPrototype: https://youtu.be/SnLhkuxrAQE?si=SyMnFLTcrbIK6PIF\n\n## Introduction\nNyayMitra is an AI-powered legal assistance platform designed to bridge the gap between Indian citizens and legal services. By combining judicial data integration with modern AI capabilities, it provides accessible legal resources, case tracking, document analysis, and lawyer matching services to make the legal system more approachable for everyone.\n\n## Brief Description\nA comprehensive legal technology solution that leverages artificial intelligence to simplify legal processes, provide guidance in multiple languages, analyze legal documents, track court cases, and connect users with appropriate legal professionals based on their specific needs.\n\n## Project Overview\nNyayMitra addresses the challenges many citizens face when navigating India's complex legal system by providing:\n\n- **Real-time Case Status Tracking**: Integration with Indian court systems to provide up-to-date information on case proceedings\n- **AI-Powered Document Analysis**: Natural Language Processing to interpret and explain legal documents\n- **Multilingual Support**: Legal guidance in both English and Hindi to improve accessibility\n- **Geolocation-Based Lawyer Search**: Connect users with legal professionals based on specialty and location\n- **Interactive Process Visualization**: Flowcharts and diagrams to explain legal procedures\n- **Legal Chatbot Assistant**: AI-driven conversational interface for answering legal questions\n- **Contract Generation**: Template-based legal document creation\n\nThe platform is built with a modern tech stack, emphasizing security, scalability, and user experience while making legal assistance more accessible to all segments of society.\n\n## Key Features\n\n1. Legal Advisor\n2. Legal Researcher\n3. Case Status Tracker\n4. Document Analyzer\n5. Legal Chatbot\n6. Contract Drafting\n7. Lawyer Network\n\n## Detailed Component Explanations\n\n### Legal Advisor\nThe Legal Advisor agent provides expert legal insights tailored to individual or organizational needs. It assists in drafting and reviewing legal documents, offers strategic counsel for dispute resolution, and ensures decisions align with applicable laws. The advisor dynamically references Indian legal frameworks and relevant case laws to deliver contextually accurate guidance.\n\nKey features include:\n1. Drafting and validation of legal agreements and notices\n2. Real-time compliance checks for business operations\n3. Scenario-based legal recommendations\n4. Integration with statutory databases for up-to-date legal norms\n5. Multilingual support for English and Hindi legal \n\n### Legal Researcher\nThe Legal Researcher agent conducts in-depth legal analysis on any topic provided by the user. It leverages advanced NLP and legal information retrieval techniques to deliver comprehensive insights, referencing relevant case laws, statutes, regulations, and academic opinions. Whether it's a broad legal principle or a niche subject, the system compiles detailed, well-structured findings to support legal understanding and decision-making.\n\nThe Legal Researcher includes:\n1. Deep-dive research on user-defined legal topics\n2. Compilation of relevant statutes, judgments, and commentariesStatute comparison across jurisdictions\n3. Smart summarization of lengthy legal texts\n4. Topic clustering and citation tracking\n5. Exportable research reports in structured formats\n\n### Case Status Tracker\nThe Case Status component integrates with the Indian court system's APIs to fetch real-time case information. It features an automated CAPTCHA solving mechanism using Selenium and ChromeDriver, with a fallback to a simpler CAPTCHA when needed. The component is built with internationalization support (i18n) for both English and Hindi interfaces.\n\nThe backend uses FastAPI to create endpoints that handle CNR number validation, CAPTCHA processing, and court data retrieval. The frontend presents this information in an intuitive timeline format, showing the progression of the case through various stages of the judicial process.\n\n### Document Analyzer\nThis component uses NLP techniques to process legal documents uploaded by users. It can handle various file formats including PDF and text files. The analyzer identifies key clauses, legal terminology, and potential compliance issues within documents.\n\nThe system employs a multi-stage processing pipeline:\n1. Text extraction from documents\n2. Legal entity recognition using custom-trained models\n3. Clause classification and categorization\n4. Risk assessment based on identified clauses\n5. Generation of plain-language summaries\n\nUsers can also ask specific questions about the document, with the system providing contextual answers based on the document's content.\n\n### Legal Chatbot\nThe conversational AI assistant provides guidance on legal matters through a chat interface. It supports both text and voice interactions, with speech recognition capabilities for accessibility. The chatbot is trained on Indian legal frameworks and can provide information on various legal topics.\n\nKey features include:\n- Context-aware responses that maintain conversation history\n- Integration with legal databases for accurate information\n- Clear disclaimers to distinguish between information and legal advice\n- Multilingual support with automatic language detection\n- Voice input/output for accessibility\n\n### Lawyer Search System\nThis geolocation-based system helps users find legal professionals based on specialty, location, and experience. It integrates mapping services to visualize lawyer locations and provides filtering options to narrow down search results.\n\nThe system includes:\n- Verified lawyer profiles with specialization information\n- User reviews and ratings\n- Distance-based search functionality\n- Appointment scheduling capabilities\n- Direct messaging between users and lawyers\n\n## Key Concepts and Technologies Used\n\n### Core Stack\n- **Frontend**: Next.js 14, React 18, Tailwind CSS for responsive UI\n- **Backend**: Python 3.11, FastAPI for high-performance API endpoints, Celery for task queuing\n- **Database**: PostgreSQL for relational data, Redis for caching\n- **AI/ML**: Hugging Face Transformers, SpaCy for NLP tasks\n- **Authentication**: JWT-based auth system with role-based access control\n\n### AI Technologies\n- **Natural Language Processing**: For document analysis and chatbot functionality\n- **Speech Recognition**: For voice input in the legal assistant\n- **Machine Learning**: For case outcome prediction and document classification\n- **Computer Vision**: For CAPTCHA solving in case status tracking\n\n### External APIs\n- **Court APIs**: Integration with Indian judicial system databases\n- **Mapping Services**: For lawyer geolocation features\n- **Language Models**: Integration with models like Gemini for advanced NLP tasks\n\n## Getting Started\n\n### Prerequisites\n- Node.js 18+ for frontend\n- Python 3.11 for backend services\n- PostgreSQL 15 for database\n- Chrome browser (for case status feature)\n- Docker and Docker Compose (recommended for easy setup)\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/your-org/NyayMitra.git\ncd NyayMitra\n\n# Frontend setup\nnpm install\n\n# Backend setup\ncd backend\npython -m venv venv\n\n# On Windows\nvenv\\Scripts\\activate\n\n# On Linux/Mac\nsource venv/bin/activate\n\npip install -r requirements.txt\n\n# Return to project root\ncd ..\n\n# Create .env file from example\ncp .env.example .env\n# Edit .env file to add your API keys\n```\n\n### Configuration\nCreate a `.env` file in the project root with the following variables:\n```\n# API Keys\nMAPBOX_API_KEY=your_mapbox_key\nGROQ_API_KEY=your_groq_key\nSUPREME_COURT_API_KEY=your_court_api_key\n\n# Database Configuration\nDATABASE_URL=postgresql://user:password@localhost:5432/nyaymitra\nREDIS_URL=redis://localhost:6379/0\n\n# Application Settings\nNEXT_PUBLIC_API_URL=http://localhost:8000\nNEXT_PUBLIC_ENABLE_SPEECH=true\n```\n\n### Running the Application\n\n#### Starting the Backend\n```bash\n# From the backend directory with virtual environment activated\nuvicorn app:app --host 0.0.0.0 --port 8000 --reload\n```\n\n#### Starting the Frontend\n```bash\n# From the project root\nnpm run dev\n```\n\n## System Architecture\n\n```mermaid\ngraph TD\n    User[User] --\u003e Frontend[Next.js Frontend]\n    Frontend --\u003e Auth[Authentication]\n    Frontend --\u003e Features[Feature Modules]\n    \n    Features --\u003e LegalAdvisor[Legal Advisor]\n    Features --\u003e LegalResearcher[Legal Researcher]\n    Features --\u003e CaseTracker[Case Status Tracker]\n    Features --\u003e DocAnalyzer[Document Analyzer]\n    Features --\u003e LegalChat[Legal Chatbot]\n    Features --\u003e LawyerSearch[Lawyer Search]\n    Features --\u003e ContractGen[Contract Generator]\n    \n    LegalAdvisor --\u003e FastAPI\n    LegalResearcher --\u003e FastAPI\n    CaseTracker --\u003e FastAPI[FastAPI Backend]\n    DocAnalyzer --\u003e FastAPI\n    LegalChat --\u003e FastAPI\n    LawyerSearch --\u003e FastAPI\n    ContractGen --\u003e FastAPI\n    \n    FastAPI --\u003e ExternalAPIs[External APIs]\n    FastAPI --\u003e AI[AI/ML Models]\n    FastAPI --\u003e DB[(Database)]\n    \n    ExternalAPIs --\u003e Courts[Court APIs]\n    ExternalAPIs --\u003e Maps[Mapping Services]\n    \n    AI --\u003e NLP[NLP Models]\n    AI --\u003e Speech[Speech Recognition]\n    AI --\u003e CV[Computer Vision]\n    \n    DB --\u003e PostgreSQL[(PostgreSQL)]\n    DB --\u003e Redis[(Redis Cache)]\n```\n\n## Project Directory Structure\n```\nNyayMitra/\n├── app/                 # Next.js application\n│   ├── api/             # API routes\n│   │   ├── case-status/  # Case status API endpoints\n│   │   ├── document-analyzer/ # Document analysis endpoints\n│   │   └── find-lawyer/ # Lawyer search endpoints\n│   ├── case-status/     # Case status feature\n│   ├── chatbot/         # Legal chatbot interface\n│   ├── contracts-draft/ # Contract generation\n│   ├── dashboard/       # User dashboard\n│   ├── document-analyzer/ # Document analysis UI\n│   ├── find-lawyer/     # Lawyer search interface\n│   ├── legal-assistance/ # Legal assistance hub\n│   └── pathway/         # Legal process visualization\n├── backend/             # Python services\n│   ├── app.py           # FastAPI entrypoint\n│   ├── requirements.txt # Python dependencies\n│   └── run.sh           # Backend startup script\n├── case-status-component/ # CNR lookup UI component\n├── components/          # Shared React components\n│   ├── legal-assistant/ # Legal assistance components\n│   │   ├── ContractDrafting.jsx\n│   │   ├── LegalAdvice.jsx\n│   │   └── LegalResearch.jsx\n│   ├── ui/              # UI component library\n│   └── Chatbot.jsx      # Chatbot component\n├── lib/                 # Shared utilities\n│   ├── hooks/           # Custom React hooks\n│   │   ├── useSpeechRecognition.js\n│   │   └── useSpeechSynthesis.js\n│   └── utils/           # Utility functions\n├── public/              # Static assets\n└── secrets/             # Configuration files (gitignored)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddihora1604%2Fnyaymitra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddihora1604%2Fnyaymitra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddihora1604%2Fnyaymitra/lists"}