# vineetsarpal/autodentifyr architecture

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

- Interactive diagram: https://gitdiagram.com/vineetsarpal/autodentifyr
- Repository: https://github.com/vineetsarpal/autodentifyr

## Overview

AutoDentifyr is a Flutter vehicle-damage inspection app. The main user workflow is to capture or choose an image, run local damage detection, review findings, and produce a repair estimate or shareable report. Its assessment workflow also covers evidence, severity, and vehicle-component mapping; authentication is a separate capability. The README and tree establish these features, but most Dart implementations were not sampled, so uncertain wiring is omitted.

Main entry points: [`lib/presentation/controllers/assessment_workflow_controller.dart`](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_workflow_controller.dart) (Assessment Workflow), [`lib/presentation/controllers/camera_inference_controller.dart`](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/camera_inference_controller.dart) (Inference Controller), [`lib/presentation/screens/home_screen.dart`](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/home_screen.dart) (Home), [`lib/services/model_manager.dart`](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/model_manager.dart) (Model Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inspection["Damage Inspection"]
  node_home["Home<br/>[home_screen.dart]"]
  node_camera["Camera Inference"]
  node_photo["Photo Analysis"]
  node_inference["Inference Controller"]
  node_model["Model Manager<br/>[model_manager.dart]"]
  node_detector["Detector Adapter"]
  node_model_files["On-device Model"]
end

subgraph group_assessment["Assessment Workflow"]
  node_workflow["Assessment Workflow"]
  node_workflow_screen["Workflow Screen"]
  node_findings["Finding Review"]
  node_components["Component Map"]
  node_evidence["Evidence Capture"]
  node_severity["Severity Assessment"]
  node_estimate["Repair Estimate"]
  node_estimate_source["Estimate Source"]
  node_completion["Assessment Completion"]
  node_reports["Report Service"]
  node_sharing["Report Delivery"]
end

subgraph group_platform["App Services"]
  node_app["App Entry<br/>[main.dart]"]
  node_native_assets["Android Asset Bridge<br/>[MainActivity.kt]"]
  node_auth_ui["Login<br/>[login_screen.dart]"]
  node_auth_bloc["Auth State<br/>[auth_bloc.dart]"]
  node_auth_service["Auth Service<br/>[auth_service.dart]"]
end

node_driver(("Inspector"))
node_firebase["Firebase Auth"]
node_recipient(("Report Recipient"))

node_driver -->|"opens"| node_app
node_app -->|"shows"| node_home
node_home -->|"starts capture"| node_camera
node_home -->|"chooses photo"| node_photo
node_camera -->|"runs inference"| node_inference
node_photo -->|"runs inference"| node_inference
node_inference -->|"loads model"| node_model
node_model -->|"loads locally"| node_model_files
node_model -.->|"materializes Android model"| node_native_assets
node_inference -->|"detects damage"| node_detector
node_inference -->|"provides findings"| node_workflow
node_workflow_screen -->|"drives workflow"| node_workflow
node_workflow -->|"reviews findings"| node_findings
node_workflow -->|"maps components"| node_components
node_workflow -->|"records evidence"| node_evidence
node_workflow -->|"assesses severity"| node_severity
node_workflow -->|"calculates estimate"| node_estimate
node_estimate -->|"gets estimate data"| node_estimate_source
node_workflow -->|"completes assessment"| node_completion
node_completion -->|"creates report"| node_reports
node_completion -->|"delivers report"| node_sharing
node_sharing -->|"shares report"| node_recipient
node_auth_ui -->|"submits credentials"| node_auth_bloc
node_auth_bloc -->|"requests authentication"| node_auth_service
node_auth_service -->|"authenticates"| node_firebase

click node_app "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/main.dart"
click node_home "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/home_screen.dart"
click node_camera "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/camera_inference_screen.dart"
click node_photo "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/single_image_screen.dart"
click node_inference "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/camera_inference_controller.dart"
click node_model "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/model_manager.dart"
click node_detector "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/vehicle_component_detector_adapter.dart"
click node_model_files "https://github.com/vineetsarpal/autodentifyr/tree/main/assets/models"
click node_native_assets "https://github.com/vineetsarpal/autodentifyr/blob/main/android/app/src/main/kotlin/com/vineetsarpal/autodentifyr/MainActivity.kt"
click node_workflow "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_workflow_controller.dart"
click node_workflow_screen "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/assessment_workflow_screen.dart"
click node_findings "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_finding_review_controller.dart"
click node_components "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/vehicle_component_map_screen.dart"
click node_evidence "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_evidence_controller.dart"
click node_severity "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_severity_controller.dart"
click node_estimate "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_estimate_controller.dart"
click node_estimate_source "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/assessment_estimate_source.dart"
click node_completion "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_completion_controller.dart"
click node_reports "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/assessment_report_service.dart"
click node_sharing "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/assessment_report_delivery.dart"
click node_auth_ui "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/login_screen.dart"
click node_auth_bloc "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/bloc/auth/auth_bloc.dart"
click node_auth_service "https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/auth_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_home,node_camera,node_photo,node_inference,node_model,node_detector,node_model_files toneBlue
class node_workflow,node_workflow_screen,node_findings,node_components,node_evidence,node_severity,node_estimate,node_estimate_source,node_completion,node_reports,node_sharing toneAmber
class node_app,node_native_assets,node_auth_ui,node_auth_bloc,node_auth_service toneMint
class node_driver,node_firebase,node_recipient toneIndigo
```

## Components

### Damage Inspection

- [Home](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/home_screen.dart): `lib/presentation/screens/home_screen.dart`
- [Camera Inference](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/camera_inference_screen.dart): `lib/presentation/screens/camera_inference_screen.dart`
- [Photo Analysis](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/single_image_screen.dart): `lib/presentation/screens/single_image_screen.dart`
- [Inference Controller](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/camera_inference_controller.dart): `lib/presentation/controllers/camera_inference_controller.dart`
- [Model Manager](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/model_manager.dart): `lib/services/model_manager.dart`
- [Detector Adapter](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/vehicle_component_detector_adapter.dart): `lib/services/vehicle_component_detector_adapter.dart`
- [On-device Model](https://github.com/vineetsarpal/autodentifyr/tree/main/assets/models): `assets/models`

### Assessment Workflow

- [Assessment Workflow](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_workflow_controller.dart): `lib/presentation/controllers/assessment_workflow_controller.dart`
- [Workflow Screen](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/assessment_workflow_screen.dart): `lib/presentation/screens/assessment_workflow_screen.dart`
- [Finding Review](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_finding_review_controller.dart): `lib/presentation/controllers/assessment_finding_review_controller.dart`
- [Component Map](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/vehicle_component_map_screen.dart): `lib/presentation/screens/vehicle_component_map_screen.dart`
- [Evidence Capture](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_evidence_controller.dart): `lib/presentation/controllers/assessment_evidence_controller.dart`
- [Severity Assessment](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_severity_controller.dart): `lib/presentation/controllers/assessment_severity_controller.dart`
- [Repair Estimate](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_estimate_controller.dart): `lib/presentation/controllers/assessment_estimate_controller.dart`
- [Estimate Source](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/assessment_estimate_source.dart): `lib/services/assessment_estimate_source.dart`
- [Assessment Completion](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/controllers/assessment_completion_controller.dart): `lib/presentation/controllers/assessment_completion_controller.dart`
- [Report Service](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/assessment_report_service.dart): `lib/services/assessment_report_service.dart`
- [Report Delivery](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/assessment_report_delivery.dart): `lib/services/assessment_report_delivery.dart`

### App Services

- [App Entry](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/main.dart): `lib/main.dart`
- [Android Asset Bridge](https://github.com/vineetsarpal/autodentifyr/blob/main/android/app/src/main/kotlin/com/vineetsarpal/autodentifyr/MainActivity.kt): `android/app/src/main/kotlin/com/vineetsarpal/autodentifyr/MainActivity.kt`
- [Login](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/screens/login_screen.dart): `lib/presentation/screens/login_screen.dart`
- [Auth State](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/presentation/bloc/auth/auth_bloc.dart): `lib/presentation/bloc/auth/auth_bloc.dart`
- [Auth Service](https://github.com/vineetsarpal/autodentifyr/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`

### Other components

- **Inspector**
- **Firebase Auth**
- **Report Recipient**

## Connections

- Inspector → App Entry: opens
- App Entry → Home: shows
- Home → Camera Inference: starts capture
- Home → Photo Analysis: chooses photo
- Camera Inference → Inference Controller: runs inference
- Photo Analysis → Inference Controller: runs inference
- Inference Controller → Model Manager: loads model
- Model Manager → On-device Model: loads locally
- Model Manager → Android Asset Bridge: materializes Android model
- Inference Controller → Detector Adapter: detects damage
- Inference Controller → Assessment Workflow: provides findings
- Workflow Screen → Assessment Workflow: drives workflow
- Assessment Workflow → Finding Review: reviews findings
- Assessment Workflow → Component Map: maps components
- Assessment Workflow → Evidence Capture: records evidence
- Assessment Workflow → Severity Assessment: assesses severity
- Assessment Workflow → Repair Estimate: calculates estimate
- Repair Estimate → Estimate Source: gets estimate data
- Assessment Workflow → Assessment Completion: completes assessment
- Assessment Completion → Report Service: creates report
- Assessment Completion → Report Delivery: delivers report
- Report Delivery → Report Recipient: shares report
- Login → Auth State: submits credentials
- Auth State → Auth Service: requests authentication
- Auth Service → Firebase Auth: authenticates
