# datik2012-jpg/bmcpolinexo architecture

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

- Interactive diagram: https://gitdiagram.com/datik2012-jpg/bmcpolinexo
- Repository: https://github.com/datik2012-jpg/bmcpolinexo

## Overview

BMCPolinexo is a local, memory-only Hebrew insurance portfolio review app. A customer supplies details and uploads a Har HaBituach XLSX; the API parses it into a report, which the workspace displays for filtering, correction, exclusion, source comparison, and family views. The user can export current and proposed portfolios to a compact Excel workbook. The README also documents logo lookup and shared-customer summaries; unsampled implementation details are represented only where documented, and edges reflect shown calls or explicit documentation.

Main entry points: [`frontend/src/CustomerPortfolio.tsx`](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/CustomerPortfolio.tsx) (Portfolio review), [`frontend/src/App.tsx`](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/App.tsx) (Workspace coordinator), [`backend/app/main.py`](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/main.py) (Import/export API), [`frontend/src/CustomerForm.tsx`](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/CustomerForm.tsx) (Customer details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_app["Workspace coordinator<br/>[App.tsx]"]
  node_customer_form["Customer details<br/>[CustomerForm.tsx]"]
  node_customer_model["Customer model<br/>[customers.ts]"]
end

subgraph group_portfolio["Portfolio review"]
  node_portfolio_view["Portfolio review"]
  node_shared_view["Shared portfolios"]
  node_domain["Portfolio calculations<br/>[domain.ts]"]
  node_workspace_ops["Proposal operations<br/>[workspace.ts]"]
  node_categories["Coverage categories"]
  node_logo["Insurer logos<br/>[InsurerLogo.tsx]"]
  node_insurers["Insurer catalog<br/>[insurers.ts]"]
end

subgraph group_import["Workbook import"]
  node_api["Import/export API<br/>[main.py]"]
  node_parser["Workbook parser<br/>[parser.py]"]
end

subgraph group_export["Workbook export"]
  node_export_button["Export controls<br/>[ExportButton.tsx]"]
  node_export_contract["Export validation<br/>[exporter.py]"]
  node_excel_export["Excel generation<br/>[compact_export.py]"]
end

node_agent(("Agent"))
node_customer(("Customer"))

node_customer -->|"enters details"| node_customer_form
node_app -->|"renders"| node_customer_form
node_customer_form -->|"validates with"| node_customer_model
node_app -->|"uploads workbook"| node_api
node_api -->|"parses workbook"| node_parser
node_app -->|"renders"| node_portfolio_view
node_app -->|"renders"| node_shared_view
node_portfolio_view -->|"calculates totals"| node_domain
node_portfolio_view -->|"uses proposal operations"| node_workspace_ops
node_portfolio_view -->|"uses categories"| node_categories
node_portfolio_view -->|"renders logos"| node_logo
node_logo -->|"looks up brand"| node_insurers
node_shared_view -->|"renders portfolios"| node_portfolio_view
node_agent -->|"requests export"| node_export_button
node_portfolio_view -->|"offers export"| node_export_button
node_export_button -->|"posts export"| node_api
node_api -->|"validates request"| node_export_contract
node_export_contract -->|"creates workbook"| node_excel_export

click node_app "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/App.tsx"
click node_customer_form "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/CustomerForm.tsx"
click node_customer_model "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/customers.ts"
click node_portfolio_view "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/CustomerPortfolio.tsx"
click node_shared_view "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/SharedPortfolio.tsx"
click node_domain "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/domain.ts"
click node_workspace_ops "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/workspace.ts"
click node_categories "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/insuranceCategories.ts"
click node_logo "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/InsurerLogo.tsx"
click node_insurers "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/insurers.ts"
click node_api "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/main.py"
click node_parser "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/parser.py"
click node_export_button "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/ExportButton.tsx"
click node_export_contract "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/exporter.py"
click node_excel_export "https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/compact_export.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_app,node_customer_form,node_customer_model toneBlue
class node_portfolio_view,node_shared_view,node_domain,node_workspace_ops,node_categories,node_logo,node_insurers toneAmber
class node_api,node_parser toneMint
class node_export_button,node_export_contract,node_excel_export toneRose
class node_agent,node_customer toneIndigo
```

## Components

### Workspace UI

- [Workspace coordinator](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Customer details](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/CustomerForm.tsx): `frontend/src/CustomerForm.tsx`
- [Customer model](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/customers.ts): `frontend/src/customers.ts`

### Portfolio review

- [Portfolio review](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/CustomerPortfolio.tsx): `frontend/src/CustomerPortfolio.tsx`
- [Shared portfolios](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/SharedPortfolio.tsx): `frontend/src/SharedPortfolio.tsx`
- [Portfolio calculations](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/domain.ts): `frontend/src/domain.ts`
- [Proposal operations](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/workspace.ts): `frontend/src/workspace.ts`
- [Coverage categories](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/insuranceCategories.ts): `frontend/src/insuranceCategories.ts`
- [Insurer logos](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/InsurerLogo.tsx): `frontend/src/InsurerLogo.tsx`
- [Insurer catalog](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/insurers.ts): `frontend/src/insurers.ts`

### Workbook import

- [Import/export API](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/main.py): `backend/app/main.py`
- [Workbook parser](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/parser.py): `backend/app/parser.py`

### Workbook export

- [Export controls](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/frontend/src/ExportButton.tsx): `frontend/src/ExportButton.tsx`
- [Export validation](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/exporter.py): `backend/app/exporter.py`
- [Excel generation](https://github.com/datik2012-jpg/bmcpolinexo/blob/main/backend/app/compact_export.py): `backend/app/compact_export.py`

### Other components

- **Agent**
- **Customer**

## Connections

- Customer → Customer details: enters details (evidence: `README.md`)
- Workspace coordinator → Customer details: renders (evidence: `frontend/src/App.tsx`)
- Customer details → Customer model: validates with (evidence: `frontend/src/CustomerForm.tsx`)
- Workspace coordinator → Import/export API: uploads workbook (evidence: `README.md`)
- Import/export API → Workbook parser: parses workbook (evidence: `backend/app/main.py`)
- Workspace coordinator → Portfolio review: renders (evidence: `frontend/src/App.tsx`)
- Workspace coordinator → Shared portfolios: renders (evidence: `frontend/src/App.tsx`)
- Portfolio review → Portfolio calculations: calculates totals (evidence: `frontend/src/CustomerPortfolio.tsx`)
- Portfolio review → Proposal operations: uses proposal operations (evidence: `frontend/src/CustomerPortfolio.tsx`)
- Portfolio review → Coverage categories: uses categories (evidence: `frontend/src/CustomerPortfolio.tsx`)
- Portfolio review → Insurer logos: renders logos (evidence: `frontend/src/CustomerPortfolio.tsx`)
- Insurer logos → Insurer catalog: looks up brand (evidence: `frontend/src/InsurerLogo.tsx`)
- Shared portfolios → Portfolio review: renders portfolios (evidence: `frontend/src/SharedPortfolio.tsx`)
- Agent → Export controls: requests export (evidence: `README.md`)
- Portfolio review → Export controls: offers export (evidence: `frontend/src/CustomerPortfolio.tsx`)
- Export controls → Import/export API: posts export (evidence: `frontend/src/ExportButton.tsx`)
- Import/export API → Export validation: validates request (evidence: `backend/app/main.py`)
- Export validation → Excel generation: creates workbook (evidence: `backend/app/exporter.py`)
