# jessvilla1975/agrovisionapi architecture

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

- Interactive diagram: https://gitdiagram.com/jessvilla1975/agrovisionapi
- Repository: https://github.com/jessvilla1975/agrovisionapi

## Overview

AgroVision is a web workspace for drone orthomosaic processing, with additional project preprocessing, model detection, custom training and model-review capabilities. The main user journey is to select a project, upload imagery or an orthophoto, process or analyze it, monitor progress, then inspect and download results. The graph combines documented workflows with relationships visible in the sampled frontend imports and service excerpts. Many backend routes and orchestration modules were not sampled, so those connections are omitted or marked unverified rather than inferred.

Main entry points: [`client/src/App.jsx`](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/App.jsx) (Application shell), [`server/src/infrastructure/customTraining/CustomTrainingService.js`](https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/infrastructure/customTraining/CustomTrainingService.js) (Training service), [`client/src/features/modelResults/components/ModelResultsView.jsx`](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/components/ModelResultsView.jsx) (Model results), [`client/src/app/useWorkspaceSession.js`](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/app/useWorkspaceSession.js) (Workspace session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace and projects"]
  node_app["Application shell<br/>[App.jsx]"]
  node_session["Workspace session"]
  node_projects["Project workspace<br/>[ProjectsView.jsx]"]
  node_project_api["Project API<br/>[projectApi.js]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_sidebar["Project selector<br/>[ProjectSidebar.jsx]"]
  node_http_client["HTTP client<br/>[client.js]"]
  node_api_config["API configuration<br/>[api.js]"]
  node_lightbox["Image lightbox<br/>[ImageLightbox.jsx]"]
end

subgraph group_processing["Photogrammetry and preprocessing"]
  node_preprocess["Preprocessing panel"]
  node_preprocess_view["Preprocessing view"]
  node_photogrammetry["Photogrammetry controls<br/>[ProcessControl.jsx]"]
  node_orthophoto_plane["Orthophoto map"]
end

subgraph group_detection["Detection and analysis"]
  node_detection_view["Detection workspace<br/>[DetectionView.jsx]"]
  node_detection_panel["Model detection"]
end

subgraph group_models["Training and model results"]
  node_custom_training["Custom training"]
  node_model_results["Model results"]
  node_review_gallery["Prediction review<br/>[ReviewGallery.jsx]"]
  node_training_progress["Training progress"]
  node_model_api["Model results API<br/>[modelResultsApi.js]"]
  node_line_chart["Metrics chart<br/>[LineChart.jsx]"]
end

subgraph group_backend["Backend services"]
  node_training_config["Training configuration"]
  node_training_service["Training service"]
  node_roboflow["Dataset inspection<br/>[RoboflowDataset.js]"]
  node_python_runtime["Python runtime<br/>[PythonRuntime.js]"]
  node_odm["ODM processing<br/>[OdmUseCases.js]"]
end

node_user(("Workspace user"))
node_postgres[("PostgreSQL")]
node_docker_odm["ODM container"]
node_mapbox["Mapbox"]

node_user -->|"uses"| node_app
node_app -->|"manages"| node_session
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_projects
node_app -->|"renders"| node_preprocess_view
node_app -->|"renders"| node_detection_view
node_app -->|"renders"| node_custom_training
node_app -->|"renders"| node_model_results
node_app -->|"renders"| node_training_progress
node_session -->|"requests project data"| node_project_api
node_session -.->|"selects project"| node_sidebar
node_projects -->|"shows selector"| node_sidebar
node_projects -->|"shows map"| node_orthophoto_plane
node_preprocess_view -->|"renders"| node_preprocess
node_user -->|"starts processing"| node_photogrammetry
node_photogrammetry -.->|"runs processing"| node_docker_odm
node_user -->|"views photo locations"| node_mapbox
node_detection_view -->|"renders"| node_detection_panel
node_custom_training -.->|"submits training"| node_training_service
node_training_service -->|"normalizes settings"| node_training_config
node_training_service -->|"inspects dataset"| node_roboflow
node_training_service -->|"spawns trainer"| node_python_runtime
node_model_results -->|"renders"| node_review_gallery
node_model_results -->|"loads results"| node_model_api
node_training_progress -->|"loads progress"| node_model_api
node_review_gallery -->|"opens images"| node_lightbox
node_model_results -->|"charts metrics"| node_line_chart
node_model_api -->|"sends requests"| node_http_client
node_http_client -->|"builds API URLs"| node_api_config
node_photogrammetry -.->|"requests processing"| node_odm
node_odm -.->|"runs container"| node_docker_odm
node_training_service -.->|"uses account storage"| node_postgres

click node_app "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/App.jsx"
click node_session "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/app/useWorkspaceSession.js"
click node_projects "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/projects/components/ProjectsView.jsx"
click node_project_api "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/projects/api/projectApi.js"
click node_dashboard "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/dashboard/components/Dashboard.jsx"
click node_sidebar "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/projects/components/ProjectSidebar.jsx"
click node_preprocess "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/preprocessing/components/PreprocessPanel.jsx"
click node_preprocess_view "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/preprocessing/components/PreprocessingView.jsx"
click node_photogrammetry "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/photogrammetry/ProcessControl.jsx"
click node_orthophoto_plane "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/ui/OrthophotoPlane.jsx"
click node_detection_view "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/detection/components/DetectionView.jsx"
click node_detection_panel "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/detection/components/ModelDetectionPanel.jsx"
click node_custom_training "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/customTraining/components/CustomTrainingView.jsx"
click node_training_config "https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/domain/customTraining/CustomTrainingConfig.js"
click node_training_service "https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/infrastructure/customTraining/CustomTrainingService.js"
click node_roboflow "https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/infrastructure/customTraining/RoboflowDataset.js"
click node_python_runtime "https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/infrastructure/python/PythonRuntime.js"
click node_model_results "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/components/ModelResultsView.jsx"
click node_review_gallery "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/components/ReviewGallery.jsx"
click node_training_progress "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/components/TrainingProgressView.jsx"
click node_model_api "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/api/modelResultsApi.js"
click node_http_client "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/http/client.js"
click node_api_config "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/config/api.js"
click node_lightbox "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/ui/ImageLightbox.jsx"
click node_line_chart "https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/ui/LineChart.jsx"
click node_odm "https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/application/odm/OdmUseCases.js"

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_app,node_session,node_projects,node_project_api,node_dashboard,node_sidebar,node_http_client,node_api_config,node_lightbox,node_user toneBlue
class node_preprocess,node_preprocess_view,node_photogrammetry,node_orthophoto_plane,node_postgres toneAmber
class node_detection_view,node_detection_panel toneMint
class node_custom_training,node_model_results,node_review_gallery,node_training_progress,node_model_api,node_line_chart toneRose
class node_training_config,node_training_service,node_roboflow,node_python_runtime,node_odm,node_docker_odm,node_mapbox toneIndigo
```

## Components

### Workspace and projects

- [Application shell](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Workspace session](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/app/useWorkspaceSession.js): `client/src/app/useWorkspaceSession.js`
- [Project workspace](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/projects/components/ProjectsView.jsx): `client/src/features/projects/components/ProjectsView.jsx`
- [Project API](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/projects/api/projectApi.js): `client/src/features/projects/api/projectApi.js`
- [Dashboard](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/dashboard/components/Dashboard.jsx): `client/src/features/dashboard/components/Dashboard.jsx`
- [Project selector](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/projects/components/ProjectSidebar.jsx): `client/src/features/projects/components/ProjectSidebar.jsx`
- [HTTP client](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/http/client.js): `client/src/shared/http/client.js`
- [API configuration](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/config/api.js): `client/src/shared/config/api.js`
- [Image lightbox](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/ui/ImageLightbox.jsx): `client/src/shared/ui/ImageLightbox.jsx`

### Photogrammetry and preprocessing

- [Preprocessing panel](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/preprocessing/components/PreprocessPanel.jsx): `client/src/features/preprocessing/components/PreprocessPanel.jsx`
- [Preprocessing view](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/preprocessing/components/PreprocessingView.jsx): `client/src/features/preprocessing/components/PreprocessingView.jsx`
- [Photogrammetry controls](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/photogrammetry/ProcessControl.jsx): `client/src/features/photogrammetry/ProcessControl.jsx`
- [Orthophoto map](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/ui/OrthophotoPlane.jsx): `client/src/shared/ui/OrthophotoPlane.jsx`

### Detection and analysis

- [Detection workspace](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/detection/components/DetectionView.jsx): `client/src/features/detection/components/DetectionView.jsx`
- [Model detection](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/detection/components/ModelDetectionPanel.jsx): `client/src/features/detection/components/ModelDetectionPanel.jsx`

### Training and model results

- [Custom training](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/customTraining/components/CustomTrainingView.jsx): `client/src/features/customTraining/components/CustomTrainingView.jsx`
- [Model results](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/components/ModelResultsView.jsx): `client/src/features/modelResults/components/ModelResultsView.jsx`
- [Prediction review](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/components/ReviewGallery.jsx): `client/src/features/modelResults/components/ReviewGallery.jsx`
- [Training progress](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/components/TrainingProgressView.jsx): `client/src/features/modelResults/components/TrainingProgressView.jsx`
- [Model results API](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/features/modelResults/api/modelResultsApi.js): `client/src/features/modelResults/api/modelResultsApi.js`
- [Metrics chart](https://github.com/jessvilla1975/agrovisionapi/blob/main/client/src/shared/ui/LineChart.jsx): `client/src/shared/ui/LineChart.jsx`

### Backend services

- [Training configuration](https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/domain/customTraining/CustomTrainingConfig.js): `server/src/domain/customTraining/CustomTrainingConfig.js`
- [Training service](https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/infrastructure/customTraining/CustomTrainingService.js): `server/src/infrastructure/customTraining/CustomTrainingService.js`
- [Dataset inspection](https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/infrastructure/customTraining/RoboflowDataset.js): `server/src/infrastructure/customTraining/RoboflowDataset.js`
- [Python runtime](https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/infrastructure/python/PythonRuntime.js): `server/src/infrastructure/python/PythonRuntime.js`
- [ODM processing](https://github.com/jessvilla1975/agrovisionapi/blob/main/server/src/application/odm/OdmUseCases.js): `server/src/application/odm/OdmUseCases.js`

### Other components

- **Workspace user**
- **PostgreSQL**
- **ODM container**
- **Mapbox**

## Connections

- Workspace user → Application shell: uses (evidence: `README.md`)
- Application shell → Workspace session: manages (evidence: `client/src/App.jsx`)
- Application shell → Dashboard: renders (evidence: `client/src/App.jsx`)
- Application shell → Project workspace: renders (evidence: `client/src/App.jsx`)
- Application shell → Preprocessing view: renders (evidence: `client/src/App.jsx`)
- Application shell → Detection workspace: renders (evidence: `client/src/App.jsx`)
- Application shell → Custom training: renders (evidence: `client/src/App.jsx`)
- Application shell → Model results: renders (evidence: `client/src/App.jsx`)
- Application shell → Training progress: renders (evidence: `client/src/App.jsx`)
- Workspace session → Project API: requests project data (evidence: `client/src/app/useWorkspaceSession.js`)
- Workspace session → Project selector: selects project
- Project workspace → Project selector: shows selector (evidence: `client/src/features/projects/components/ProjectsView.jsx`)
- Project workspace → Orthophoto map: shows map (evidence: `client/src/features/projects/components/ProjectsView.jsx`)
- Preprocessing view → Preprocessing panel: renders (evidence: `client/src/features/preprocessing/components/PreprocessingView.jsx`)
- Workspace user → Photogrammetry controls: starts processing (evidence: `README.md`)
- Photogrammetry controls → ODM container: runs processing
- Workspace user → Mapbox: views photo locations (evidence: `README.md`)
- Detection workspace → Model detection: renders (evidence: `client/src/features/detection/components/DetectionView.jsx`)
- Custom training → Training service: submits training
- Training service → Training configuration: normalizes settings (evidence: `server/src/infrastructure/customTraining/CustomTrainingService.js`)
- Training service → Dataset inspection: inspects dataset (evidence: `server/src/infrastructure/customTraining/CustomTrainingService.js`)
- Training service → Python runtime: spawns trainer (evidence: `server/src/infrastructure/customTraining/CustomTrainingService.js`)
- Model results → Prediction review: renders (evidence: `client/src/features/modelResults/components/ModelResultsView.jsx`)
- Model results → Model results API: loads results (evidence: `client/src/features/modelResults/components/ModelResultsView.jsx`)
- Training progress → Model results API: loads progress (evidence: `client/src/features/modelResults/components/TrainingProgressView.jsx`)
- Prediction review → Image lightbox: opens images (evidence: `client/src/features/modelResults/components/ReviewGallery.jsx`)
- Model results → Metrics chart: charts metrics (evidence: `client/src/features/modelResults/components/ModelResultsView.jsx`)
- Model results API → HTTP client: sends requests (evidence: `client/src/features/modelResults/api/modelResultsApi.js`)
- HTTP client → API configuration: builds API URLs (evidence: `client/src/shared/http/client.js`)
- Photogrammetry controls → ODM processing: requests processing
- ODM processing → ODM container: runs container
- Training service → PostgreSQL: uses account storage
