# bhuvank143/claimgaurdai architecture

> Architecture diagram of the GitHub repository bhuvank143/claimgaurdai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhuvank143/claimgaurdai
- Repository: https://github.com/bhuvank143/claimgaurdai

## Overview

ClaimGuard is a multi-line insurance FNOL investigation and triage platform. Customers submit claims and evidence through the web interface; the backend registers submissions, investigates relevant evidence and coverage, and presents findings, evidence requests, and a handler-tier recommendation in an operations workspace. The README describes motor, property, and gadget-specific vision, adaptive evidence recovery, cross-claim matching, and weather checks. The backend is concentrated in one large module, so its distinct responsibilities are shown as separate nodes sharing that source path. The duplicated `claimguard/` tree is not mapped separately. Some feature relationships are documented in the README rather than visible in the excerpts.

Main entry points: [`backend/main.py`](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py) (Investigation Loop), [`frontend/app.js`](https://github.com/bhuvank143/claimgaurdai/blob/main/frontend/app.js) (Claim Intake UI), [`claimguard/data/claimguard.db`](https://github.com/bhuvank143/claimgaurdai/blob/main/claimguard/data/claimguard.db) (Claim Database), [`backend/media.py`](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/media.py) (Media Processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_frontend["Claim Intake UI<br/>[app.js]"]
  node_workspace["Operations Workspace<br/>[app.js]"]
end

subgraph group_investigation["Claim Investigation"]
  node_api["Claims API<br/>[main.py]"]
  node_triage["Investigation Loop<br/>[main.py]"]
  node_motor["Accident Vision<br/>[main.py]"]
  node_property["Property Vision<br/>[main.py]"]
  node_gadget["Gadget Vision<br/>[main.py]"]
  node_crossclaim["Cross-Claim Matching<br/>[main.py]"]
  node_weather["Weather Verification<br/>[main.py]"]
  node_tier["Handler Tier Recommendation<br/>[main.py]"]
end

subgraph group_evidence["Evidence and Recovery"]
  node_media["Media Processing<br/>[media.py]"]
  node_navigator["Evidence Navigator<br/>[main.py]"]
  node_uploads["Claim Evidence Files"]
end

subgraph group_coverage["Policy and Persistence"]
  node_policies["Policy Verification<br/>[policy_docs.py]"]
  node_database[("Claim Database<br/>[claimguard.db]")]
end

node_customer(("Customer"))
node_ai{{"AI Provider"}}
node_handler(("Claims Handler"))

node_customer -->|"submits claim"| node_frontend
node_frontend -->|"posts claim"| node_api
node_api -->|"processes uploads"| node_media
node_api -.->|"stores evidence"| node_uploads
node_api -.->|"records claim"| node_database
node_api -->|"runs investigation"| node_triage
node_triage -->|"dispatches motor"| node_motor
node_triage -->|"dispatches property"| node_property
node_triage -->|"dispatches gadget"| node_gadget
node_triage -->|"matches claims"| node_crossclaim
node_triage -->|"checks weather"| node_weather
node_triage -->|"verifies coverage"| node_policies
node_triage -.->|"requests analysis"| node_ai
node_triage -->|"requests missing evidence"| node_navigator
node_navigator -.->|"tracks requests"| node_database
node_navigator -->|"requests uploads"| node_customer
node_triage -->|"recommends tier"| node_tier
node_frontend -->|"opens claim view"| node_workspace
node_workspace -->|"fetches claim"| node_api
node_workspace -->|"presents findings"| node_handler

click node_frontend "https://github.com/bhuvank143/claimgaurdai/blob/main/frontend/app.js"
click node_workspace "https://github.com/bhuvank143/claimgaurdai/blob/main/frontend/app.js"
click node_api "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_triage "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_motor "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_property "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_gadget "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_crossclaim "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_weather "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_tier "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_media "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/media.py"
click node_navigator "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py"
click node_uploads "https://github.com/bhuvank143/claimgaurdai/tree/main/claimguard/data/uploads"
click node_policies "https://github.com/bhuvank143/claimgaurdai/blob/main/backend/policy_docs.py"
click node_database "https://github.com/bhuvank143/claimgaurdai/blob/main/claimguard/data/claimguard.db"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend,node_workspace toneBlue
class node_api,node_triage,node_motor,node_property,node_gadget,node_crossclaim,node_weather,node_tier toneAmber
class node_media,node_navigator,node_uploads,node_handler toneMint
class node_policies,node_database toneRose
class node_customer,node_ai toneIndigo
```

## Components

### User Experience

- [Claim Intake UI](https://github.com/bhuvank143/claimgaurdai/blob/main/frontend/app.js): `frontend/app.js`
- [Operations Workspace](https://github.com/bhuvank143/claimgaurdai/blob/main/frontend/app.js): `frontend/app.js`

### Claim Investigation

- [Claims API](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Investigation Loop](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Accident Vision](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Property Vision](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Gadget Vision](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Cross-Claim Matching](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Weather Verification](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Handler Tier Recommendation](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`

### Evidence and Recovery

- [Media Processing](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/media.py): `backend/media.py`
- [Evidence Navigator](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/main.py): `backend/main.py`
- [Claim Evidence Files](https://github.com/bhuvank143/claimgaurdai/tree/main/claimguard/data/uploads): `claimguard/data/uploads`

### Policy and Persistence

- [Policy Verification](https://github.com/bhuvank143/claimgaurdai/blob/main/backend/policy_docs.py): `backend/policy_docs.py`
- [Claim Database](https://github.com/bhuvank143/claimgaurdai/blob/main/claimguard/data/claimguard.db): `claimguard/data/claimguard.db`

### Other components

- **Customer**
- **AI Provider**
- **Claims Handler**

## Connections

- Customer → Claim Intake UI: submits claim (evidence: `README.md`)
- Claim Intake UI → Claims API: posts claim (evidence: `frontend/app.js`)
- Claims API → Media Processing: processes uploads (evidence: `backend/main.py`)
- Claims API → Claim Evidence Files: stores evidence
- Claims API → Claim Database: records claim
- Claims API → Investigation Loop: runs investigation (evidence: `README.md`)
- Investigation Loop → Accident Vision: dispatches motor (evidence: `README.md`)
- Investigation Loop → Property Vision: dispatches property (evidence: `README.md`)
- Investigation Loop → Gadget Vision: dispatches gadget (evidence: `README.md`)
- Investigation Loop → Cross-Claim Matching: matches claims (evidence: `README.md`)
- Investigation Loop → Weather Verification: checks weather (evidence: `README.md`)
- Investigation Loop → Policy Verification: verifies coverage (evidence: `backend/main.py`)
- Investigation Loop → AI Provider: requests analysis
- Investigation Loop → Evidence Navigator: requests missing evidence (evidence: `README.md`)
- Evidence Navigator → Claim Database: tracks requests
- Evidence Navigator → Customer: requests uploads (evidence: `README.md`)
- Investigation Loop → Handler Tier Recommendation: recommends tier (evidence: `README.md`)
- Claim Intake UI → Operations Workspace: opens claim view (evidence: `frontend/app.js`)
- Operations Workspace → Claims API: fetches claim (evidence: `frontend/app.js`)
- Operations Workspace → Claims Handler: presents findings (evidence: `README.md`)
