# dma-teams/nasa-app architecture

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

- Interactive diagram: https://gitdiagram.com/dma-teams/nasa-app
- Repository: https://github.com/dma-teams/nasa-app

## Overview

Surco is an interactive crop-planning app for Honduras: users choose a place, review climate, select a planning mode and crops, then receive an annual planting plan with a calendar, explanation, parcel simulation, and printable output. The app also has a map, municipality and climate API routes, and climate and crop-planning logic. Edges are limited to relationships visible in the excerpts or SOURCE INDEX; unsampled route-to-service wiring is not inferred.

Main entry points: [`app/components/Explorador.tsx`](https://github.com/dma-teams/nasa-app/blob/main/app/components/Explorador.tsx) (Guided explorer), [`app/components/simulacion/SimulacionParcela.tsx`](https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/SimulacionParcela.tsx) (Parcel simulation), [`app/components/modulos/ModuloPlan.tsx`](https://github.com/dma-teams/nasa-app/blob/main/app/components/modulos/ModuloPlan.tsx) (Plan module), [`app/components/simulacion/Planta.tsx`](https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/Planta.tsx) (Plant illustration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journey["User journey"]
  node_explorer["Guided explorer<br/>[Explorador.tsx]"]
  node_home["Start panel<br/>[PanelInicio.tsx]"]
  node_placepanel["Place panel<br/>[PanelLugar.tsx]"]
  node_modepanel["Plan mode<br/>[PanelModo.tsx]"]
end

subgraph group_climate["Place and climate"]
  node_map["Interactive map<br/>[MapaReal.tsx]"]
  node_placeinfo["Place details<br/>[DatosLugar.tsx]"]
  node_climateview["Climate view<br/>[ModuloClima.tsx]"]
  node_monthlychart["Monthly chart<br/>[GraficaMensual.tsx]"]
  node_climateapi["Climate route<br/>[route.ts]"]
  node_municipalityapi["Municipality route<br/>[route.ts]"]
  node_climateengine["Climate logic<br/>[clima.ts]"]
end

subgraph group_planning["Plan logic"]
  node_api_client["API client<br/>[api.ts]"]
  node_planapi["Plan service logic<br/>[planApi.ts]"]
  node_planroute["Plan route<br/>[route.ts]"]
  node_planengine["Plan and calendar logic<br/>[plan.ts]"]
  node_cropdata["Crop catalog<br/>[cultivos.ts]"]
  node_types["Shared data types<br/>[tipos.ts]"]
end

subgraph group_results["Plan presentation"]
  node_planview["Plan module<br/>[ModuloPlan.tsx]"]
  node_calendar["Crop calendar"]
  node_printplan["Printable plan<br/>[PlanImprimible.tsx]"]
  node_cropdrawings["Crop and climate art<br/>[dibujos.tsx]"]
  node_ui["UI primitives<br/>[ui.tsx]"]
end

subgraph group_simulation["Parcel simulation"]
  node_simulation["Parcel simulation"]
  node_timeline["Simulation timeline<br/>[LineaTiempo.tsx]"]
  node_plant["Plant illustration<br/>[Planta.tsx]"]
  node_simulationlogic["Growth-stage logic<br/>[simulacion.ts]"]
  node_cropappearance["Crop appearance"]
end

node_farmer(("Grower"))

node_farmer -.->|"starts workflow"| node_explorer
node_explorer -->|"requests climate and plan"| node_api_client
node_explorer -.->|"uses map"| node_map
node_explorer -.->|"shows climate"| node_climateview
node_explorer -.->|"shows plan"| node_planview
node_planview -->|"renders calendar"| node_calendar
node_planview -.->|"opens simulation"| node_simulation
node_simulation -->|"derives growth stages"| node_simulationlogic
node_simulation -->|"groups plan periods"| node_planengine
node_simulation -->|"renders plant legend"| node_plant
node_plant -->|"gets appearance"| node_cropappearance
node_plant -->|"gets plant size"| node_simulationlogic
node_calendar -->|"builds calendar rows"| node_planengine
node_planengine -.->|"uses crop catalog"| node_cropdata

click node_explorer "https://github.com/dma-teams/nasa-app/blob/main/app/components/Explorador.tsx"
click node_home "https://github.com/dma-teams/nasa-app/blob/main/app/components/PanelInicio.tsx"
click node_placepanel "https://github.com/dma-teams/nasa-app/blob/main/app/components/PanelLugar.tsx"
click node_modepanel "https://github.com/dma-teams/nasa-app/blob/main/app/components/PanelModo.tsx"
click node_map "https://github.com/dma-teams/nasa-app/blob/main/app/components/MapaReal.tsx"
click node_placeinfo "https://github.com/dma-teams/nasa-app/blob/main/app/components/DatosLugar.tsx"
click node_climateview "https://github.com/dma-teams/nasa-app/blob/main/app/components/modulos/ModuloClima.tsx"
click node_monthlychart "https://github.com/dma-teams/nasa-app/blob/main/app/components/GraficaMensual.tsx"
click node_climateapi "https://github.com/dma-teams/nasa-app/blob/main/app/app/api/clima/route.ts"
click node_municipalityapi "https://github.com/dma-teams/nasa-app/blob/main/app/app/api/municipios/route.ts"
click node_climateengine "https://github.com/dma-teams/nasa-app/blob/main/app/lib/clima.ts"
click node_api_client "https://github.com/dma-teams/nasa-app/blob/main/app/lib/api.ts"
click node_planapi "https://github.com/dma-teams/nasa-app/blob/main/app/lib/planApi.ts"
click node_planroute "https://github.com/dma-teams/nasa-app/blob/main/app/app/api/plan/route.ts"
click node_planengine "https://github.com/dma-teams/nasa-app/blob/main/app/lib/plan.ts"
click node_cropdata "https://github.com/dma-teams/nasa-app/blob/main/app/lib/cultivos.ts"
click node_planview "https://github.com/dma-teams/nasa-app/blob/main/app/components/modulos/ModuloPlan.tsx"
click node_calendar "https://github.com/dma-teams/nasa-app/blob/main/app/components/CalendarioCultivos.tsx"
click node_printplan "https://github.com/dma-teams/nasa-app/blob/main/app/components/PlanImprimible.tsx"
click node_simulation "https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/SimulacionParcela.tsx"
click node_timeline "https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/LineaTiempo.tsx"
click node_plant "https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/Planta.tsx"
click node_simulationlogic "https://github.com/dma-teams/nasa-app/blob/main/app/lib/simulacion.ts"
click node_cropappearance "https://github.com/dma-teams/nasa-app/blob/main/app/lib/aspecto-cultivos.ts"
click node_types "https://github.com/dma-teams/nasa-app/blob/main/app/lib/tipos.ts"
click node_cropdrawings "https://github.com/dma-teams/nasa-app/blob/main/app/components/dibujos.tsx"
click node_ui "https://github.com/dma-teams/nasa-app/blob/main/app/components/ui.tsx"

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_explorer,node_home,node_placepanel,node_modepanel toneBlue
class node_map,node_placeinfo,node_climateview,node_monthlychart,node_climateapi,node_municipalityapi,node_climateengine toneAmber
class node_api_client,node_planapi,node_planroute,node_planengine,node_cropdata,node_types toneMint
class node_planview,node_calendar,node_printplan,node_cropdrawings,node_ui toneRose
class node_simulation,node_timeline,node_plant,node_simulationlogic,node_cropappearance,node_farmer toneIndigo
```

## Components

### User journey

- [Guided explorer](https://github.com/dma-teams/nasa-app/blob/main/app/components/Explorador.tsx): `app/components/Explorador.tsx`
- [Start panel](https://github.com/dma-teams/nasa-app/blob/main/app/components/PanelInicio.tsx): `app/components/PanelInicio.tsx`
- [Place panel](https://github.com/dma-teams/nasa-app/blob/main/app/components/PanelLugar.tsx): `app/components/PanelLugar.tsx`
- [Plan mode](https://github.com/dma-teams/nasa-app/blob/main/app/components/PanelModo.tsx): `app/components/PanelModo.tsx`

### Place and climate

- [Interactive map](https://github.com/dma-teams/nasa-app/blob/main/app/components/MapaReal.tsx): `app/components/MapaReal.tsx`
- [Place details](https://github.com/dma-teams/nasa-app/blob/main/app/components/DatosLugar.tsx): `app/components/DatosLugar.tsx`
- [Climate view](https://github.com/dma-teams/nasa-app/blob/main/app/components/modulos/ModuloClima.tsx): `app/components/modulos/ModuloClima.tsx`
- [Monthly chart](https://github.com/dma-teams/nasa-app/blob/main/app/components/GraficaMensual.tsx): `app/components/GraficaMensual.tsx`
- [Climate route](https://github.com/dma-teams/nasa-app/blob/main/app/app/api/clima/route.ts): `app/app/api/clima/route.ts`
- [Municipality route](https://github.com/dma-teams/nasa-app/blob/main/app/app/api/municipios/route.ts): `app/app/api/municipios/route.ts`
- [Climate logic](https://github.com/dma-teams/nasa-app/blob/main/app/lib/clima.ts): `app/lib/clima.ts`

### Plan logic

- [API client](https://github.com/dma-teams/nasa-app/blob/main/app/lib/api.ts): `app/lib/api.ts`
- [Plan service logic](https://github.com/dma-teams/nasa-app/blob/main/app/lib/planApi.ts): `app/lib/planApi.ts`
- [Plan route](https://github.com/dma-teams/nasa-app/blob/main/app/app/api/plan/route.ts): `app/app/api/plan/route.ts`
- [Plan and calendar logic](https://github.com/dma-teams/nasa-app/blob/main/app/lib/plan.ts): `app/lib/plan.ts`
- [Crop catalog](https://github.com/dma-teams/nasa-app/blob/main/app/lib/cultivos.ts): `app/lib/cultivos.ts`
- [Shared data types](https://github.com/dma-teams/nasa-app/blob/main/app/lib/tipos.ts): `app/lib/tipos.ts`

### Plan presentation

- [Plan module](https://github.com/dma-teams/nasa-app/blob/main/app/components/modulos/ModuloPlan.tsx): `app/components/modulos/ModuloPlan.tsx`
- [Crop calendar](https://github.com/dma-teams/nasa-app/blob/main/app/components/CalendarioCultivos.tsx): `app/components/CalendarioCultivos.tsx`
- [Printable plan](https://github.com/dma-teams/nasa-app/blob/main/app/components/PlanImprimible.tsx): `app/components/PlanImprimible.tsx`
- [Crop and climate art](https://github.com/dma-teams/nasa-app/blob/main/app/components/dibujos.tsx): `app/components/dibujos.tsx`
- [UI primitives](https://github.com/dma-teams/nasa-app/blob/main/app/components/ui.tsx): `app/components/ui.tsx`

### Parcel simulation

- [Parcel simulation](https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/SimulacionParcela.tsx): `app/components/simulacion/SimulacionParcela.tsx`
- [Simulation timeline](https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/LineaTiempo.tsx): `app/components/simulacion/LineaTiempo.tsx`
- [Plant illustration](https://github.com/dma-teams/nasa-app/blob/main/app/components/simulacion/Planta.tsx): `app/components/simulacion/Planta.tsx`
- [Growth-stage logic](https://github.com/dma-teams/nasa-app/blob/main/app/lib/simulacion.ts): `app/lib/simulacion.ts`
- [Crop appearance](https://github.com/dma-teams/nasa-app/blob/main/app/lib/aspecto-cultivos.ts): `app/lib/aspecto-cultivos.ts`

### Other components

- **Grower**

## Connections

- Grower → Guided explorer: starts workflow
- Guided explorer → API client: requests climate and plan (evidence: `app/components/Explorador.tsx`)
- Guided explorer → Interactive map: uses map (evidence: `app/components/Explorador.tsx`)
- Guided explorer → Climate view: shows climate (evidence: `app/components/Explorador.tsx`)
- Guided explorer → Plan module: shows plan (evidence: `app/components/Explorador.tsx`)
- Plan module → Crop calendar: renders calendar (evidence: `app/components/modulos/ModuloPlan.tsx`)
- Plan module → Parcel simulation: opens simulation (evidence: `app/components/modulos/ModuloPlan.tsx`)
- Parcel simulation → Growth-stage logic: derives growth stages (evidence: `app/components/simulacion/SimulacionParcela.tsx`)
- Parcel simulation → Plan and calendar logic: groups plan periods (evidence: `app/components/simulacion/SimulacionParcela.tsx`)
- Parcel simulation → Plant illustration: renders plant legend (evidence: `app/components/simulacion/SimulacionParcela.tsx`)
- Plant illustration → Crop appearance: gets appearance (evidence: `app/components/simulacion/Planta.tsx`)
- Plant illustration → Growth-stage logic: gets plant size (evidence: `app/components/simulacion/Planta.tsx`)
- Crop calendar → Plan and calendar logic: builds calendar rows (evidence: `app/components/CalendarioCultivos.tsx`)
- Plan and calendar logic → Crop catalog: uses crop catalog (evidence: `app/lib/plan.ts`)
