# wallsunu/ecoplantas architecture

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

- Interactive diagram: https://gitdiagram.com/wallsunu/ecoplantas
- Repository: https://github.com/wallsunu/ecoplantas

## Overview

EcoPlantas is an ASP.NET Core web app and REST API for a local recycling-and-plant exchange program. Residents browse plants, register and record recycling, contact the program, and can request recycling-impact classifications or plant recommendations. The AI chat enriches questions with live recycling and catalog data before using a configured LLM; map endpoints geocode locations. The graph preserves these product branches and the PostgreSQL-backed domain. Relationships are based on shown excerpts, the source index, or README statements; some controller details and subsystem internals were not sampled.

Main entry points: [`Data/ApplicationDbContext.cs`](https://github.com/wallsunu/ecoplantas/blob/main/Data/ApplicationDbContext.cs) (EF data context), [`Controllers/Api/MlClasificacionController.cs`](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/Api/MlClasificacionController.cs) (ML endpoints), [`Services/SemanticKernel/EcoPlantasSemanticKernelService.cs`](https://github.com/wallsunu/ecoplantas/blob/main/Services/SemanticKernel/EcoPlantasSemanticKernelService.cs) (Context and plugin), [`Services/LLM/LlmProviderService.cs`](https://github.com/wallsunu/ecoplantas/blob/main/Services/LLM/LlmProviderService.cs) (LLM provider router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and accounts"]
  node_home["Program landing<br/>[HomeController.cs]"]
  node_auth["Accounts and login<br/>[AuthController.cs]"]
  node_contact["Contact messages"]
  node_api["REST endpoints"]
  node_mapapi["Map endpoints<br/>[MapaController.cs]"]
  node_mlapi["ML endpoints"]
  node_aiapi["AI chat endpoint<br/>[AiController.cs]"]
  node_users["User accounts<br/>[Usuario.cs]"]
  node_messages["Contact messages<br/>[ContactoMensaje.cs]"]
end

subgraph group_domain["Recycling and catalog"]
  node_catalog["Plant catalog"]
  node_webrecycling["Recycling records"]
  node_products["Plant products<br/>[ProductoEco.cs]"]
  node_recycling["Recycling entries<br/>[Reciclaje.cs]"]
end

subgraph group_data["Persistence"]
  node_dbcontext["EF data context"]
  node_postgres[("PostgreSQL")]
  node_seed["Initial data seed<br/>[DataSeeder.cs]"]
  node_redis[("Redis sessions")]
end

subgraph group_intelligence["AI and ML"]
  node_classify["Impact classifier"]
  node_recommend["Plant recommender"]
  node_agent["Chat agent<br/>[AgentService.cs]"]
  node_kernel["Context and plugin"]
  node_provider["LLM provider router"]
  node_llmservice["LLM interface<br/>[ILlmService.cs]"]
end

subgraph group_integrations["External services"]
  node_ollama["Ollama client<br/>[OllamaService.cs]"]
  node_openai["OpenAI client"]
  node_mapservice["Geocoding service<br/>[MapaService.cs]"]
end

node_resident(("Resident"))
node_googlemaps["Google Geocoding"]

node_resident -->|"views"| node_home
node_resident -->|"browses"| node_catalog
node_resident -->|"registers"| node_auth
node_resident -->|"records recycling"| node_webrecycling
node_resident -->|"sends message"| node_contact
node_resident -->|"requests"| node_api
node_resident -->|"asks"| node_aiapi
node_catalog -->|"queries"| node_dbcontext
node_auth -->|"reads and writes"| node_dbcontext
node_webrecycling -->|"manages records"| node_dbcontext
node_contact -->|"persists messages"| node_dbcontext
node_api -->|"serves data"| node_dbcontext
node_dbcontext -->|"maps"| node_products
node_dbcontext -->|"maps"| node_recycling
node_dbcontext -->|"maps"| node_users
node_dbcontext -->|"maps"| node_messages
node_dbcontext -->|"persists through EF"| node_postgres
node_seed -->|"seeds"| node_dbcontext
node_resident -->|"requests prediction"| node_mlapi
node_mlapi -->|"classifies"| node_classify
node_mlapi -->|"recommends"| node_recommend
node_resident -.->|"requests geocoding"| node_mapapi
node_mapapi -->|"delegates"| node_mapservice
node_mapservice -->|"geocodes via HTTP"| node_googlemaps
node_aiapi -->|"forwards chat"| node_agent
node_agent -->|"delegates context"| node_kernel
node_kernel -->|"reads live data"| node_dbcontext
node_kernel -->|"generates response"| node_provider
node_provider -->|"selects provider"| node_ollama
node_provider -->|"selects provider"| node_openai
node_ollama -->|"implements"| node_llmservice
node_openai -->|"implements"| node_llmservice
node_redis -.->|"stores sessions"| node_resident

click node_home "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/HomeController.cs"
click node_catalog "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/CatalogoController.cs"
click node_auth "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/AuthController.cs"
click node_webrecycling "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/ReciclajeController.cs"
click node_contact "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/ContactoController.cs"
click node_api "https://github.com/wallsunu/ecoplantas/tree/main/Controllers/Api"
click node_mapapi "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/Api/MapaController.cs"
click node_mlapi "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/Api/MlClasificacionController.cs"
click node_aiapi "https://github.com/wallsunu/ecoplantas/blob/main/Controllers/AiController.cs"
click node_dbcontext "https://github.com/wallsunu/ecoplantas/blob/main/Data/ApplicationDbContext.cs"
click node_products "https://github.com/wallsunu/ecoplantas/blob/main/Models/ProductoEco.cs"
click node_recycling "https://github.com/wallsunu/ecoplantas/blob/main/Models/Reciclaje.cs"
click node_users "https://github.com/wallsunu/ecoplantas/blob/main/Models/Usuario.cs"
click node_messages "https://github.com/wallsunu/ecoplantas/blob/main/Models/ContactoMensaje.cs"
click node_seed "https://github.com/wallsunu/ecoplantas/blob/main/Data/DataSeeder.cs"
click node_classify "https://github.com/wallsunu/ecoplantas/blob/main/Services/ML/ClasificacionReciclajeService.cs"
click node_recommend "https://github.com/wallsunu/ecoplantas/blob/main/Services/ML/RecomendacionPlantaService.cs"
click node_agent "https://github.com/wallsunu/ecoplantas/blob/main/Services/AgentService.cs"
click node_kernel "https://github.com/wallsunu/ecoplantas/blob/main/Services/SemanticKernel/EcoPlantasSemanticKernelService.cs"
click node_provider "https://github.com/wallsunu/ecoplantas/blob/main/Services/LLM/LlmProviderService.cs"
click node_ollama "https://github.com/wallsunu/ecoplantas/blob/main/Services/OllamaService.cs"
click node_openai "https://github.com/wallsunu/ecoplantas/blob/main/Services/LLM/OpenAiLlmService.cs"
click node_llmservice "https://github.com/wallsunu/ecoplantas/blob/main/Services/LLM/ILlmService.cs"
click node_mapservice "https://github.com/wallsunu/ecoplantas/blob/main/Services/MapaService.cs"

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_home,node_auth,node_contact,node_api,node_mapapi,node_mlapi,node_aiapi,node_users,node_messages toneBlue
class node_catalog,node_webrecycling,node_products,node_recycling toneAmber
class node_dbcontext,node_postgres,node_seed,node_redis toneMint
class node_classify,node_recommend,node_agent,node_kernel,node_provider,node_llmservice toneRose
class node_ollama,node_openai,node_mapservice,node_resident,node_googlemaps toneIndigo
```

## Components

### Web and accounts

- [Program landing](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/HomeController.cs): `Controllers/HomeController.cs`
- [Accounts and login](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/AuthController.cs): `Controllers/AuthController.cs`
- [Contact messages](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/ContactoController.cs): `Controllers/ContactoController.cs`
- [REST endpoints](https://github.com/wallsunu/ecoplantas/tree/main/Controllers/Api): `Controllers/Api`
- [Map endpoints](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/Api/MapaController.cs): `Controllers/Api/MapaController.cs`
- [ML endpoints](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/Api/MlClasificacionController.cs): `Controllers/Api/MlClasificacionController.cs`
- [AI chat endpoint](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/AiController.cs): `Controllers/AiController.cs`
- [User accounts](https://github.com/wallsunu/ecoplantas/blob/main/Models/Usuario.cs): `Models/Usuario.cs`
- [Contact messages](https://github.com/wallsunu/ecoplantas/blob/main/Models/ContactoMensaje.cs): `Models/ContactoMensaje.cs`

### Recycling and catalog

- [Plant catalog](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/CatalogoController.cs): `Controllers/CatalogoController.cs`
- [Recycling records](https://github.com/wallsunu/ecoplantas/blob/main/Controllers/ReciclajeController.cs): `Controllers/ReciclajeController.cs`
- [Plant products](https://github.com/wallsunu/ecoplantas/blob/main/Models/ProductoEco.cs): `Models/ProductoEco.cs`
- [Recycling entries](https://github.com/wallsunu/ecoplantas/blob/main/Models/Reciclaje.cs): `Models/Reciclaje.cs`

### Persistence

- [EF data context](https://github.com/wallsunu/ecoplantas/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`
- **PostgreSQL**
- [Initial data seed](https://github.com/wallsunu/ecoplantas/blob/main/Data/DataSeeder.cs): `Data/DataSeeder.cs`
- **Redis sessions**

### AI and ML

- [Impact classifier](https://github.com/wallsunu/ecoplantas/blob/main/Services/ML/ClasificacionReciclajeService.cs): `Services/ML/ClasificacionReciclajeService.cs`
- [Plant recommender](https://github.com/wallsunu/ecoplantas/blob/main/Services/ML/RecomendacionPlantaService.cs): `Services/ML/RecomendacionPlantaService.cs`
- [Chat agent](https://github.com/wallsunu/ecoplantas/blob/main/Services/AgentService.cs): `Services/AgentService.cs`
- [Context and plugin](https://github.com/wallsunu/ecoplantas/blob/main/Services/SemanticKernel/EcoPlantasSemanticKernelService.cs): `Services/SemanticKernel/EcoPlantasSemanticKernelService.cs`
- [LLM provider router](https://github.com/wallsunu/ecoplantas/blob/main/Services/LLM/LlmProviderService.cs): `Services/LLM/LlmProviderService.cs`
- [LLM interface](https://github.com/wallsunu/ecoplantas/blob/main/Services/LLM/ILlmService.cs): `Services/LLM/ILlmService.cs`

### External services

- [Ollama client](https://github.com/wallsunu/ecoplantas/blob/main/Services/OllamaService.cs): `Services/OllamaService.cs`
- [OpenAI client](https://github.com/wallsunu/ecoplantas/blob/main/Services/LLM/OpenAiLlmService.cs): `Services/LLM/OpenAiLlmService.cs`
- [Geocoding service](https://github.com/wallsunu/ecoplantas/blob/main/Services/MapaService.cs): `Services/MapaService.cs`

### Other components

- **Resident**
- **Google Geocoding**

## Connections

- Resident → Program landing: views
- Resident → Plant catalog: browses
- Resident → Accounts and login: registers
- Resident → Recycling records: records recycling
- Resident → Contact messages: sends message
- Resident → REST endpoints: requests
- Resident → AI chat endpoint: asks
- Plant catalog → EF data context: queries (evidence: `Controllers/CatalogoController.cs`)
- Accounts and login → EF data context: reads and writes (evidence: `Controllers/AuthController.cs`)
- Recycling records → EF data context: manages records (evidence: `Controllers/ReciclajeController.cs`)
- Contact messages → EF data context: persists messages (evidence: `Controllers/ContactoController.cs`)
- REST endpoints → EF data context: serves data (evidence: `Controllers/Api/ProductosApiController.cs`)
- EF data context → Plant products: maps (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → Recycling entries: maps (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → User accounts: maps (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → Contact messages: maps (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → PostgreSQL: persists through EF
- Initial data seed → EF data context: seeds (evidence: `Program.cs`)
- Resident → ML endpoints: requests prediction
- ML endpoints → Impact classifier: classifies (evidence: `Controllers/Api/MlClasificacionController.cs`)
- ML endpoints → Plant recommender: recommends (evidence: `Controllers/Api/MlClasificacionController.cs`)
- Resident → Map endpoints: requests geocoding
- Map endpoints → Geocoding service: delegates (evidence: `Controllers/Api/MapaController.cs`)
- Geocoding service → Google Geocoding: geocodes via HTTP (evidence: `Services/MapaService.cs`)
- AI chat endpoint → Chat agent: forwards chat (evidence: `Controllers/AiController.cs`)
- Chat agent → Context and plugin: delegates context (evidence: `Services/AgentService.cs`)
- Context and plugin → EF data context: reads live data (evidence: `Services/SemanticKernel/EcoPlantasSemanticKernelService.cs`)
- Context and plugin → LLM provider router: generates response (evidence: `Services/SemanticKernel/EcoPlantasSemanticKernelService.cs`)
- LLM provider router → Ollama client: selects provider (evidence: `Services/LLM/LlmProviderService.cs`)
- LLM provider router → OpenAI client: selects provider (evidence: `Services/LLM/LlmProviderService.cs`)
- Ollama client → LLM interface: implements (evidence: `Services/OllamaService.cs`)
- OpenAI client → LLM interface: implements (evidence: `Services/LLM/OpenAiLlmService.cs`)
- Redis sessions → Resident: stores sessions
