AI legal document assistant used by advocates to edit agreements and avoid manual errors. The system analyzes uploaded agreements, provides clause-level suggestions, and generates an updated document that solves a real problem in legal drafting and customization.
- Upload a .docx legal template or choose a template from the library.
- Provide base details via a guided form (e.g., licensor, licensee, period, rent).
- Describe a case scenario; the AI returns clause-level suggestions: MODIFY, ADD, or REMOVE.
- Review, accept, reject, or edit suggestions, then generate a final .docx agreement.
Advocates and legal professionals spend time manually editing agreements and are prone to drafting errors. LegalEase automates clause analysis and drafting, reducing manual effort and minimizing human error while producing a ready-to-use agreement.
LegalEase/
├── frontend/ # React UI (App.js)
├── backend/ # Flask API (main.py)
├── venv/ # Python virtual environment
└── README.html
- Frontend: React (Tailwind utility classes in UI), react-datepicker, file-saver, lucide-react icons
- Backend: Python Flask
- AI: Google Gemini via google.generativeai
- Document handling: python-docx
- Dev: REST API between frontend and backend
- User uploads or selects a .docx template.
- User fills base details and describes a scenario in the UI.
- Frontend sends the document, scenario and form data to the backend API.
- Backend parses the .docx into clauses, calls Gemini to get structured suggestions, and returns those suggestions to the UI.
- User reviews suggestions; accepted suggestions are applied to the original .docx and a new document is generated and downloaded.
Basic steps to run locally:
# Backend (python) cd backend python -m venv venv # activate venv, then pip install -r requirements.txt # create .env with GEMINI_API_KEY python main.py # runs Flask on port 5001
cd frontend npm install npm start # runs React dev server on port 3000
Backend expects templates in a local templates/ directory. Frontend communicates with backend at http://localhost:5001.
- Requires a valid
GEMINI_API_KEYin.envfor AI suggestions. - Current prototype supports a specific template in the frontend; extend template support by updating the React form schema and backend parsing as needed.
- New clauses are appended to the document; paragraph styles are preserved where possible by
python-docx.
Repository maintained by the project author. For setup questions, refer to main.py and App.js.