# lauregalan/verdecampo architecture

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

- Interactive diagram: https://gitdiagram.com/lauregalan/verdecampo
- Repository: https://github.com/lauregalan/verdecampo

## Overview

This Laravel/Inertia application manages agricultural operations: fields and plots, crop campaigns, sowings, harvests, and applications of agricultural products. Users work through domain pages and controllers; a separate reporting branch produces operational and agronomic reports, while authentication and invitations govern access. The source index and excerpts support the dashboard, report-service, and model relationships shown as solid edges. Several domain controllers, routes, and pages are listed but unsampled, so their likely interactions are marked dashed and unverified.

Main entry points: [`routes/web.php`](https://github.com/lauregalan/verdecampo/blob/main/routes/web.php) (Web and API routes), [`app/Http/Controllers/ReporteController.php`](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/ReporteController.php) (Report dispatch), [`app/Models/Campania.php`](https://github.com/lauregalan/verdecampo/blob/main/app/Models/Campania.php) (Farm domain models), [`resources/js/app.tsx`](https://github.com/lauregalan/verdecampo/blob/main/resources/js/app.tsx) (Inertia client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and users"]
  node_user[("User accounts<br/>[User.php]")]
  node_auth["Authentication"]
  node_registration["Registration"]
  node_invitations["Invitation acceptance"]
  node_user_admin["User administration<br/>[UserController.php]"]
end

subgraph group_operations["Farm operations"]
  node_dashboard["Dashboard"]
  node_fields["Fields"]
  node_campaigns["Campaigns"]
  node_plots["Plots<br/>[LoteController.php]"]
  node_crops["Crops"]
  node_sowings["Sowings"]
  node_harvests["Harvests"]
  node_applications["Applications"]
  node_application_catalog["Application catalog"]
  node_domain_models[("Farm domain models<br/>[Campania.php]")]
end

subgraph group_reports["Reports and exports"]
  node_report_controller["Report dispatch"]
  node_report_services["Report calculations"]
  node_report_views["Report views"]
  node_exports["Data exports"]
end

subgraph group_platform["Application platform"]
  node_web_shell["Inertia application shell<br/>[app.blade.php]"]
  node_client["Inertia client<br/>[app.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_routing["Web and API routes<br/>[web.php]"]
  node_middleware["Request middleware<br/>[app.php]"]
end

node_operator(("Farm user"))

node_registration -->|"creates account"| node_user
node_invitations -->|"updates account"| node_user
node_dashboard -->|"queries users"| node_user
node_dashboard -->|"queries farm data"| node_domain_models
node_domain_models -->|"relates plots"| node_plots
node_domain_models -->|"relates fields"| node_fields
node_report_controller -->|"dispatches reports"| node_report_services
node_report_services -->|"queries operations"| node_domain_models
node_operator -.->|"uses interface"| node_client
node_client -.->|"mounts in shell"| node_web_shell
node_client -->|"uses client"| node_api_client
node_routing -->|"routes auth"| node_auth
node_routing -->|"routes registration"| node_registration
node_routing -.->|"routes dashboard"| node_dashboard
node_routing -.->|"routes operations"| node_fields
node_routing -.->|"routes campaigns"| node_campaigns
node_routing -.->|"routes plots"| node_plots
node_routing -.->|"routes crops"| node_crops
node_routing -.->|"routes sowings"| node_sowings
node_routing -.->|"routes harvests"| node_harvests
node_routing -.->|"routes applications"| node_applications
node_routing -.->|"routes reports"| node_report_controller
node_middleware -->|"configures routing"| node_routing
node_operator -.->|"accepts invitation"| node_invitations
node_operator -.->|"requests reports"| node_report_controller
node_report_controller -.->|"renders reports"| node_report_views
node_report_controller -.->|"offers exports"| node_exports

click node_user "https://github.com/lauregalan/verdecampo/blob/main/app/Models/User.php"
click node_auth "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_registration "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_invitations "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/AceptarInvitacionController.php"
click node_user_admin "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/UserController.php"
click node_dashboard "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/DashboardController.php"
click node_fields "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/CampoController.php"
click node_campaigns "https://github.com/lauregalan/verdecampo/blob/main/app/Services/CampaniaService.php"
click node_plots "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/LoteController.php"
click node_crops "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/CultivoController.php"
click node_sowings "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/SiembraController.php"
click node_harvests "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/CosechaController.php"
click node_applications "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/AplicacionController.php"
click node_application_catalog "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/ProductoAplicacionController.php"
click node_domain_models "https://github.com/lauregalan/verdecampo/blob/main/app/Models/Campania.php"
click node_report_controller "https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/ReporteController.php"
click node_report_services "https://github.com/lauregalan/verdecampo/blob/main/app/Services/ReporteAplicacionesService.php"
click node_report_views "https://github.com/lauregalan/verdecampo/blob/main/resources/views/reportes/aplicaciones.blade.php"
click node_exports "https://github.com/lauregalan/verdecampo/blob/main/app/Exports/AplicacionesExport.php"
click node_web_shell "https://github.com/lauregalan/verdecampo/blob/main/resources/views/app.blade.php"
click node_client "https://github.com/lauregalan/verdecampo/blob/main/resources/js/app.tsx"
click node_api_client "https://github.com/lauregalan/verdecampo/blob/main/resources/js/lib/api.ts"
click node_routing "https://github.com/lauregalan/verdecampo/blob/main/routes/web.php"
click node_middleware "https://github.com/lauregalan/verdecampo/blob/main/bootstrap/app.php"

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_user,node_auth,node_registration,node_invitations,node_user_admin,node_operator toneBlue
class node_dashboard,node_fields,node_campaigns,node_plots,node_crops,node_sowings,node_harvests,node_applications,node_application_catalog,node_domain_models toneAmber
class node_report_controller,node_report_services,node_report_views,node_exports toneMint
class node_web_shell,node_client,node_api_client,node_routing,node_middleware toneRose
```

## Components

### Access and users

- [User accounts](https://github.com/lauregalan/verdecampo/blob/main/app/Models/User.php): `app/Models/User.php`
- [Authentication](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Registration](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Invitation acceptance](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/AceptarInvitacionController.php): `app/Http/Controllers/AceptarInvitacionController.php`
- [User administration](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`

### Farm operations

- [Dashboard](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Fields](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/CampoController.php): `app/Http/Controllers/CampoController.php`
- [Campaigns](https://github.com/lauregalan/verdecampo/blob/main/app/Services/CampaniaService.php): `app/Services/CampaniaService.php`
- [Plots](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/LoteController.php): `app/Http/Controllers/LoteController.php`
- [Crops](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/CultivoController.php): `app/Http/Controllers/CultivoController.php`
- [Sowings](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/SiembraController.php): `app/Http/Controllers/SiembraController.php`
- [Harvests](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/CosechaController.php): `app/Http/Controllers/CosechaController.php`
- [Applications](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/AplicacionController.php): `app/Http/Controllers/AplicacionController.php`
- [Application catalog](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/ProductoAplicacionController.php): `app/Http/Controllers/ProductoAplicacionController.php`
- [Farm domain models](https://github.com/lauregalan/verdecampo/blob/main/app/Models/Campania.php): `app/Models/Campania.php`

### Reports and exports

- [Report dispatch](https://github.com/lauregalan/verdecampo/blob/main/app/Http/Controllers/ReporteController.php): `app/Http/Controllers/ReporteController.php`
- [Report calculations](https://github.com/lauregalan/verdecampo/blob/main/app/Services/ReporteAplicacionesService.php): `app/Services/ReporteAplicacionesService.php`
- [Report views](https://github.com/lauregalan/verdecampo/blob/main/resources/views/reportes/aplicaciones.blade.php): `resources/views/reportes/aplicaciones.blade.php`
- [Data exports](https://github.com/lauregalan/verdecampo/blob/main/app/Exports/AplicacionesExport.php): `app/Exports/AplicacionesExport.php`

### Application platform

- [Inertia application shell](https://github.com/lauregalan/verdecampo/blob/main/resources/views/app.blade.php): `resources/views/app.blade.php`
- [Inertia client](https://github.com/lauregalan/verdecampo/blob/main/resources/js/app.tsx): `resources/js/app.tsx`
- [API client](https://github.com/lauregalan/verdecampo/blob/main/resources/js/lib/api.ts): `resources/js/lib/api.ts`
- [Web and API routes](https://github.com/lauregalan/verdecampo/blob/main/routes/web.php): `routes/web.php`
- [Request middleware](https://github.com/lauregalan/verdecampo/blob/main/bootstrap/app.php): `bootstrap/app.php`

### Other components

- **Farm user**

## Connections

- Registration → User accounts: creates account (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Invitation acceptance → User accounts: updates account (evidence: `app/Http/Controllers/AceptarInvitacionController.php`)
- Dashboard → User accounts: queries users (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard → Farm domain models: queries farm data (evidence: `app/Http/Controllers/DashboardController.php`)
- Farm domain models → Plots: relates plots (evidence: `app/Models/Campania.php`)
- Farm domain models → Fields: relates fields (evidence: `app/Models/Campania.php`)
- Report dispatch → Report calculations: dispatches reports (evidence: `app/Http/Controllers/ReporteController.php`)
- Report calculations → Farm domain models: queries operations (evidence: `app/Services/ReporteAplicacionesService.php`)
- Farm user → Inertia client: uses interface
- Inertia client → Inertia application shell: mounts in shell
- Inertia client → API client: uses client (evidence: `resources/js/app.tsx`)
- Web and API routes → Authentication: routes auth
- Web and API routes → Registration: routes registration
- Web and API routes → Dashboard: routes dashboard
- Web and API routes → Fields: routes operations
- Web and API routes → Campaigns: routes campaigns
- Web and API routes → Plots: routes plots
- Web and API routes → Crops: routes crops
- Web and API routes → Sowings: routes sowings
- Web and API routes → Harvests: routes harvests
- Web and API routes → Applications: routes applications
- Web and API routes → Report dispatch: routes reports
- Request middleware → Web and API routes: configures routing (evidence: `bootstrap/app.php`)
- Farm user → Invitation acceptance: accepts invitation
- Farm user → Report dispatch: requests reports
- Report dispatch → Report views: renders reports
- Report dispatch → Data exports: offers exports
