Intelligent Contract Analysis Platform
Transform how legal professionals handle contracts with AI-powered analysis, risk assessment, and automated insights.
- β¨ Features
- π οΈ Tech Stack
- π Getting Started
- π― Usage
- π§ API Endpoints
- π Project Structure
- π€ Contributing
- Intelligent Document Processing: Upload PDF, DOCX, or TXT files
- Automatic Contract Type Detection: AI identifies contract types (Employment, NDA, Sales, etc.)
- Risk Assessment: Comprehensive risk analysis with severity levels
- Opportunity Identification: Discover potential benefits and advantages
- Key Clause Extraction: Automatically identify and highlight important clauses
- Overall Score: AI-generated contract favorability score (1-100)
- Visual Charts: Interactive charts and graphs for data visualization
- Detailed Reports: Comprehensive analysis reports with actionable insights
- Export Capabilities: Download analysis results in multiple formats
- OAuth2 Integration: Secure Google authentication
- Session Management: Robust session handling with Redis
- Data Encryption: End-to-end encryption for sensitive documents
- User Privacy: GDPR-compliant data handling
- Stripe Integration: Secure payment processing
- Subscription Plans: Free and premium tiers
- Usage Tracking: Monitor API usage and limits
- Next.js 15.2.4 - React framework with App Router
- React 19.0.0 - UI library
- TypeScript 5.8.2 - Type safety
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- Lucide React - Icon library
- React Query - Data fetching and caching
- Zustand - State management
- Node.js - JavaScript runtime
- Express.js - Web framework
- TypeScript - Type safety
- MongoDB - NoSQL database
- Mongoose - MongoDB ODM
- Redis - Caching and session storage
- Passport.js - Authentication middleware
- Google Gemini API - Advanced AI model for contract analysis
- PDF.js - PDF text extraction
- NLP Processing - Natural language processing
- Upstash Redis - Redis-as-a-Service
- MongoDB Atlas - Cloud database
- Stripe - Payment processing
- Resend - Email service
- Node.js (v18 or higher)
- npm or yarn
- MongoDB database
- Redis instance
- Google Gemini API key
- Stripe account (for payments)
-
Clone the repository
git clone https://github.com/SusmitBhamare/ClearClause.git cd ClearClause -
Install dependencies
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Set up environment variables
# Server (.env) GOOGLE_GENAI_API_KEY=your_gemini_api_key MONGODB_URI=your_mongodb_connection_string UPSTASH_REDIS_URL=your_redis_url UPSTASH_REDIS_TOKEN=your_redis_token CLIENT_URL=http://localhost:3000 PORT=8080 # Client (.env.local) NEXT_PUBLIC_API_URL=http://localhost:8080
-
Start the development servers
# Start server (from server directory) npm run dev # Start client (from client directory) npm run dev
-
Open your browser
- Frontend: http://localhost:3000
- Backend: http://localhost:8080
- Navigate to the dashboard
- Drag and drop your contract file (PDF, DOCX, TXT)
- Wait for AI analysis to complete
- View contract type detection
- Examine risk assessment with severity levels
- Review opportunity analysis
- Check overall favorability score
- Download comprehensive analysis report
- Share insights with team members
- Use data for contract negotiations
- Upgrade to premium for advanced features
- Monitor usage and billing
- Access priority support
POST /auth/google # Google OAuth login
GET /auth/current-user # Get current user
POST /auth/logout # Logout userPOST /contracts/detect-type # Detect contract type
POST /contracts/analyze # Analyze contract
GET /contracts/user-contracts # Get user's contracts
GET /contracts/contract/:id # Get specific contractPOST /payment/create-checkout-session # Create Stripe session
POST /payment/webhook # Stripe webhookClearClause/
βββ client/ # Next.js frontend
β βββ src/
β β βββ app/ # App Router pages
β β βββ components/ # React components
β β βββ hooks/ # Custom hooks
β β βββ interfaces/ # TypeScript interfaces
β β βββ lib/ # Utility functions
β β βββ providers/ # Context providers
β β βββ store/ # Zustand store
β βββ public/ # Static assets
β βββ package.json
βββ server/ # Express.js backend
β βββ src/
β β βββ config/ # Configuration files
β β βββ controllers/ # Route controllers
β β βββ middleware/ # Express middleware
β β βββ models/ # Mongoose models
β β βββ routes/ # API routes
β β βββ services/ # Business logic
β β βββ utils/ # Utility functions
β βββ package.json
βββ README.md