Empowering businesses with AI-powered legal contract analysis for better decision-making
Lexi-Guide is a comprehensive AI-powered legal contract analysis platform designed for businesses, freelancers, and professionals. It leverages Google Gemini AI to provide intelligent contract review with personalized insights based on user roles and jurisdictional requirements.
- 15+ Country Support: India, USA, UK, Germany, France, Canada, Australia, Japan, Singapore, UAE, China, Brazil, and more
- Country-Specific Legal Context: Tailored analysis based on local laws and regulations
- Custom Country Input: Support for any global jurisdiction
- π¨βπ Student: Academic projects, internships, part-time work protection
- πΌ Freelancer: Project scope, payment terms, IP rights, scope creep protection
- π’ Client: Service quality, deliverables, confidentiality protection
- π Startup: Cost-effective terms, scalability, investor-friendly agreements
- π Vendor: Sustainable terms, payment security, relationship building
- βοΈ Legal Professional: Comprehensive risk assessment, compliance
- Google Gemini 2.0 Flash: Latest AI model for superior legal understanding
- Legal Safety Index: Numerical risk scoring (0-100 scale)
- Clause-by-Clause Breakdown: Detailed analysis of each contract section
- Risk Classification: High/Medium/Low/None risk categories
- Smart Suggestions: AI-generated alternative clauses for risk mitigation
- π Upload Contract: Drag and drop or select your contract file (PDF, DOCX, TXT)
- π€ AI Analysis: Our AI analyzes based on your role and jurisdiction
- π Get Insights: Receive detailed risk assessment and smart suggestions
- PDF Processing: Extract and analyze PDF contracts
- DOCX Support: Microsoft Word document analysis
- TXT Files: Plain text contract review
- Drag & Drop Interface: Intuitive file upload experience
- React 18 with TypeScript support
- Tailwind CSS for responsive design
- Framer Motion for smooth animations
- React Router with future flags
- React Dropzone for file uploads
- FastAPI for high-performance API
- Python 3.11+ with async support
- Pydantic for data validation
- Google Generative AI integration
- CORS-enabled for web security
- Suraj Mishra - Project Lead & AI Developer
- Disha - Frontend Developer
- Vaibhav - Backend Developer
- Kashish - Product Designer
- Python 3.11+
- Node.js 16+
- npm or yarn
- Google Gemini API key
# Clone the repository
git clone https://github.com/yourusername/lexi-guide.git
cd lexi-guide
# Create virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1 # Windows
# source .venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Create .env file
cp .env.example .env
# Add your GEMINI_API_KEY to .env file
# Run backend server
python backend.py# Navigate to React app
cd react
# Install dependencies
npm install
# Run development server
npm startCreate a .env file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_here
PORT=8000
DEBUG=TrueGET /POST /analyze
Content-Type: application/json
{
"contract_text": "Your contract text here...",
"user_role": "freelancer",
"country": "India",
"user_id": "optional"
}Response:
{
"legal_safety_index": {
"score": 45,
"justification": "Brief explanation considering role and country context"
},
"clauses": [
{
"clause_title": "Payment Terms",
"original_text": "Original clause text",
"risk_level": "High",
"impact_first_explanation": "Country and role-specific explanation",
"safer_suggestion": "Jurisdiction-appropriate alternative"
}
]
}- Push code to GitHub
- Connect to Railway
- Add environment variables
- Deploy automatically
- Build the React app:
npm run build - Deploy to Netlify
- Set environment variables
- Connect custom domain (optional)
For detailed deployment instructions, see DEPLOYMENT_GUIDE.md
- Environment variables for API keys
- CORS protection
- Input validation and sanitization
- Rate limiting (production)
- HTTPS enforcement (production)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Email: iamsuraj187104@gmail.com
- Project Lead: Suraj Mishra
- Location: Bangalore, Karnataka, India
- Google Gemini AI for powerful language understanding
- React and FastAPI communities for excellent frameworks
- Legal experts who provided domain knowledge
- Open source community for inspiration and tools
β Star this repository if you find it helpful!



.png)