Skip to content

Understand, compare, and analyze US health insurance policies. Upload an SBC (Summary of Health and Benefits) and you'll be able to explore where you're covered and where you're in trouble.

License

Notifications You must be signed in to change notification settings

aaln/open-coverage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Open Coverage πŸ₯

Screenshot 2025-07-01 at 6 24 55β€―PM Screenshot 2025-07-01 at 6 25 01β€―PM

Democratizing health insurance decision-making through open-source tools

Website Deployed on Vercel Built with Next.js License: MIT

🌟 Why Open Coverage Exists

Health insurance is one of the most important financial decisions families make, yet the tools to analyze and compare policies are either:

  • Locked behind commercial paywalls πŸ”’
  • Built for brokers, not consumers πŸ’Ό
  • Overly simplified and unhelpful πŸ“Š
  • Biased toward specific insurers 🎯

Open Coverage changes this. We're building the first truly open-source ecosystem of health insurance tools that put consumers first. No vendor lock-in, no hidden agendas, no subscription feesβ€”just powerful, transparent tools that help you make the best healthcare decisions for your family.

πŸš€ Our Mission

To make health insurance analysis accessible, transparent, and free for everyone.

We believe that:

  • πŸ”“ Healthcare decisions should be transparent - You deserve to understand exactly how your policy works
  • πŸ› οΈ Tools should be built by and for the community - Open source means accountable, improvable software
  • πŸ’° Essential services shouldn't cost extra - Healthcare is expensive enough without paying for analysis tools
  • 🎯 Consumer interests come first - No insurer partnerships or broker commissions influencing recommendations

🎯 The Health Policy Analyzer

Our flagship tool - Upload your health insurance policy documents (Summary of Benefits and Coverage) and get:

  • πŸ“‹ Complete policy breakdown - Every benefit, clearly explained
  • πŸ” Side-by-side comparisons - Multiple policies analyzed simultaneously
  • πŸ‘₯ Personalized recommendations - Based on your family's actual health profile
  • πŸ’‘ Cost projections - Estimate your total annual healthcare expenses
  • πŸ€– AI-powered insights - Ask questions about your coverage in plain English

How It Works

  1. Upload your insurance policy documents (SBC/SPD files)
  2. Configure your family's health profile (conditions, medications, expected visits)
  3. Analyze - Our AI processes your documents and health needs
  4. Compare - See which policy saves you the most money
  5. Decide with confidence, backed by data

πŸ› οΈ Built With Modern Tech

  • Next.js 15 with App Router
  • TypeScript for type safety
  • Tailwind CSS + shadcn/ui for beautiful interfaces
  • Anthropic Claude & Groq for intelligent document analysis
  • @assistant-ui/react for AI chat interface
  • Zustand for state management
  • Zod for schema validation
  • PDF parsing for document processing
  • Vercel for deployment
  • Bun for fast JS runtime & package management

πŸ—οΈ Project Structure

app/
β”œβ”€β”€ actions/            # Server actions for AI operations
β”œβ”€β”€ analysis/           # Policy analysis pages
β”œβ”€β”€ analyze-compare/    # Policy comparison interface
β”œβ”€β”€ analyze-compare-v2/ # Enhanced comparison interface
β”œβ”€β”€ analyze-policy/     # Single policy analysis
β”œβ”€β”€ api/                # API endpoints
β”‚   β”œβ”€β”€ analyze-health-profile/
β”‚   β”œβ”€β”€ chat/          # AI-powered chat endpoint
β”‚   β”œβ”€β”€ health-suggestions/
β”‚   β”œβ”€β”€ search-treatment-cost/
β”‚   └── treatment-costs/
β”œβ”€β”€ compare-policies/   # Policy comparison tools
β”œβ”€β”€ cost-analysis/      # Healthcare cost analysis
β”œβ”€β”€ find-providers/     # Provider discovery
β”œβ”€β”€ health-profile/     # Family health management
β”œβ”€β”€ assistant.tsx       # AI chat component
β”œβ”€β”€ error.tsx          # Error handling pages
β”œβ”€β”€ global-error.tsx   # Global error boundary
β”œβ”€β”€ layout.tsx         # Root layout
β”œβ”€β”€ not-found.tsx      # 404 page
└── page.tsx           # Homepage

components/
β”œβ”€β”€ app-sidebar.tsx    # Navigation sidebar
β”œβ”€β”€ assistant-ui/      # Chat interface components
β”œβ”€β”€ error-boundaries/  # Error handling components
β”œβ”€β”€ health-profile/    # Health profile components
β”œβ”€β”€ ui/               # Reusable UI components (shadcn)
β”œβ”€β”€ policy-*.tsx      # Policy-specific components
β”œβ”€β”€ cost-analysis-summary.tsx
β”œβ”€β”€ healthcare-information-modal.tsx
β”œβ”€β”€ premium-input-modal.tsx
β”œβ”€β”€ profile-completeness.tsx
β”œβ”€β”€ risk-assessment-display.tsx
β”œβ”€β”€ treatment-cost-display.tsx
└── utilization-display.tsx

lib/
β”œβ”€β”€ services/              # Business logic and AI operations
β”‚   β”œβ”€β”€ insurance-ai-service.ts
β”‚   β”œβ”€β”€ policy-comparison-service.ts
β”‚   └── policy-service.ts
β”œβ”€β”€ hooks/                 # Utility hooks
β”‚   β”œβ”€β”€ use-health-ai.ts
β”‚   β”œβ”€β”€ use-screen-reader.tsx
β”‚   └── use-treatment-costs.ts
β”œβ”€β”€ analysis-store.ts      # Analysis state management
β”œβ”€β”€ enhanced-health-profile-store.ts
β”œβ”€β”€ health-profile-store.ts
β”œβ”€β”€ health-risk-assessment.ts
β”œβ”€β”€ insurance-calculator.ts
β”œβ”€β”€ medication-cost-calculator.ts
β”œβ”€β”€ pdf-utils.ts           # Document processing
β”œβ”€β”€ sbc-schema.ts          # Insurance document schemas
β”œβ”€β”€ treatment-cost-service.ts
β”œβ”€β”€ unified-analysis-service.ts
└── utilization-engine.ts

hooks/
β”œβ”€β”€ use-category-analysis.ts    # AI category management
β”œβ”€β”€ use-comparison-history.ts   # Comparison history
β”œβ”€β”€ use-healthcare-information.ts
β”œβ”€β”€ use-insurance-settings.ts   # Centralized settings
β”œβ”€β”€ use-mobile.ts              # Mobile detection
β”œβ”€β”€ use-situation-suggestions.ts # Healthcare suggestions
└── use-toast.ts               # Toast notifications

types/
β”œβ”€β”€ schemas.ts         # Consolidated Zod schemas
└── insurance.ts       # Type definitions

policy-templates/      # Sample policy templates

__tests__/            # Test files

Architecture Overview

The project follows a service-layer architecture pattern:

  • Service Layer First: All AI operations go through lib/services/
  • Type Safety: Zod schemas for all validation and type generation
  • Error Boundaries: Graceful degradation with AIErrorBoundary components
  • Custom Hooks: Single responsibility hooks for business logic
  • Multi-Model AI: Fallback strategies with Anthropic Claude and Groq models

πŸš€ Getting Started

Prerequisites

  • Bun (recommended) or Node.js 20+
  • API keys for Groq, Anthropic (for AI features)

Installation

# Clone the repository
git clone https://github.com/aaln/open-coverage.git
cd open-coverage

# Install dependencies
bun install

# Set up environment variables
cp .env.example .env.local
# Add your API keys to .env.local (see Environment Variables section below)

# Start development server
bun run dev

Visit http://localhost:3000 to see the app running.

Development Commands

bun run dev          # Start development server
bun run build        # Build for production
bun run start        # Start production server
bun run lint         # Run linter
bun run fetch:plans  # Fetch sample insurance plans

πŸ”§ Environment Variables

Create a .env.local file in the root directory with the following variables:

# AI Model APIs
GROQ_API_KEY=           # For Groq AI models
ANTHROPIC_API_KEY=      # For Claude models

# Document Processing
UNSTRUCTURED_API_KEY=   # For PDF parsing

# Storage & Background Jobs
BLOB_READ_WRITE_TOKEN=  # For file storage
TRIGGER_SECRET_KEY=     # For background jobs

# CMS.gov APIs (optional - for discovery features)
GOV_MARKETPLACE_API_KEY= # For Marketplace API
GOV_FINDER_API_KEY=      # For Finder API

Obtaining CMS.gov API Keys

Note: The discovery section of the site won't work if these keys aren't available.

To get API keys for the CMS Healthcare APIs:

  1. Visit CMS Developer Portal

  2. Click "Sign Up" to create a CMS Enterprise Portal account

  3. For Marketplace API (GOV_MARKETPLACE_API_KEY):

    • Navigate to "Marketplace API" section
    • Click "Request Access"
    • Fill out the application form
    • Submit and await approval
  4. For Finder API (GOV_FINDER_API_KEY):

    • Navigate to "Finder API" section
    • Click "Request Access"
    • Complete similar application process
    • Specify intended usage for finding private health plans

🀝 Contributing

We welcome contributions from developers, healthcare professionals, insurance experts, and anyone passionate about making healthcare more accessible!

Ways to Contribute

  • πŸ› Report bugs - Found an issue? Let us know!
  • πŸ’‘ Suggest features - Have ideas for improvement?
  • πŸ“ Improve documentation - Help others understand the project
  • πŸ”§ Submit code - Fix bugs or add new features
  • πŸ§ͺ Test policies - Try the tool with different insurance documents
  • πŸ“’ Spread the word - Help others discover Open Coverage

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test thoroughly
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Cursor IDE Integration

This project includes comprehensive Cursor IDE rules for enhanced development experience. The .cursor/rules/ directory contains:

  • Global Rules - Core development standards and architecture patterns
  • Server Actions - Guidelines for Next.js server actions
  • Self-Updating Rules - Dynamic rule system that adapts to project changes
  • Build Agent - Automated build, linting, and formatting

πŸ“Š Current Features

  • βœ… SBC Document Processing - Parse Summary of Benefits and Coverage documents
  • βœ… Health Profile Management - Store family health information securely
  • βœ… AI Chat Interface - Ask questions about your insurance in natural language
  • βœ… Policy Comparison - Side-by-side analysis of multiple policies
  • βœ… Responsive Design - Works on desktop, tablet, and mobile
  • βœ… Privacy-First - All data stored locally in your browser

πŸ”’ Privacy & Security

  • Local-first - Your health data never leaves your device
  • No tracking - We don't collect personal information
  • Open source - Audit our code anytime
  • No vendor lock-in - Export your data whenever you want

πŸ“œ License

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

Together, we're making healthcare decisions more transparent, accessible, and affordable for everyone.

About

Understand, compare, and analyze US health insurance policies. Upload an SBC (Summary of Health and Benefits) and you'll be able to explore where you're covered and where you're in trouble.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •