# sudipdey18/insurance_claim_powerbi architecture

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

- Interactive diagram: https://gitdiagram.com/sudipdey18/insurance_claim_powerbi
- Repository: https://github.com/sudipdey18/insurance_claim_powerbi

## Overview

Claims Intelligence Analytics is a Streamlit dashboard backed by a FastAPI service, with local analytics fallbacks when the API is unavailable. Users choose dashboard sections, filter portfolio claims, and view KPI, payout, trend, severity, correlation, and audit results; separate sections provide Power BI/DAX readiness and strategic insights. The documented workflow also includes data cleaning and feature derivation before analysis. Edges reflect the shown calls and documented capabilities; unsampled implementation details are not inferred.

Main entry points: [`frontend/api_client.py`](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/api_client.py) (API client), [`backend/server.py`](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/server.py) (FastAPI routes), [`frontend/app.py`](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/app.py) (Streamlit app), [`backend/data_service.py`](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/data_service.py) (Ingestion and features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_app["Streamlit app<br/>[app.py]"]
  node_client["API client<br/>[api_client.py]"]
  node_styles["UI styles<br/>[styles.py]"]
  node_views["Dashboard views<br/>[views.py]"]
  node_powerbi["Power BI readiness<br/>[views.py]"]
  node_strategy["Strategic insights<br/>[views.py]"]
end

subgraph group_backend["Analytics backend"]
  node_api["FastAPI routes<br/>[server.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_kpis["Executive KPIs"]
  node_breakdown["Cost breakdown"]
  node_trends["Temporal trends"]
  node_severity["Severity metrics"]
  node_correlation["Correlation analysis"]
  node_audits["Operational audits<br/>[audit_service.py]"]
end

subgraph group_data["Claims data"]
  node_ingest["Ingestion and features<br/>[data_service.py]"]
  node_filter["Claim filtering<br/>[data_service.py]"]
  node_raw["Raw claims CSV"]
  node_cleaned["Cleaned claims CSV"]
end

node_user(("Dashboard user"))

node_user -->|"uses"| node_app
node_app -->|"applies styles"| node_styles
node_app -->|"requests data"| node_client
node_app -->|"routes views"| node_views
node_app -->|"renders section"| node_powerbi
node_app -->|"renders section"| node_strategy
node_app -->|"renders results"| node_views
node_client -->|"requests endpoints"| node_api
node_api -->|"reads settings"| node_config
node_api -->|"loads claims"| node_ingest
node_api -->|"filters claims"| node_filter
node_api -->|"computes KPIs"| node_kpis
node_api -->|"computes allocation"| node_breakdown
node_api -->|"computes trends"| node_trends
node_api -->|"computes severity"| node_severity
node_api -->|"computes correlation"| node_correlation
node_api -->|"runs audits"| node_audits
node_ingest -->|"reads file paths"| node_config
node_ingest -->|"loads if available"| node_cleaned
node_ingest -->|"loads fallback"| node_raw
node_client -->|"loads fallback data"| node_ingest
node_client -->|"filters fallback"| node_filter
node_client -->|"computes fallback"| node_kpis
node_client -->|"computes fallback"| node_breakdown
node_client -->|"computes fallback"| node_trends
node_client -->|"computes fallback"| node_severity
node_client -->|"computes fallback"| node_correlation
node_client -->|"computes fallback"| node_audits

click node_app "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/app.py"
click node_client "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/api_client.py"
click node_styles "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/styles.py"
click node_views "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/views.py"
click node_powerbi "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/views.py"
click node_strategy "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/views.py"
click node_api "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/server.py"
click node_config "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/config.py"
click node_ingest "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/data_service.py"
click node_filter "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/data_service.py"
click node_kpis "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py"
click node_breakdown "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py"
click node_trends "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py"
click node_severity "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py"
click node_correlation "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py"
click node_audits "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/audit_service.py"
click node_raw "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/dataset/insurance_claims.csv"
click node_cleaned "https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/dataset/insurance_claims_cleaned.csv"

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_app,node_client,node_styles,node_views,node_powerbi,node_strategy,node_user toneBlue
class node_api,node_config,node_kpis,node_breakdown,node_trends,node_severity,node_correlation,node_audits toneAmber
class node_ingest,node_filter,node_raw,node_cleaned toneMint
```

## Components

### Dashboard

- [Streamlit app](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/app.py): `frontend/app.py`
- [API client](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/api_client.py): `frontend/api_client.py`
- [UI styles](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/styles.py): `frontend/styles.py`
- [Dashboard views](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/views.py): `frontend/views.py`
- [Power BI readiness](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/views.py): `frontend/views.py`
- [Strategic insights](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/frontend/views.py): `frontend/views.py`

### Analytics backend

- [FastAPI routes](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/server.py): `backend/server.py`
- [Runtime configuration](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/config.py): `backend/config.py`
- [Executive KPIs](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py): `backend/analytics_service.py`
- [Cost breakdown](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py): `backend/analytics_service.py`
- [Temporal trends](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py): `backend/analytics_service.py`
- [Severity metrics](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py): `backend/analytics_service.py`
- [Correlation analysis](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/analytics_service.py): `backend/analytics_service.py`
- [Operational audits](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/audit_service.py): `backend/audit_service.py`

### Claims data

- [Ingestion and features](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/data_service.py): `backend/data_service.py`
- [Claim filtering](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/backend/data_service.py): `backend/data_service.py`
- [Raw claims CSV](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/dataset/insurance_claims.csv): `dataset/insurance_claims.csv`
- [Cleaned claims CSV](https://github.com/sudipdey18/insurance_claim_powerbi/blob/main/dataset/insurance_claims_cleaned.csv): `dataset/insurance_claims_cleaned.csv`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Streamlit app: uses (evidence: `frontend/app.py`)
- Streamlit app → UI styles: applies styles (evidence: `frontend/app.py`)
- Streamlit app → API client: requests data (evidence: `frontend/app.py`)
- Streamlit app → Dashboard views: routes views (evidence: `frontend/app.py`)
- Streamlit app → Power BI readiness: renders section (evidence: `frontend/app.py`)
- Streamlit app → Strategic insights: renders section (evidence: `frontend/app.py`)
- Streamlit app → Dashboard views: renders results (evidence: `frontend/app.py`)
- API client → FastAPI routes: requests endpoints (evidence: `frontend/api_client.py`)
- FastAPI routes → Runtime configuration: reads settings (evidence: `backend/server.py`)
- FastAPI routes → Ingestion and features: loads claims (evidence: `backend/server.py`)
- FastAPI routes → Claim filtering: filters claims (evidence: `backend/server.py`)
- FastAPI routes → Executive KPIs: computes KPIs (evidence: `backend/server.py`)
- FastAPI routes → Cost breakdown: computes allocation (evidence: `backend/server.py`)
- FastAPI routes → Temporal trends: computes trends (evidence: `backend/server.py`)
- FastAPI routes → Severity metrics: computes severity (evidence: `backend/server.py`)
- FastAPI routes → Correlation analysis: computes correlation (evidence: `backend/server.py`)
- FastAPI routes → Operational audits: runs audits (evidence: `backend/server.py`)
- Ingestion and features → Runtime configuration: reads file paths (evidence: `backend/data_service.py`)
- Ingestion and features → Cleaned claims CSV: loads if available (evidence: `backend/data_service.py`)
- Ingestion and features → Raw claims CSV: loads fallback (evidence: `backend/data_service.py`)
- API client → Ingestion and features: loads fallback data (evidence: `frontend/api_client.py`)
- API client → Claim filtering: filters fallback (evidence: `frontend/api_client.py`)
- API client → Executive KPIs: computes fallback (evidence: `frontend/api_client.py`)
- API client → Cost breakdown: computes fallback (evidence: `frontend/api_client.py`)
- API client → Temporal trends: computes fallback (evidence: `frontend/api_client.py`)
- API client → Severity metrics: computes fallback (evidence: `frontend/api_client.py`)
- API client → Correlation analysis: computes fallback (evidence: `frontend/api_client.py`)
- API client → Operational audits: computes fallback (evidence: `frontend/api_client.py`)
