Skip to content

Repository files navigation

ClaimForge

Insurance claims intake helper — upload PDFs or paste FNOL / ACORD-style text, extract key fields in the browser, flag missing required info, and export a structured summary. Optional Cloudflare Workers AI for smarter field mapping and scan OCR.

Live: claimforge.jasonreis.dev (when deployed)
Source: github.com/jreis/claimforge

Why

Brokers, small carriers, and freelancers still re-key claim docs by hand. ClaimForge is a local-first MVP that:

  1. Extracts text from PDFs (PDF.js) or plain text
  2. Heuristically maps labels → claim fields (policy #, DOL, carrier, etc.)
  3. Scores intake completeness (required fields weighted)
  4. Lets you edit fields and export Markdown / template / JSON
  5. Opt-in AI — Workers AI text extract + vision OCR (consent required)

Built as a portfolio product for senior SE / insurance-domain work — same craft bar as DJ Vault.

Stack

Layer Choice
UI React 19 + TypeScript + Vite 8
Styles Tailwind CSS 4
State Zustand (theme only persisted — claim data stays session-local)
PDF pdfjs-dist in the browser
AI Cloudflare Workers AI via Pages Functions
Host Cloudflare Pages (wrangler.toml)

Features

Always free / local

  • PDF + .txt upload / drag-drop
  • Paste modal for email / form dumps
  • Demo claim (synthetic commercial auto FNOL)
  • Heuristic field extractors + editable grid
  • Completeness panel + Markdown / template / JSON export

Opt-in AI (Workers AI Neurons)

  • AI extract fields — text model maps messy docs → structured JSON
  • OCR scan — vision model on up to 3 pages for image-only PDFs
  • Explicit consent checkbox (not persisted across sessions)
  • Soft rate limit (~20/hr/IP), text cap 24k chars, kill switch AI_ENABLED=false

Not yet

  • Risk flagging / coverage checks
  • Accounts / freemium exports
  • Multi-doc claim packaging
  • Tesseract client-side OCR fallback

Privacy

Path Where data goes
Heuristic extract Browser only
Theme preference localStorage only
Claim docs / fields Session memory only (not persisted)
AI extract / OCR Leaves browser → Cloudflare Workers AI (consent required)

Do not upload regulated PHI/PII you cannot send to a cloud model. No BAA in this portfolio MVP.

Develop

npm install
npm run dev

AI routes in local Vite:

Endpoint Without CF credentials With .env.local CF token
POST /api/ai/extract Local heuristics fallback Llama 3.2 3B via REST
POST /api/ai/ocr 503 Llama 3.2 11B Vision
GET /api/ai/status Reports mode hasBinding: true

Copy .env.example.env.local and set CLOUDFLARE_ACCOUNT_ID + CLOUDFLARE_API_TOKEN (Workers AI Run) for real OCR/local model calls.

npm run build    # tsc + vite → dist/
npm run preview  # static only — Functions need Pages/wrangler
npm run lint

Deploy (Cloudflare Pages)

  1. Connect repo jreis/claimforge
  2. Build: npm run build · Output: dist
  3. Ensure wrangler.toml AI binding ([ai] binding = "AI") is applied, or add Workers AI binding AI in Dashboard → Functions
  4. Optional env: AI_ENABLED=false to hard-disable AI
  5. Custom domain: claimforge.jasonreis.dev

Pages deploys the functions/ directory automatically with the site.

public/_redirects SPA fallback: /* → /index.html (API routes are handled by Functions first).

Cost notes

  • Free: 10,000 Neurons/day on Workers AI
  • Overage: ~$0.011 / 1k Neurons; Paid Workers from $5/mo to exceed free AI allocation
  • Text extract is cheap; OCR (vision per page) is the main cost driver — hard-capped at 3 pages

Project layout

src/
  components/     # UI including AiAssistPanel
  lib/            # pdfExtract, pdfRender, fieldExtractors, aiApi, …
  store/          # claim + toast stores
  types.ts
functions/
  api/ai/         # extract, ocr, status
  _lib/           # shared AI config + parse + run
scripts/
  ai-dev-api.ts   # Vite middleware for local /api/ai/*

Field set

Identification, parties, loss details, financial, contacts, evidence — see FIELD_META in src/types.ts. Required fields drive most of the completeness score.

License

Private / portfolio unless noted otherwise.

About

Local-first insurance claims intake helper — PDF/text extraction, field mapping, completeness scoring, structured export.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages