# kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system architecture

> Architecture diagram of the GitHub repository kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system
- Repository: https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system

## Overview

AgriAssist is a farm-operations product with a .NET API, React staff console, Flutter farmer app, and a Python AI-service foundation. The user-facing flow spans farm/crop planning, inspections and issue follow-up, resource and weather analysis, and task scheduling/approval; authentication and persisted domain records support those workflows. The README describes the AgenticAI backend client as a disabled placeholder, while the Python service contains workflow endpoints and agent modules. Several frontend and backend subsystem links are documented only at product level; unsampled implementations are represented by their existing directories.

Main entry points: [`backend/AgriAssist.Api/Controllers`](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Controllers) (REST endpoints), [`backend/AgriAssist.Api/Data/AppDbContext.cs`](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/backend/AgriAssist.Api/Data/AppDbContext.cs) (Application database), [`frontend/react-app/src`](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/frontend/react-app/src) (Staff console), [`backend/AgriAssist.Api/Services/Inspections`](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/Inspections) (Inspections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Applications"]
  node_mobile["Farmer mobile app"]
  node_console["Staff console"]
  node_routes["Console routing<br/>[App.tsx]"]
  node_api_client["Web API client<br/>[client.ts]"]
end

subgraph group_api["API and Domain Workflows"]
  node_controllers["REST endpoints<br/>[Controllers]"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_crop_planning["Crop planning<br/>[CropPlanning]"]
  node_inspections["Inspections<br/>[Inspections]"]
  node_resources["Resources and weather<br/>[Resources]"]
  node_scheduling["Task approval<br/>[TaskApproval]"]
  node_guide["Cultivation guide"]
end

subgraph group_ai["AI Analysis Service"]
  node_ai_service["AI workflow API<br/>[main.py]"]
  node_agents["Analysis agents"]
  node_ai_tools["Backend tool client"]
  node_llm["LLM provider layer"]
end

subgraph group_data["Persistence and Integrations"]
  node_database[("Application database<br/>[AppDbContext.cs]")]
  node_cloudinary["Image storage<br/>[Cloudinary]"]
  node_weather_service["Weather provider<br/>[Weather]"]
  node_ai_client["AgenticAI client<br/>[AgenticAI]"]
end

node_farmers(("Farmers"))
node_staff(("Staff and officers"))

node_farmers -->|"use"| node_mobile
node_staff -->|"use"| node_console
node_console -->|"renders"| node_routes
node_routes -.->|"requests data"| node_api_client
node_console -->|"calls API"| node_controllers
node_mobile -->|"calls API"| node_controllers
node_controllers -.->|"delegates"| node_auth
node_controllers -->|"delegates"| node_crop_planning
node_controllers -->|"delegates"| node_inspections
node_controllers -->|"delegates"| node_resources
node_controllers -->|"delegates"| node_scheduling
node_controllers -->|"delegates"| node_guide
node_crop_planning -.->|"reads and writes"| node_database
node_inspections -.->|"reads and writes"| node_database
node_resources -->|"reads and writes"| node_database
node_scheduling -.->|"reads and writes"| node_database
node_inspections -.->|"stores images"| node_cloudinary
node_resources -.->|"gets weather"| node_weather_service
node_ai_service -->|"dispatches"| node_agents
node_agents -.->|"uses provider"| node_llm
node_agents -.->|"uses tools"| node_ai_tools
node_ai_tools -.->|"calls backend"| node_controllers
node_ai_client -.->|"integration disabled"| node_ai_service

click node_mobile "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/mobile/flutter_app"
click node_console "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/frontend/react-app/src"
click node_routes "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/frontend/react-app/src/App.tsx"
click node_api_client "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/frontend/react-app/src/api/client.ts"
click node_controllers "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Controllers"
click node_auth "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/backend/AgriAssist.Api/Services/Shared/AuthService.cs"
click node_crop_planning "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/CropPlanning"
click node_inspections "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/Inspections"
click node_resources "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/Resources"
click node_scheduling "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/TaskApproval"
click node_guide "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/FinalCultivationGuide"
click node_ai_service "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/ai-service/main.py"
click node_agents "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/ai-service/agents"
click node_ai_tools "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/ai-service/tools/backend_tool_client.py"
click node_llm "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/ai-service/providers/base_llm_provider.py"
click node_database "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/backend/AgriAssist.Api/Data/AppDbContext.cs"
click node_cloudinary "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/ExternalServices/Cloudinary"
click node_weather_service "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/ExternalServices/Weather"
click node_ai_client "https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/ExternalServices/AgenticAI"

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_mobile,node_console,node_routes,node_api_client toneBlue
class node_controllers,node_auth,node_crop_planning,node_inspections,node_resources,node_scheduling,node_guide toneAmber
class node_ai_service,node_agents,node_ai_tools,node_llm toneMint
class node_database,node_cloudinary,node_weather_service,node_ai_client toneRose
class node_farmers,node_staff toneIndigo
```

## Components

### User Applications

- [Farmer mobile app](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/mobile/flutter_app): `mobile/flutter_app`
- [Staff console](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/frontend/react-app/src): `frontend/react-app/src`
- [Console routing](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/frontend/react-app/src/App.tsx): `frontend/react-app/src/App.tsx`
- [Web API client](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/frontend/react-app/src/api/client.ts): `frontend/react-app/src/api/client.ts`

### API and Domain Workflows

- [REST endpoints](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Controllers): `backend/AgriAssist.Api/Controllers`
- [Authentication](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/backend/AgriAssist.Api/Services/Shared/AuthService.cs): `backend/AgriAssist.Api/Services/Shared/AuthService.cs`
- [Crop planning](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/CropPlanning): `backend/AgriAssist.Api/Services/CropPlanning`
- [Inspections](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/Inspections): `backend/AgriAssist.Api/Services/Inspections`
- [Resources and weather](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/Resources): `backend/AgriAssist.Api/Services/Resources`
- [Task approval](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/TaskApproval): `backend/AgriAssist.Api/Services/TaskApproval`
- [Cultivation guide](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/Services/FinalCultivationGuide): `backend/AgriAssist.Api/Services/FinalCultivationGuide`

### AI Analysis Service

- [AI workflow API](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/ai-service/main.py): `ai-service/main.py`
- [Analysis agents](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/ai-service/agents): `ai-service/agents`
- [Backend tool client](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/ai-service/tools/backend_tool_client.py): `ai-service/tools/backend_tool_client.py`
- [LLM provider layer](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/ai-service/providers/base_llm_provider.py): `ai-service/providers/base_llm_provider.py`

### Persistence and Integrations

- [Application database](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/blob/main/backend/AgriAssist.Api/Data/AppDbContext.cs): `backend/AgriAssist.Api/Data/AppDbContext.cs`
- [Image storage](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/ExternalServices/Cloudinary): `backend/AgriAssist.Api/ExternalServices/Cloudinary`
- [Weather provider](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/ExternalServices/Weather): `backend/AgriAssist.Api/ExternalServices/Weather`
- [AgenticAI client](https://github.com/kaushalye1234/intelligent-pre-cultivation-farm-planning-and-management-system/tree/main/backend/AgriAssist.Api/ExternalServices/AgenticAI): `backend/AgriAssist.Api/ExternalServices/AgenticAI`

### Other components

- **Farmers**
- **Staff and officers**

## Connections

- Farmers → Farmer mobile app: use (evidence: `README.md`)
- Staff and officers → Staff console: use (evidence: `README.md`)
- Staff console → Console routing: renders (evidence: `frontend/react-app/src/App.tsx`)
- Console routing → Web API client: requests data
- Staff console → REST endpoints: calls API (evidence: `README.md`)
- Farmer mobile app → REST endpoints: calls API (evidence: `README.md`)
- REST endpoints → Authentication: delegates
- REST endpoints → Crop planning: delegates (evidence: `backend/AgriAssist.Api/Controllers/CropPlanning/CropPlanningController.cs`)
- REST endpoints → Inspections: delegates (evidence: `backend/AgriAssist.Api/Controllers/Inspections/InspectionsController.cs`)
- REST endpoints → Resources and weather: delegates (evidence: `backend/AgriAssist.Api/Controllers/Resources/ResourcesController.cs`)
- REST endpoints → Task approval: delegates (evidence: `backend/AgriAssist.Api/Controllers/TaskApproval/TaskApprovalController.cs`)
- REST endpoints → Cultivation guide: delegates (evidence: `backend/AgriAssist.Api/Controllers/TaskApproval/TaskApprovalController.cs`)
- Crop planning → Application database: reads and writes
- Inspections → Application database: reads and writes
- Resources and weather → Application database: reads and writes (evidence: `backend/AgriAssist.Api/Services/Resources/ResourceRequirementResearchService.cs`)
- Task approval → Application database: reads and writes
- Inspections → Image storage: stores images
- Resources and weather → Weather provider: gets weather
- AI workflow API → Analysis agents: dispatches (evidence: `ai-service/main.py`)
- Analysis agents → LLM provider layer: uses provider (evidence: `ai-service/agents/scheduling_profile_retriever.py`)
- Analysis agents → Backend tool client: uses tools
- Backend tool client → REST endpoints: calls backend
- AgenticAI client → AI workflow API: integration disabled (evidence: `README.md`)
