# piyushdeshmukh-apperentice/c.a.r.e.-insurance architecture

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

- Interactive diagram: https://gitdiagram.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance
- Repository: https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance

## Overview

C.A.R.E. accepts claims through a web client or Telegram, then exposes authenticated claim APIs and separate health and automobile processing capabilities. Automobile processing builds a claim, assesses image damage, checks policy eligibility, and estimates repair cost; health processing extracts document text, processes medical and policy information, and adjudicates coverage. The graph preserves the documented profile/history and bot channels. Some links are based on README descriptions because the corresponding implementation was not sampled; those are marked dashed where unverified.

Main entry points: [`server/claim_server/main.py`](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/main.py) (API Endpoints), [`server/automobile_claim_engine/claim_engine.py`](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/claim_engine.py) (Auto Claim Orchestrator), [`server/health_claim_engine/main_workflow.py`](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/main_workflow.py) (Health Workflow), [`client/src/Routes.jsx`](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/Routes.jsx) (Page Routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web Client"]
  node_web["Web Application<br/>[App.jsx]"]
  node_routes["Page Routing<br/>[Routes.jsx]"]
  node_claim_forms["Claim Forms"]
  node_profile["Profile &amp; Status<br/>[Profile.jsx]"]
  node_client_services["Client Services<br/>[apiService.js]"]
end

subgraph group_api["Claim API"]
  node_api_server["API Endpoints<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_claim_processing["Claim Processing<br/>[claim_processor.py]"]
  node_claim_data[("Claim Records<br/>[models.py]")]
end

subgraph group_auto["Automobile Claims"]
  node_auto_orchestrator["Auto Claim Orchestrator<br/>[claim_engine.py]"]
  node_claim_input["Claim Input Builder<br/>[claim_input.py]"]
  node_image_damage["Damage Detection &amp; Overlay<br/>[overlay.py]"]
  node_severity["CNN Severity Prediction"]
  node_policy_eval["Policy Evaluation<br/>[evaluator.py]"]
  node_cost_estimator["Repair Cost Estimate<br/>[cost_estimator.py]"]
end

subgraph group_health["Health Claims"]
  node_health_workflow["Health Workflow<br/>[main_workflow.py]"]
  node_ocr["Document OCR<br/>[extractor.py]"]
  node_medical_processing["Medical Processing<br/>[processor.py]"]
  node_policy_processing["Policy Parsing &amp; Processing<br/>[processor.py]"]
  node_retrieval["Medical Retrieval"]
  node_adjudicator["Claim Adjudication<br/>[adjudicator.py]"]
end

subgraph group_bot["Telegram Channel"]
  node_bot_app["Telegram Bot<br/>[telegram_bot.py]"]
  node_bot_state["Conversation State<br/>[state_manager.py]"]
  node_bot_api["Bot API Client<br/>[api_client.py]"]
end

node_user(("Claimant"))

node_user -->|"uses"| node_web
node_web -->|"renders"| node_routes
node_routes -.->|"offers claims"| node_claim_forms
node_routes -->|"routes to"| node_profile
node_claim_forms -.->|"submits claims"| node_client_services
node_profile -.->|"loads status"| node_client_services
node_client_services -.->|"calls API"| node_api_server
node_user -->|"submits claims"| node_api_server
node_api_server -->|"authenticates"| node_auth
node_auth -->|"reads/writes users"| node_claim_data
node_api_server -->|"dispatches claims"| node_claim_processing
node_claim_processing -.->|"processes auto claims"| node_auto_orchestrator
node_claim_processing -.->|"processes health claims"| node_health_workflow
node_api_server -->|"stores claim records"| node_claim_data
node_auto_orchestrator -->|"builds claim"| node_claim_input
node_auto_orchestrator -->|"processes image"| node_image_damage
node_image_damage -->|"predicts severity"| node_severity
node_auto_orchestrator -->|"evaluates policy"| node_policy_eval
node_auto_orchestrator -->|"estimates cost"| node_cost_estimator
node_health_workflow -->|"runs OCR"| node_ocr
node_health_workflow -->|"processes records"| node_medical_processing
node_health_workflow -->|"processes policy"| node_policy_processing
node_health_workflow -->|"requests decision"| node_adjudicator
node_medical_processing -.->|"retrieves candidates"| node_retrieval
node_user -->|"uses Telegram"| node_bot_app
node_bot_app -->|"tracks conversation"| node_bot_state
node_bot_app -->|"calls API client"| node_bot_api
node_bot_api -->|"sends requests"| node_api_server

click node_web "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/App.jsx"
click node_routes "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/Routes.jsx"
click node_claim_forms "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/tree/master/client/src/components/ClaimSubmission"
click node_profile "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/pages/Profile.jsx"
click node_client_services "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/services/apiService.js"
click node_api_server "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/main.py"
click node_auth "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/auth.py"
click node_claim_processing "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/claim_processor.py"
click node_claim_data "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/models.py"
click node_auto_orchestrator "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/claim_engine.py"
click node_claim_input "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/claim_input.py"
click node_image_damage "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/overlay.py"
click node_severity "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/predict_cnn_severity.py"
click node_policy_eval "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/evaluator.py"
click node_cost_estimator "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/cost_estimator.py"
click node_health_workflow "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/main_workflow.py"
click node_ocr "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/ocr/extractor.py"
click node_medical_processing "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/medical/processor.py"
click node_policy_processing "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/policy/processor.py"
click node_retrieval "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/medical/retrieval_engine.py"
click node_adjudicator "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/adjudication/adjudicator.py"
click node_bot_app "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/bot/telegram_bot.py"
click node_bot_state "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/bot/state_manager.py"
click node_bot_api "https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/bot/api_client.py"

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_web,node_routes,node_claim_forms,node_profile,node_client_services toneBlue
class node_api_server,node_auth,node_claim_processing,node_claim_data toneAmber
class node_auto_orchestrator,node_claim_input,node_image_damage,node_severity,node_policy_eval,node_cost_estimator toneMint
class node_health_workflow,node_ocr,node_medical_processing,node_policy_processing,node_retrieval,node_adjudicator toneRose
class node_bot_app,node_bot_state,node_bot_api,node_user toneIndigo
```

## Components

### Web Client

- [Web Application](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Page Routing](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/Routes.jsx): `client/src/Routes.jsx`
- [Claim Forms](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/tree/master/client/src/components/ClaimSubmission): `client/src/components/ClaimSubmission`
- [Profile & Status](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/pages/Profile.jsx): `client/src/pages/Profile.jsx`
- [Client Services](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/client/src/services/apiService.js): `client/src/services/apiService.js`

### Claim API

- [API Endpoints](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/main.py): `server/claim_server/main.py`
- [Authentication](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/auth.py): `server/claim_server/auth.py`
- [Claim Processing](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/claim_processor.py): `server/claim_server/claim_processor.py`
- [Claim Records](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/claim_server/models.py): `server/claim_server/models.py`

### Automobile Claims

- [Auto Claim Orchestrator](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/claim_engine.py): `server/automobile_claim_engine/claim_engine.py`
- [Claim Input Builder](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/claim_input.py): `server/automobile_claim_engine/claim_input.py`
- [Damage Detection & Overlay](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/overlay.py): `server/automobile_claim_engine/overlay.py`
- [CNN Severity Prediction](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/predict_cnn_severity.py): `server/automobile_claim_engine/predict_cnn_severity.py`
- [Policy Evaluation](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/evaluator.py): `server/automobile_claim_engine/evaluator.py`
- [Repair Cost Estimate](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/automobile_claim_engine/cost_estimator.py): `server/automobile_claim_engine/cost_estimator.py`

### Health Claims

- [Health Workflow](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/main_workflow.py): `server/health_claim_engine/main_workflow.py`
- [Document OCR](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/ocr/extractor.py): `server/health_claim_engine/ocr/extractor.py`
- [Medical Processing](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/medical/processor.py): `server/health_claim_engine/medical/processor.py`
- [Policy Parsing & Processing](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/policy/processor.py): `server/health_claim_engine/policy/processor.py`
- [Medical Retrieval](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/medical/retrieval_engine.py): `server/health_claim_engine/medical/retrieval_engine.py`
- [Claim Adjudication](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/health_claim_engine/adjudication/adjudicator.py): `server/health_claim_engine/adjudication/adjudicator.py`

### Telegram Channel

- [Telegram Bot](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/bot/telegram_bot.py): `server/bot/telegram_bot.py`
- [Conversation State](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/bot/state_manager.py): `server/bot/state_manager.py`
- [Bot API Client](https://github.com/piyushdeshmukh-apperentice/c.a.r.e.-insurance/blob/master/server/bot/api_client.py): `server/bot/api_client.py`

### Other components

- **Claimant**

## Connections

- Claimant → Web Application: uses (evidence: `README.md`)
- Web Application → Page Routing: renders
- Page Routing → Claim Forms: offers claims
- Page Routing → Profile & Status: routes to (evidence: `client/src/Routes.jsx`)
- Claim Forms → Client Services: submits claims
- Profile & Status → Client Services: loads status
- Client Services → API Endpoints: calls API
- Claimant → API Endpoints: submits claims (evidence: `README.md`)
- API Endpoints → Authentication: authenticates (evidence: `server/claim_server/main.py`)
- Authentication → Claim Records: reads/writes users (evidence: `server/claim_server/auth.py`)
- API Endpoints → Claim Processing: dispatches claims (evidence: `server/claim_server/main.py`)
- Claim Processing → Auto Claim Orchestrator: processes auto claims (evidence: `README.md`)
- Claim Processing → Health Workflow: processes health claims (evidence: `README.md`)
- API Endpoints → Claim Records: stores claim records (evidence: `server/claim_server/main.py`)
- Auto Claim Orchestrator → Claim Input Builder: builds claim (evidence: `server/automobile_claim_engine/claim_engine.py`)
- Auto Claim Orchestrator → Damage Detection & Overlay: processes image (evidence: `server/automobile_claim_engine/claim_engine.py`)
- Damage Detection & Overlay → CNN Severity Prediction: predicts severity (evidence: `server/automobile_claim_engine/overlay.py`)
- Auto Claim Orchestrator → Policy Evaluation: evaluates policy (evidence: `server/automobile_claim_engine/claim_engine.py`)
- Auto Claim Orchestrator → Repair Cost Estimate: estimates cost (evidence: `server/automobile_claim_engine/claim_engine.py`)
- Health Workflow → Document OCR: runs OCR (evidence: `server/health_claim_engine/main_workflow.py`)
- Health Workflow → Medical Processing: processes records (evidence: `server/health_claim_engine/main_workflow.py`)
- Health Workflow → Policy Parsing & Processing: processes policy (evidence: `server/health_claim_engine/main_workflow.py`)
- Health Workflow → Claim Adjudication: requests decision (evidence: `server/health_claim_engine/main_workflow.py`)
- Medical Processing → Medical Retrieval: retrieves candidates
- Claimant → Telegram Bot: uses Telegram (evidence: `README.md`)
- Telegram Bot → Conversation State: tracks conversation (evidence: `server/bot/telegram_bot.py`)
- Telegram Bot → Bot API Client: calls API client (evidence: `server/bot/telegram_bot.py`)
- Bot API Client → API Endpoints: sends requests (evidence: `server/bot/api_client.py`)
