⚖️ Automated legal document auditing powered by AI
Demo • Features • Architecture • Quick Start • Documentation
A professional, cloud-native platform for instant legal document risk analysis. Upload contracts, NDAs, or agreements and receive structured risk assessments in seconds—no legal expertise required.
Built for:
- 🧑💼 Freelancers reviewing client contracts
- 🏢 Small business owners vetting vendor agreements
- ⚖️ Legal professionals conducting first-pass audits
- Instant Risk Detection – AI identifies hidden liabilities, unfair clauses, and compliance issues
- Severity Classification – Color-coded ratings (High/Medium/Low) with contextual explanations
- Multi-Format Support – Process PDFs and images (JPG/PNG) via OCR
- Cross-Platform – Native mobile app + responsive web dashboard
- Secure & Private – User-isolated S3 storage with AWS Cognito authentication
Built with a professional Heritage Navy (#0F172A) and Brand Amber (#B45309) color palette for authority and action.
┌─────────────┐ ┌──────────────┐
│ Mobile │ │ Web │
│ (Flutter) │ │ Dashboard │
└──────┬──────┘ └──────┬───────┘
│ │
└───────────┐ ┌────────┘
▼ ▼
┌──────────────────────────────────────────────────────────────┐
│ AWS Infrastructure │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
│ │ Cognito │ │ S3 │ │ Lambda │ │ Gemini 2.5 │ │
│ │ Auth │ │ Storage │ │ Python │ │ Flash (API) │ │
│ └─────────┘ └─────────┘ └─────────┘ └──────────────┘ │
└──────────────────────────────────────────────────────────────┘
| Component | Technology | Purpose |
|---|---|---|
| Mobile | Flutter (Dart) | Cross-platform native app |
| Web | HTML5 + Bootstrap 5 | Static dashboard |
| Backend | AWS Lambda (Python 3.12) | Serverless compute |
| AI | Google Gemini 2.5 Flash | Legal text analysis |
| Auth | AWS Cognito | User authentication |
| Storage | Amazon S3 | Document storage |
| Validation | Pydantic | JSON schema enforcement |
-
Download the APK
Get the latest release:LegalRisk_v1.0.apk -
Install
Follow the installation guide -
Launch
Open the app, sign up, and start analyzing documents
Requirements: Android 5.0+ (API 21), 150MB storage, internet connection
-
Configure AWS
Copyweb/.env.exampleand fill in your credentials -
Launch Locally
cd web/
open index.html
# Or use a local server:
python -m http.server 8000- Deploy to S3 (Optional)
aws s3 sync web/ s3://your-bucket-name --exclude "*.md"- Create Lambda Layer
cd backend/lambda/
pip install -t python/ google-generativeai pydantic boto3
zip -r layer.zip python/- Deploy Function
zip -r function.zip lambda_function.py models.py prompt.py
aws lambda update-function-code --function-name RiskAnalyzer --zip-file fileb://function.zip- Set Environment Variables
aws lambda update-function-configuration \
--function-name RiskAnalyzer \
--environment Variables="{GEMINI_API_KEY=your_key,S3_BUCKET_NAME=your_bucket}"ai-legal-risk-analyzer/
├── app/ # Flutter mobile application
│ ├── lib/ # Dart source code
│ ├── android/ # Android build config
│ └── README.md # Mobile setup guide
├── web/ # Static web dashboard
│ ├── dashboard.html # Main workspace
│ └── README.md # Web deployment guide
├── backend/ # AWS Lambda functions
│ ├── lambda/ # Python source code
│ ├── iam-policies/ # Security policies
│ └── README.md # Backend deployment guide
├── releases/ # Pre-built APK files
│ └── CHANGELOG.md # Version history
├── docs/ # Documentation assets
│ ├── architecture.png # The Handshake Diagram
│ └── screenshots/ # UI gallery
└── README.md # You are here
| Document | Description |
|---|---|
| Mobile App Guide | Flutter setup, build instructions, ProGuard config |
| Web Dashboard Guide | HTML deployment, AWS SDK integration |
| Backend Guide | Lambda deployment, IAM policies, AI logic |
| Installation Instructions | APK installation steps |
| Changelog | Version history and release notes |
- Zero-Trust Architecture – Users can only access their own documents
- IAM Least Privilege – Lambda has minimal S3 permissions
- Encrypted Transit – All data sent via HTTPS
- No API Keys in Code – Credentials managed via Cognito temporary tokens
- Audit Trail – Full CloudWatch Logs for all operations
See Security Documentation for details.
✅ Stable AI Output – Pydantic schema validation ensures 100% UI reliability
✅ Mobile Optimization – R8/ProGuard shrinking reduced APK from 120MB → 70MB
✅ User Isolation – S3 bucket policies enforce Cognito-based path restrictions
✅ Design System – Consistent Heritage Navy + Brand Amber branding across platforms
✅ Serverless Scale – Lambda auto-scales from 0 to 1000+ concurrent requests
Common issues and solutions:
| Issue | Solution |
|---|---|
| Mobile app won't install | Ensure Android 5.0+, enable "Unknown sources" |
| Web dashboard login fails | Check Cognito User Pool ID in web/ config |
| Lambda timeout errors | Increase timeout to 30s in AWS Console |
| Gemini API quota exceeded | Upgrade to paid tier in Google AI Studio |
More help: Open an issue
- iOS mobile app
- Multi-page PDF support
- Document analysis history
- Export reports as PDF
- Biometric authentication
- Dark mode UI
See full roadmap
This project is licensed under the MIT License - see LICENSE for details.
D Ram Prahasith Sharma
MSc Data Science, DAU
📧 Email: [ramprahasith01@gmail.com]
🔗 LinkedIn: [https://www.linkedin.com/in/ram-prahasith-sharma-87a8662a6/]
🐙 GitHub: Prahas2001
- Google AI Studio for Gemini API access
- AWS for cloud infrastructure
- Flutter Team for the cross-platform framework
⭐ Star this repo if you found it helpful!
© 2026 D Ram Prahasith Sharma. All rights reserved.