# asif-visionary/autolnsure-al architecture

> Architecture diagram of the GitHub repository asif-visionary/autolnsure-al, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asif-visionary/autolnsure-al
- Repository: https://github.com/asif-visionary/autolnsure-al

## Overview

AutoInsure AI is a full-stack insurance platform for automobile, health, and life products. A customer enters through the React application, authenticates, and uses protected workspaces for policies, claims, documents, and payments; staff and administrators have separate workspaces. FastAPI provides the domain API, with PostgreSQL/Supabase for persistence and identity, plus integrations for payments, AI, OCR/ML, and maps. The graph preserves the documented product areas, but most backend module internals were not excerpted, so uncertain service-to-service flows are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/main.py) (FastAPI API), [`frontend/src/App.tsx`](https://github.com/asif-visionary/autolnsure-al/blob/main/frontend/src/App.tsx) (React Application), [`frontend/src/components/staff`](https://github.com/asif-visionary/autolnsure-al/tree/main/frontend/src/components/staff) (Staff Workspaces), [`backend/app/modules/identity`](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/identity) (Identity and Access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web Experience"]
  node_web_app["React Application<br/>[App.tsx]"]
  node_auth_ui["Authentication Context<br/>[AuthContext.tsx]"]
  node_customer_ui["Customer Workspaces"]
  node_staff_ui["Staff Workspaces"]
end

subgraph group_platform["Platform Core"]
  node_backend_api["FastAPI API<br/>[main.py]"]
  node_core_config["Runtime Configuration<br/>[config.py]"]
  node_database[("PostgreSQL Database<br/>[database.py]")]
  node_identity["Identity and Access"]
  node_supabase[("Supabase Auth and Storage")]
end

subgraph group_insurance["Insurance Workflows"]
  node_policies["Policy Management"]
  node_claims["Claims Handling"]
  node_documents["Document Processing"]
  node_payments["Payments"]
  node_health_life["Health and Life"]
  node_vehicles["Vehicle Management"]
  node_razorpay["Razorpay"]
end

subgraph group_intelligence["Intelligence"]
  node_assistant["InsureMate Assistant"]
  node_motor_ml["Motor Claim ML"]
  node_claim_features["Claim Feature Extraction"]
  node_claim_training["Claim Model Training<br/>[train_pipeline.py]"]
  node_ai_providers["AI Providers"]
end

subgraph group_operations["Operations"]
  node_location["Location Services"]
  node_staff_admin["Staff and Administration"]
  node_phase9["Notifications and Grievances"]
  node_maps["Map and Routing Providers"]
end

node_user(("Customer or Staff"))
node_api_service["Backend API Service"]

node_user -->|"uses"| node_web_app
node_web_app -->|"provides auth"| node_auth_ui
node_web_app -->|"routes to"| node_customer_ui
node_web_app -->|"routes to"| node_staff_ui
node_staff_ui -->|"requests data"| node_api_service
node_api_service -->|"served by"| node_backend_api
node_backend_api -.->|"provides identity"| node_identity
node_backend_api -.->|"provides policies"| node_policies
node_backend_api -.->|"provides claims"| node_claims
node_backend_api -.->|"provides documents"| node_documents
node_backend_api -.->|"provides payments"| node_payments
node_backend_api -.->|"provides coverage"| node_health_life
node_backend_api -.->|"provides vehicles"| node_vehicles
node_backend_api -.->|"provides assistant"| node_assistant
node_backend_api -.->|"provides predictions"| node_motor_ml
node_backend_api -.->|"provides location"| node_location
node_backend_api -.->|"provides workspaces"| node_staff_admin
node_backend_api -.->|"provides support"| node_phase9
node_backend_api -.->|"persists data"| node_database
node_identity -.->|"uses auth"| node_supabase
node_documents -.->|"uses storage"| node_supabase
node_payments -.->|"integrates payments"| node_razorpay
node_assistant -.->|"uses models"| node_ai_providers
node_location -.->|"uses maps"| node_maps
node_motor_ml -->|"extracts features"| node_claim_features
node_claim_training -->|"uses features"| node_claim_features

click node_web_app "https://github.com/asif-visionary/autolnsure-al/blob/main/frontend/src/App.tsx"
click node_auth_ui "https://github.com/asif-visionary/autolnsure-al/blob/main/frontend/src/contexts/AuthContext.tsx"
click node_customer_ui "https://github.com/asif-visionary/autolnsure-al/tree/main/frontend/src/pages"
click node_staff_ui "https://github.com/asif-visionary/autolnsure-al/tree/main/frontend/src/components/staff"
click node_backend_api "https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/main.py"
click node_core_config "https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/core/config.py"
click node_database "https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/core/database.py"
click node_identity "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/identity"
click node_policies "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/policies"
click node_claims "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/claims"
click node_documents "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/documents"
click node_payments "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/payments"
click node_health_life "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/health"
click node_vehicles "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/vehicles"
click node_assistant "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/assistant"
click node_motor_ml "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/motor/ml"
click node_claim_features "https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/modules/motor/ml/feature_pipeline.py"
click node_claim_training "https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/modules/intelligence/train_pipeline.py"
click node_location "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/location"
click node_staff_admin "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/staff"
click node_phase9 "https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/phase9"

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_app,node_auth_ui,node_customer_ui,node_staff_ui toneBlue
class node_backend_api,node_core_config,node_database,node_identity,node_supabase toneAmber
class node_policies,node_claims,node_documents,node_payments,node_health_life,node_vehicles,node_razorpay,node_api_service toneMint
class node_assistant,node_motor_ml,node_claim_features,node_claim_training,node_ai_providers toneRose
class node_location,node_staff_admin,node_phase9,node_maps,node_user toneIndigo
```

## Components

### Web Experience

- [React Application](https://github.com/asif-visionary/autolnsure-al/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication Context](https://github.com/asif-visionary/autolnsure-al/blob/main/frontend/src/contexts/AuthContext.tsx): `frontend/src/contexts/AuthContext.tsx`
- [Customer Workspaces](https://github.com/asif-visionary/autolnsure-al/tree/main/frontend/src/pages): `frontend/src/pages`
- [Staff Workspaces](https://github.com/asif-visionary/autolnsure-al/tree/main/frontend/src/components/staff): `frontend/src/components/staff`

### Platform Core

- [FastAPI API](https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/main.py): `backend/app/main.py`
- [Runtime Configuration](https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/core/config.py): `backend/app/core/config.py`
- [PostgreSQL Database](https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [Identity and Access](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/identity): `backend/app/modules/identity`
- **Supabase Auth and Storage**

### Insurance Workflows

- [Policy Management](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/policies): `backend/app/modules/policies`
- [Claims Handling](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/claims): `backend/app/modules/claims`
- [Document Processing](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/documents): `backend/app/modules/documents`
- [Payments](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/payments): `backend/app/modules/payments`
- [Health and Life](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/health): `backend/app/modules/health`
- [Vehicle Management](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/vehicles): `backend/app/modules/vehicles`
- **Razorpay**

### Intelligence

- [InsureMate Assistant](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/assistant): `backend/app/modules/assistant`
- [Motor Claim ML](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/motor/ml): `backend/app/modules/motor/ml`
- [Claim Feature Extraction](https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/modules/motor/ml/feature_pipeline.py): `backend/app/modules/motor/ml/feature_pipeline.py`
- [Claim Model Training](https://github.com/asif-visionary/autolnsure-al/blob/main/backend/app/modules/intelligence/train_pipeline.py): `backend/app/modules/intelligence/train_pipeline.py`
- **AI Providers**

### Operations

- [Location Services](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/location): `backend/app/modules/location`
- [Staff and Administration](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/staff): `backend/app/modules/staff`
- [Notifications and Grievances](https://github.com/asif-visionary/autolnsure-al/tree/main/backend/app/modules/phase9): `backend/app/modules/phase9`
- **Map and Routing Providers**

### Other components

- **Customer or Staff**
- **Backend API Service**

## Connections

- Customer or Staff → React Application: uses (evidence: `README.md`)
- React Application → Authentication Context: provides auth (evidence: `frontend/src/App.tsx`)
- React Application → Customer Workspaces: routes to (evidence: `frontend/src/App.tsx`)
- React Application → Staff Workspaces: routes to (evidence: `frontend/src/App.tsx`)
- Staff Workspaces → Backend API Service: requests data (evidence: `frontend/src/components/staff/StaffTasksSection.tsx`)
- Backend API Service → FastAPI API: served by (evidence: `README.md`)
- FastAPI API → Identity and Access: provides identity
- FastAPI API → Policy Management: provides policies
- FastAPI API → Claims Handling: provides claims
- FastAPI API → Document Processing: provides documents
- FastAPI API → Payments: provides payments
- FastAPI API → Health and Life: provides coverage
- FastAPI API → Vehicle Management: provides vehicles
- FastAPI API → InsureMate Assistant: provides assistant
- FastAPI API → Motor Claim ML: provides predictions
- FastAPI API → Location Services: provides location
- FastAPI API → Staff and Administration: provides workspaces
- FastAPI API → Notifications and Grievances: provides support
- FastAPI API → PostgreSQL Database: persists data
- Identity and Access → Supabase Auth and Storage: uses auth
- Document Processing → Supabase Auth and Storage: uses storage
- Payments → Razorpay: integrates payments
- InsureMate Assistant → AI Providers: uses models
- Location Services → Map and Routing Providers: uses maps
- Motor Claim ML → Claim Feature Extraction: extracts features (evidence: `backend/app/modules/motor/ml/feature_pipeline.py`)
- Claim Model Training → Claim Feature Extraction: uses features (evidence: `backend/app/modules/intelligence/train_pipeline.py`)
