# sreejar3011/farmora-ai-agriculture-app architecture

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

- Interactive diagram: https://gitdiagram.com/sreejar3011/farmora-ai-agriculture-app
- Repository: https://github.com/sreejar3011/farmora-ai-agriculture-app

## Overview

Farmora is a Flutter app for scanning plant leaves, classifying disease with a CNN, and presenting multilingual farming recommendations. The tree shows separate screens and services for camera, machine learning, language, and history, but their Dart implementations were not sampled. The main workflow and connections below are therefore documented or inferred only at a high level; dashed edges indicate unverified links. Native desktop and mobile host files appear to be platform scaffolding rather than Farmora domain functionality.

Main entry points: [`lib/screens/home_screen.dart`](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/home_screen.dart) (Home screen), [`lib/screens/camera_screen.dart`](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/camera_screen.dart) (Camera screen), [`lib/main.dart`](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/main.dart) (App entry), [`lib/services/ml_service.dart`](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/ml_service.dart) (Disease classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_main["App entry<br/>[main.dart]"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_splash["Splash screen<br/>[splash_screen.dart]"]
end

subgraph group_detection["Disease detection"]
  node_camera["Camera screen<br/>[camera_screen.dart]"]
  node_camera_service["Camera service"]
  node_ml["Disease classifier<br/>[ml_service.dart]"]
  node_model["CNN model<br/>[plant_model.tflite]"]
  node_labels["Disease labels<br/>[labels.txt]"]
  node_result["Result screen<br/>[result_screen.dart]"]
  node_disease_card["Disease card<br/>[disease_card.dart]"]
end

subgraph group_support["User support"]
  node_history["History screen"]
  node_storage["History storage"]
  node_history_model["History record<br/>[history_model.dart]"]
  node_language["Language service"]
  node_language_toggle["Language toggle"]
  node_translations["Translations<br/>[en.json]"]
  node_settings["Settings screen"]
  node_about["About screen<br/>[about_screen.dart]"]
end

node_farmer(("Farmer"))
node_camera_actor(("Device camera"))

node_farmer -.->|"opens app"| node_main
node_main -.->|"opens home"| node_home
node_home -.->|"starts scan"| node_camera
node_camera -.->|"captures leaf"| node_camera_service
node_camera_service -.->|"uses camera"| node_camera_actor
node_camera -.->|"submits image"| node_ml
node_ml -.->|"classifies with"| node_model
node_ml -.->|"uses labels"| node_labels
node_camera -.->|"shows diagnosis"| node_result
node_result -.->|"renders result"| node_disease_card
node_result -.->|"saves history"| node_storage
node_storage -.->|"stores records"| node_history_model
node_history -.->|"loads history"| node_storage
node_home -.->|"offers language"| node_language_toggle
node_language_toggle -.->|"changes language"| node_language
node_language -.->|"loads text"| node_translations
node_home -.->|"opens settings"| node_settings
node_home -.->|"opens about"| node_about
node_main -.->|"starts with"| node_splash

click node_main "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/main.dart"
click node_home "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/home_screen.dart"
click node_camera "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/camera_screen.dart"
click node_camera_service "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/camera_service.dart"
click node_ml "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/ml_service.dart"
click node_model "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/assets/model/plant_model.tflite"
click node_labels "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/assets/model/labels.txt"
click node_result "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/result_screen.dart"
click node_disease_card "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/widgets/disease_card.dart"
click node_history "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/history_screen.dart"
click node_storage "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/storage_service.dart"
click node_history_model "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/models/history_model.dart"
click node_language "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/language_service.dart"
click node_language_toggle "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/widgets/language_toggle.dart"
click node_translations "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/assets/lang/en.json"
click node_settings "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/settings_screen.dart"
click node_about "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/about_screen.dart"
click node_splash "https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/splash_screen.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_main,node_home,node_splash toneBlue
class node_camera,node_camera_service,node_ml,node_model,node_labels,node_result,node_disease_card toneAmber
class node_history,node_storage,node_history_model,node_language,node_language_toggle,node_translations,node_settings,node_about toneMint
class node_farmer,node_camera_actor toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/main.dart): `lib/main.dart`
- [Home screen](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Splash screen](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/splash_screen.dart): `lib/screens/splash_screen.dart`

### Disease detection

- [Camera screen](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/camera_screen.dart): `lib/screens/camera_screen.dart`
- [Camera service](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/camera_service.dart): `lib/services/camera_service.dart`
- [Disease classifier](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/ml_service.dart): `lib/services/ml_service.dart`
- [CNN model](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/assets/model/plant_model.tflite): `assets/model/plant_model.tflite`
- [Disease labels](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/assets/model/labels.txt): `assets/model/labels.txt`
- [Result screen](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/result_screen.dart): `lib/screens/result_screen.dart`
- [Disease card](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/widgets/disease_card.dart): `lib/widgets/disease_card.dart`

### User support

- [History screen](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/history_screen.dart): `lib/screens/history_screen.dart`
- [History storage](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/storage_service.dart): `lib/services/storage_service.dart`
- [History record](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/models/history_model.dart): `lib/models/history_model.dart`
- [Language service](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/services/language_service.dart): `lib/services/language_service.dart`
- [Language toggle](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/widgets/language_toggle.dart): `lib/widgets/language_toggle.dart`
- [Translations](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/assets/lang/en.json): `assets/lang/en.json`
- [Settings screen](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/settings_screen.dart): `lib/screens/settings_screen.dart`
- [About screen](https://github.com/sreejar3011/farmora-ai-agriculture-app/blob/main/lib/screens/about_screen.dart): `lib/screens/about_screen.dart`

### Other components

- **Farmer**
- **Device camera**

## Connections

- Farmer → App entry: opens app
- App entry → Home screen: opens home
- Home screen → Camera screen: starts scan
- Camera screen → Camera service: captures leaf
- Camera service → Device camera: uses camera
- Camera screen → Disease classifier: submits image
- Disease classifier → CNN model: classifies with
- Disease classifier → Disease labels: uses labels
- Camera screen → Result screen: shows diagnosis
- Result screen → Disease card: renders result
- Result screen → History storage: saves history
- History storage → History record: stores records
- History screen → History storage: loads history
- Home screen → Language toggle: offers language
- Language toggle → Language service: changes language
- Language service → Translations: loads text
- Home screen → Settings screen: opens settings
- Home screen → About screen: opens about
- App entry → Splash screen: starts with
