Skip to content

Piyush495/ClauseGuard

Repository files navigation

ClauseGuard 🛡️

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.


Features

  • 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.

Tech Stack


Getting Started

1. Prerequisites

Make sure you have Node.js installed on your machine.

2. Environment Setup

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"

3. Installation

Install the project dependencies:

npm install

4. Database Sync

Apply database schemas to your PostgreSQL database:

npx prisma db push

5. Running the Application

Start the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.


Project Structure

├── 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

About

ClauseGuard scans your rental agreement clause by clause and flags every term that's unfair, one-sided, or designed to trap you — before you sign.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages