A powerful legal document analysis tool designed to analyze rental agreements and identify potential issues. Built with a Python FastAPI backend and React frontend.
- Document Upload: Easily upload rental agreements for analysis
- Legal Analysis: Automatically analyze documents for potentially invalid or unusual clauses
- Essential Content Extraction: Identifies and extracts key information like parties, rental object, rent amount, and rental start date
- Vector-based Comparison: Uses advanced embedding techniques to compare with sample agreements and legal requirements
- AI-powered Analysis: Leverages OpenAI for intelligent document understanding
.
├── backend/ # Python FastAPI backend
│ ├── analysis/ # Document analysis engine
│ ├── api/ # API implementations
│ ├── utils/ # Utility functions
│ ├── main.py # Main FastAPI application
│ └── requirements.txt # Python dependencies
├── frontend/ # React frontend
│ ├── src/ # React source code
│ └── package.json # NPM dependencies
├── openapi/ # OpenAPI specification
│ └── openapi.yml # API specification
├── sample_data/ # Sample rental agreements
└── docker-compose.yml # Docker Compose configuration
- Docker and Docker Compose
- Python 3.8+
- Node.js 14+
- OpenAI API key
-
Copy the template environment file:
cp .env.template .env
-
Add your OpenAI API key to the
.envfile:OPENAI_API_KEY=your_api_key_here
Start the application with Docker Compose:
docker-compose upThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000/api
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.pycd frontend
npm install
npm run dev- FastAPI: High-performance API framework
- Sentence Transformers: For generating document embeddings
- ChromaDB: Vector database for similarity comparisons
- OpenAI API: For analyzing essential contract contents
- React: UI framework
- TypeScript: Type-safe JavaScript
- Vite: Fast build tooling