ClauseGuard is an AI-powered rental agreement analyzer and negotiation assistant built with Next.js. It helps tenants understand lease documents, flags unfair or one-sided clauses, and provides actionable counter-proposals to negotiate fairer terms with landlords.
- AI-Powered Rental Scanning: Scan upload or pasted rental agreements to detect unfair, one-sided, or illegal clauses.
- Tenant Friendliness Score: Get an instant evaluation of how favorable the lease is to you versus the landlord.
- Visual Risk Breakdowns: Highlighted original text side-by-side with risk analysis (High, Medium, and Low severity flags).
- Negotiation Assistant Agent: Drafts professional email templates and counter-proposals to send to landlords citing local rent rules or market standard practices.
- Scan History: Save your agreement analyses securely to reference or compare later.
- Framework: Next.js 16 (App Router)
- Database ORM: Prisma
- Database: PostgreSQL (via Neon DB)
- Styling: Tailwind CSS v4
- Language: TypeScript
Make sure you have Node.js installed on your machine.
Create a .env file in the root directory (or use the existing one) and add the following variables:
DATABASE_URL="your-postgresql-connection-string"
GEMINI_API_KEY="your-gemini-api-key"Install the project dependencies:
npm installApply database schemas to your PostgreSQL database:
npx prisma db pushStart the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
├── app/ # Next.js App Router (pages, layout, actions)
│ ├── scan/[id]/ # Interactive analysis dashboard
│ ├── layout.tsx # Global layout & fonts
│ ├── page.tsx # Landing page & file uploader
│ └── globals.css # Tailwind CSS styles
├── lib/ # Shared services (DB client, LLM analyzer agent)
├── prisma/ # Database schemas & configurations