Skip to content

ApexYash11/Claimwise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

83 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ClaimWise

AI-Powered Insurance Policy Analysis Platform

Transform the way you understand and manage insurance policies with cutting-edge AI technology.


🌐 Live Demo

Experience ClaimWise in action:

πŸš€ Frontend: https://claimwise-fht9.vercel.app/
⚑ API Backend: https://claimwise.onrender.com/
πŸ“– API Documentation: https://claimwise.onrender.com/docs

Note: The backend may take 30-60 seconds to wake up on first visit (Render free tier cold start)


πŸ“‹ Overview

ClaimWise is a production-ready, enterprise-grade platform that revolutionizes insurance policy management through advanced AI analysis. Upload your insurance documents, receive comprehensive insights, compare coverage options, and interact with your policies through intelligent chat functionality.

Our platform combines modern web technologies with powerful AI models to deliver:

  • Instant Policy Analysis - Deep understanding of coverage, terms, and conditions
  • Smart Comparisons - Side-by-side policy evaluation with gap analysis
  • Interactive Chat - Natural language queries about your policies using RAG technology
  • Premium Optimization - Identify cost savings and coverage improvements
  • Renewal Management - Automated alerts and recommendations

✨ Core Features

🎯 User Features

  • πŸ” AI Policy Analysis - Comprehensive document breakdown with claim readiness scoring
  • πŸ“Š Multi-Policy Comparison - Side-by-side analysis with coverage gap identification
  • πŸ’¬ Document Chat - Interactive Q&A using Retrieval-Augmented Generation (RAG)
  • πŸ“ˆ Smart Insights - Premium optimization and coverage recommendations
  • πŸ“± Modern Interface - Responsive design with dark mode and accessibility features
  • πŸ”” Renewal Alerts - Automated notifications for policy expirations

βš™οΈ Technical Features

  • πŸ›‘οΈ Enterprise Security - JWT authentication with user data isolation
  • ⚑ High Performance - Advanced caching strategies and rate limiting
  • πŸ“Š Real-time Monitoring - System metrics and performance tracking
  • πŸ”„ Error Recovery - Comprehensive error handling with user guidance
  • πŸš€ Production Ready - Docker support with CI/CD pipeline integration
  • 🧠 Multi-LLM Support - Integration with Groq, Gemini, and OpenAI models

πŸ—οΈ Technology Stack

Frontend

Next.js 15 (App Router) + TypeScript
React 18 with Suspense & Server Components
Tailwind CSS + shadcn/ui Components
Supabase Client (Auth + Real-time)

Backend

FastAPI (Python 3.11+) with Async/Await
Supabase (PostgreSQL + Authentication)
AI/ML: Groq + Gemini + OpenAI
OCR: Tesseract + Poppler + pdf2image
Production: Caching + Rate Limiting + Monitoring

πŸ“ Project Structure

claimwise/
β”œβ”€β”€ πŸ“± frontend/                    # Next.js Application
β”‚   β”œβ”€β”€ app/                       # App Router
β”‚   β”‚   β”œβ”€β”€ (auth)/               # Auth pages (login, signup)
β”‚   β”‚   β”œβ”€β”€ dashboard/            # Main dashboard
β”‚   β”‚   β”œβ”€β”€ upload/               # Policy upload interface
β”‚   β”‚   β”œβ”€β”€ analyze/              # Analysis results
β”‚   β”‚   β”œβ”€β”€ chat/                 # AI chat interface
β”‚   β”‚   └── compare/              # Policy comparison
β”‚   β”œβ”€β”€ components/               # React Components
β”‚   β”‚   β”œβ”€β”€ ui/                   # shadcn/ui base components
β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication forms
β”‚   β”‚   β”œβ”€β”€ analysis/             # Policy analysis widgets
β”‚   β”‚   β”œβ”€β”€ chat/                 # Chat interface components
β”‚   β”‚   └── layout/               # Layout components
β”‚   β”œβ”€β”€ lib/                      # Utilities
β”‚   β”‚   β”œβ”€β”€ api.ts                # API client with retry
β”‚   β”‚   β”œβ”€β”€ auth.ts               # Auth helpers
β”‚   β”‚   └── supabase.ts           # Supabase config
β”‚   └── hooks/                    # Custom React hooks
β”‚
β”œβ”€β”€ ⚑ backend/                     # FastAPI Application
β”‚   β”œβ”€β”€ src/                      # Core Application
β”‚   β”‚   β”œβ”€β”€ main.py               # FastAPI app entry
β”‚   β”‚   β”œβ”€β”€ auth.py               # JWT authentication
β”‚   β”‚   β”œβ”€β”€ db.py                 # Database operations
β”‚   β”‚   β”œβ”€β”€ models.py             # Pydantic models
β”‚   β”‚   β”œβ”€β”€ routes.py             # API endpoints
β”‚   β”‚   β”œβ”€β”€ llm.py                # AI integrations
β”‚   β”‚   β”œβ”€β”€ rag.py                # RAG implementation
β”‚   β”‚   └── πŸš€ Production Features:
β”‚   β”‚       β”œβ”€β”€ exceptions.py     # Error handling
β”‚   β”‚       β”œβ”€β”€ monitoring.py     # Performance metrics
β”‚   β”‚       β”œβ”€β”€ caching.py        # Multi-strategy cache
β”‚   β”‚       β”œβ”€β”€ rate_limiting.py  # Request throttling
β”‚   β”‚       └── embeddings.py     # Vector embeddings
β”‚   β”œβ”€β”€ tests/                    # Test suite
β”‚   └── requirements.txt          # Dependencies
β”‚
└── πŸ“š docs/                       # Documentation
    β”œβ”€β”€ api/                      # Architectural & RAG reviews
    └── deployment/               # Deployment guides (TODO)

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ with pnpm
  • Python 3.11+ with pip
  • Supabase project configured
  • AI API keys (Groq, Gemini, OpenAI)

Backend Setup

# 1. Navigate to backend
cd backend

# 2. Create virtual environment
python -m venv .venv
# Windows
.\.venv\Scripts\Activate
# macOS/Linux
source .venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure environment
cp .env.example .env
# Edit .env with your API keys

# 5. Start development server
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000

βœ… Backend running at http://localhost:8000
πŸ“– API docs at http://localhost:8000/docs


Frontend Setup

# 1. Navigate to frontend
cd frontend

# 2. Install dependencies
pnpm install

# 3. Configure environment
cp .env.local.example .env.local
# Edit .env.local with your config
# For quick testing, use: NEXT_PUBLIC_API_URL=https://claimwise.onrender.com

# 4. Start development server
pnpm dev

βœ… Frontend running at http://localhost:3000
🌐 Or try the live demo: https://claimwise-fht9.vercel.app/


πŸ—„οΈ Database Schema

Core Tables

-- Users table (managed by Supabase Auth)
CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email VARCHAR UNIQUE NOT NULL,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

-- Policies table
CREATE TABLE policies (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
  policy_name VARCHAR NOT NULL,
  policy_number VARCHAR,
  provider VARCHAR,
  policy_type VARCHAR,
  extracted_text TEXT,
  file_path VARCHAR,
  analysis JSONB,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

-- Chat logs table  
CREATE TABLE chat_logs (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
  policy_id UUID REFERENCES policies(id) ON DELETE CASCADE,
  question TEXT NOT NULL,
  answer TEXT NOT NULL,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

πŸ› οΈ API Endpoints

πŸ” Authentication

POST /auth/login          # User login
POST /auth/refresh        # Refresh JWT token
GET  /auth/me             # Current user info

πŸ“„ Policy Management

POST /upload-policy       # Upload & process policy
GET  /policies            # List user policies
GET  /policies/{id}       # Get specific policy
DELETE /policies/{id}     # Delete policy

🧠 AI Analysis

POST /analyze-policy      # Comprehensive analysis
POST /compare-policies    # Multi-policy comparison
POST /chat               # Interactive Q&A
GET  /analysis/{id}      # Cached analysis results

πŸ“Š Monitoring

GET  /health             # System health check
GET  /metrics            # Performance metrics
GET  /cache/stats        # Cache performance

Example API Usage

# Test the live API
curl https://claimwise.onrender.com/health

# Upload policy (requires authentication)
curl -X POST "https://claimwise.onrender.com/upload-policy" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "file=@policy.pdf" \
  -F "policy_name=My Policy"
// POST /analyze-policy
{
  "policy_id": "uuid-here",
  "analysis_type": "comprehensive"
}

// Response
{
  "policy_id": "uuid-here",
  "analysis": {
    "policy_type": "Health Insurance",
    "provider": "Example Insurance Co.",
    "premium": "$250/month",
    "coverage_amount": "$1,000,000",
    "deductible": "$2,500",
    "key_features": ["Emergency Care", "Preventive Services"],
    "claim_readiness_score": 85
  },
  "insights": {
    "coverage_gaps": [],
    "cost_optimization": "Consider higher deductible for 15% savings"
  }
}

πŸš€ Deployment

Live Production URLs

βœ… Frontend (Vercel): https://claimwise-fht9.vercel.app/
βœ… Backend (Render): https://claimwise.onrender.com/
πŸ“š API Docs: https://claimwise.onrender.com/docs


Backend Deployment (Render)

# 1. Environment Variables (Set in Render Dashboard)
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_KEY=your-service-role-key
GROQ_API_KEY=your-groq-key
GEMINI_API_KEY=your-gemini-key
ALLOWED_ORIGINS=https://claimwise-fht9.vercel.app

# 2. Deploy command
git push origin main  # Auto-deploys to Render

Frontend Deployment (Vercel)

# 1. Environment Variables (Set in Vercel Dashboard)
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
NEXT_PUBLIC_API_URL=https://claimwise.onrender.com

# 2. Deploy command
vercel --prod  # Or push to main branch for auto-deploy

Docker Deployment

# docker-compose.yml
version: '3.8'
services:
  backend:
    build: ./backend
    ports:
      - "8000:8000"
    environment:
      - SUPABASE_URL=${SUPABASE_URL}
      - SUPABASE_KEY=${SUPABASE_KEY}
  
  frontend:
    build: ./frontend
    ports:
      - "3000:3000"
    environment:
      - NEXT_PUBLIC_API_URL=http://backend:8000
# Deploy with Docker
docker-compose up -d

πŸ§ͺ Testing

Backend Testing

cd backend
source .venv/bin/activate

# Run all tests with coverage
pytest tests/ -v --cov=src --cov-report=html

# Run specific test categories
pytest tests/test_auth.py -v
pytest tests/test_analysis.py -v
pytest tests/test_chat.py -v

Frontend Testing

cd frontend

# Unit tests
pnpm test

# E2E tests
pnpm test:e2e

# Type checking
pnpm type-check

# Linting
pnpm lint

🀝 Contributing

We welcome contributions! Here's how to get started:

Development Process

  1. Fork the repository and create a feature branch
  2. Set up development environment using the Quick Start guide
  3. Make your changes with proper tests and documentation
  4. Run the test suite to ensure everything works
  5. Submit a pull request with a clear description

Code Standards

  • Backend: Black formatting, type hints, comprehensive tests
  • Frontend: TypeScript strict mode, ESLint, Prettier formatting
  • Commits: Conventional Commits format
  • Documentation: Update README and API docs for new features

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘₯ Team

ClaimWise is built and maintained by a dedicated team of developers, AI engineers, and insurance domain experts.


πŸ“ž Support

Get Help


ClaimWise – Empowering users with AI-driven insurance insights. πŸ›‘οΈ

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors