Post-purchase insurance intelligence for the Indian market.
Most Indians buy insurance and then forget about it — until they need to file a claim and discover their policy doesn't cover what they thought it did. InsureIQ fixes that: upload your policy PDFs, get a coverage score, simulate claim outcomes before they happen, and find products that plug your gaps.
This project started as a quick Razorpay integration fix for a side project. While debugging payment flows, I kept running into a frustrating pattern: people were paying ₹30,000–₹50,000/year in insurance premiums for policies they didn't understand. The Razorpay fix took 20 minutes. The insurance problem took longer to get out of my head.
InsureIQ is what came out of that itch.
| Feature | Description |
|---|---|
| Policy Vault | Upload PDFs or enter manually. Gemini AI extracts coverage details, exclusions, waiting periods, and sub-limits automatically. |
| Coverage Score | Rules-based engine scores your health, life, vehicle, and home coverage from 0–100 against Indian actuarial benchmarks. |
| Gap Analysis | Identifies critical, major, and minor gaps in your coverage. Streams a personalized AI explanation via SSE. |
| Claim Simulator | Describe a scenario, get a COVERED / PARTIAL / REJECTED verdict with clause-level reasoning — before you file. |
| Recommendations | Matched insurance products from real Indian insurers, filtered by your budget and coverage gaps. |
| Family Coverage | Track policies across family members, not just yourself. |
┌─────────────────────────────────────────────────────────┐
│ Browser (Next.js 16) │
│ Login/Signup → Dashboard → Vault → Gaps → Simulator │
│ SSE streaming for gap analysis + claim simulation │
└────────────────────┬────────────────────────────────────┘
│ HTTPS + Bearer JWT
┌────────────────────▼────────────────────────────────────┐
│ Go Backend (Chi router) │
│ Railway (iad region) │
│ │
│ /auth/* JWT auth (HS256, 7-day expiry) │
│ /me/profile Profile + risk appetite │
│ /me/family Family member management │
│ /me/policies Policy CRUD + PDF upload │
│ /me/score Coverage scoring engine │
│ /me/score/explain SSE gap explanation (Gemini) │
│ /me/policies/:id/simulate SSE claim sim (Gemini) │
│ /me/recommendations Gap-matched product search │
└──────┬─────────────────────┬───────────────────────────┘
│ │
┌──────▼──────┐ ┌────────▼────────┐
│ Supabase │ │ Google Gemini │
│ PostgreSQL │ │ 2.0 Flash │
│ + Storage │ │ PDF extraction │
│ (PDF PDFs) │ │ + SSE streams │
└─────────────┘ └─────────────────┘
- Email/password: bcrypt (cost 12) + constant-time login to prevent email enumeration
- Google OAuth: GSI One Tap → ID token → backend verifies via Google tokeninfo API → issues JWT
Pure functions, no ML. Benchmarks tuned for Indian market:
- Health: Coverage ratio vs city-tier benchmark (10L metro / 7L tier-2 / 5L tier-3) + CI rider bonus + waiting period score
- Life: Coverage vs 10x annual income benchmark + term vs endowment multiplier
- Vehicle: Comprehensive vs third-party detection + add-on count
- Home: Binary (covered / not covered)
Gap analysis and claim simulation use Server-Sent Events (SSE). The Go backend streams Gemini's response token-by-token. The frontend consumes it via an async generator — no WebSockets, no polling.
Backend
- Go 1.25 + Chi v5
- pgx/v5 (PostgreSQL driver + connection pooling)
- golang-jwt/jwt v5
- google/generative-ai-go (Gemini 2.0 Flash)
- Deployed on Railway
Frontend
- Next.js 16 (App Router, TypeScript)
- Tailwind CSS v4 (CSS-first, no config file)
- js-cookie for JWT storage
- Google GSI for OAuth
- Deployed on Vercel
Infrastructure
- Supabase: PostgreSQL + object storage (policy PDFs)
- Google Gemini Flash: PDF extraction + streamed AI analysis
- Railway: Go backend container (Dockerfile, 256MB)
- Vercel: Next.js frontend (edge CDN)
users
└── profiles (1:1)
├── family_members (1:N)
└── policies (1:N)
├── policy_coverage (1:1)
└── policy_members (N:M → family_members)
coverage_scores (latest score per profile)
insurance_products (seeded: 15 real Indian products)
Prerequisites: Go 1.25+, Node.js 20+, PostgreSQL (or Supabase account)
git clone git@github.com:BREACH1247/InsureIQ.git
cd InsureIQBackend
cd backend
cp .env.example .env # fill in your keys
go run .Frontend
cd web
cp .env.example .env.local # set NEXT_PUBLIC_API_URL=http://localhost:8080
npm install
npm run devDatabase
psql $DATABASE_URL -f db/migrations/001_initial.sql
psql $DATABASE_URL -f db/seeds/products.sqlBackend (.env)
PORT=8080
DATABASE_URL=postgresql://...
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_SERVICE_KEY=...
GEMINI_API_KEY=...
JWT_SECRET=...
FRONTEND_URL=http://localhost:3000
GOOGLE_CLIENT_ID=...
Frontend (.env.local)
NEXT_PUBLIC_API_URL=http://localhost:8080
NEXT_PUBLIC_GOOGLE_CLIENT_ID=...
Backend → Railway
- Connect GitHub repo, set root directory to
backend - Railway auto-detects Dockerfile
- Set all backend env vars in the Variables tab
Frontend → Vercel
cd web && vercel --prodSet NEXT_PUBLIC_API_URL and NEXT_PUBLIC_GOOGLE_CLIENT_ID in Vercel project settings.
InsureIQ/
├── backend/
│ ├── internal/
│ │ ├── auth/ # JWT + bcrypt
│ │ ├── config/ # Env loading
│ │ ├── gemini/ # Gemini client + PDF extraction
│ │ ├── handlers/ # HTTP handlers (auth, profile, policy, scoring, SSE)
│ │ ├── scoring/ # Rules-based coverage engine
│ │ ├── sse/ # SSE writer helper
│ │ └── storage/ # Supabase storage client
│ ├── Dockerfile
│ └── main.go
├── web/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # Shared UI components
│ └── lib/ # API client + types
└── db/
├── migrations/
└── seeds/
- Push notifications for policy renewals (60-day warning)
- OCR fallback for scanned/image PDFs
- Premium payment tracking
- Multi-language support (Hindi, Tamil, Telugu)
- IRDAI product database integration for live pricing