# kathir2911/cropclaim-ai architecture

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

- Interactive diagram: https://gitdiagram.com/kathir2911/cropclaim-ai
- Repository: https://github.com/kathir2911/cropclaim-ai

## Overview

The tree suggests a Flutter crop-insurance claims app, with farmer, agent, and operator flows, field capture, AI analysis, and claim handling. The README only describes a starter project, and no Dart implementation was excerpted, so the domain and links below are inferred from names and paths; dashed edges mark unverified workflow. Native platform files appear to be Flutter launchers rather than product logic.

Main entry points: [`lib/main.dart`](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/main.dart) (App entry), [`lib/screens/auth`](https://github.com/kathir2911/cropclaim-ai/tree/main/lib/screens/auth) (Role sign-in), [`lib/screens/ai_processing_screen.dart`](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/ai_processing_screen.dart) (AI processing), [`lib/screens/guided_capture_screen.dart`](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/guided_capture_screen.dart) (Guided capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_entry["App entry<br/>[main.dart]"]
  node_mode["Mode selection"]
  node_auth["Role sign-in"]
  node_guards["Access guards"]
  node_locale["Language selection"]
end

subgraph group_capture["Field capture and AI"]
  node_field["Field boundary"]
  node_guided["Guided capture"]
  node_camera["Camera service"]
  node_gps["GPS service<br/>[gps_service.dart]"]
  node_ai["AI analysis<br/>[ai_service.dart]"]
  node_processing["AI processing"]
  node_results["AI results"]
end

subgraph group_claims["Claims and PMFBY"]
  node_claimdata["Claim data<br/>[claim_data.dart]"]
  node_report["Claim report"]
  node_history["Claims history"]
  node_pmfby["PMFBY logic"]
  node_requests["Request management"]
end

subgraph group_services["Services and state"]
  node_authsvc["Authentication service<br/>[auth_service.dart]"]
  node_supabase["Supabase service"]
  node_state["App state<br/>[app_state.dart]"]
  node_pmfbyservice["PMFBY service<br/>[pmfby_service.dart]"]
end

node_user(("App user"))

node_user -.->|"opens"| node_entry
node_entry -.->|"routes to"| node_mode
node_mode -.->|"selects role"| node_auth
node_auth -.->|"authenticates"| node_authsvc
node_auth -.->|"checks access"| node_guards
node_user -.->|"chooses language"| node_locale
node_guided -.->|"captures images"| node_camera
node_field -.->|"gets location"| node_gps
node_guided -.->|"starts analysis"| node_processing
node_processing -.->|"requests analysis"| node_ai
node_processing -.->|"shows outcome"| node_results
node_results -.->|"uses claim data"| node_claimdata
node_report -.->|"displays claim"| node_claimdata
node_history -.->|"loads claims"| node_supabase
node_requests -.->|"handles requests"| node_pmfbyservice
node_pmfby -.->|"uses logic"| node_pmfbyservice
node_entry -.->|"uses state"| node_state

click node_entry "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/main.dart"
click node_mode "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/mode_selection_screen.dart"
click node_auth "https://github.com/kathir2911/cropclaim-ai/tree/main/lib/screens/auth"
click node_guards "https://github.com/kathir2911/cropclaim-ai/tree/main/lib/guards"
click node_locale "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/language_selection_screen.dart"
click node_field "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/field_boundary_screen.dart"
click node_guided "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/guided_capture_screen.dart"
click node_camera "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/camera_service.dart"
click node_gps "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/gps_service.dart"
click node_ai "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/ai_service.dart"
click node_processing "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/ai_processing_screen.dart"
click node_results "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/ai_results_screen.dart"
click node_claimdata "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/models/claim_data.dart"
click node_report "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/claim_report_screen.dart"
click node_history "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/claims_history_screen.dart"
click node_pmfby "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/pmfby_claim_logic_screen.dart"
click node_requests "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/manage_requests_screen.dart"
click node_authsvc "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/auth_service.dart"
click node_supabase "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/supabase_service.dart"
click node_state "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/providers/app_state.dart"
click node_pmfbyservice "https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/pmfby_service.dart"

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_entry,node_mode,node_auth,node_guards,node_locale,node_user toneBlue
class node_field,node_guided,node_camera,node_gps,node_ai,node_processing,node_results toneAmber
class node_claimdata,node_report,node_history,node_pmfby,node_requests toneMint
class node_authsvc,node_supabase,node_state,node_pmfbyservice toneRose
```

## Components

### App and navigation

- [App entry](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/main.dart): `lib/main.dart`
- [Mode selection](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/mode_selection_screen.dart): `lib/screens/mode_selection_screen.dart`
- [Role sign-in](https://github.com/kathir2911/cropclaim-ai/tree/main/lib/screens/auth): `lib/screens/auth`
- [Access guards](https://github.com/kathir2911/cropclaim-ai/tree/main/lib/guards): `lib/guards`
- [Language selection](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/language_selection_screen.dart): `lib/screens/language_selection_screen.dart`

### Field capture and AI

- [Field boundary](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/field_boundary_screen.dart): `lib/screens/field_boundary_screen.dart`
- [Guided capture](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/guided_capture_screen.dart): `lib/screens/guided_capture_screen.dart`
- [Camera service](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/camera_service.dart): `lib/services/camera_service.dart`
- [GPS service](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/gps_service.dart): `lib/services/gps_service.dart`
- [AI analysis](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/ai_service.dart): `lib/services/ai_service.dart`
- [AI processing](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/ai_processing_screen.dart): `lib/screens/ai_processing_screen.dart`
- [AI results](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/ai_results_screen.dart): `lib/screens/ai_results_screen.dart`

### Claims and PMFBY

- [Claim data](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/models/claim_data.dart): `lib/models/claim_data.dart`
- [Claim report](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/claim_report_screen.dart): `lib/screens/claim_report_screen.dart`
- [Claims history](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/claims_history_screen.dart): `lib/screens/claims_history_screen.dart`
- [PMFBY logic](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/pmfby_claim_logic_screen.dart): `lib/screens/pmfby_claim_logic_screen.dart`
- [Request management](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/screens/manage_requests_screen.dart): `lib/screens/manage_requests_screen.dart`

### Services and state

- [Authentication service](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`
- [Supabase service](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/supabase_service.dart): `lib/services/supabase_service.dart`
- [App state](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/providers/app_state.dart): `lib/providers/app_state.dart`
- [PMFBY service](https://github.com/kathir2911/cropclaim-ai/blob/main/lib/services/pmfby_service.dart): `lib/services/pmfby_service.dart`

### Other components

- **App user**

## Connections

- App user → App entry: opens
- App entry → Mode selection: routes to
- Mode selection → Role sign-in: selects role
- Role sign-in → Authentication service: authenticates
- Role sign-in → Access guards: checks access
- App user → Language selection: chooses language
- Guided capture → Camera service: captures images
- Field boundary → GPS service: gets location
- Guided capture → AI processing: starts analysis
- AI processing → AI analysis: requests analysis
- AI processing → AI results: shows outcome
- AI results → Claim data: uses claim data
- Claim report → Claim data: displays claim
- Claims history → Supabase service: loads claims
- Request management → PMFBY service: handles requests
- PMFBY logic → PMFBY service: uses logic
- App entry → App state: uses state
